summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-12-12 20:10:13 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-12-12 20:10:13 (EST)
commit78c90ddf1599b74b894460b700e25416626746e5 (patch)
tree7c2f78606829c6c192e4baf6e8dc6f625c37f831
parentea53d2c9b249ceb20e3fe792bb18921b4435320c (diff)
busybox.pkg/prerm: Check for OPKG_BUSYBOX_SAVED
-rwxr-xr-xbusybox.pkg/prerm6
-rw-r--r--changelog4
2 files changed, 10 insertions, 0 deletions
diff --git a/busybox.pkg/prerm b/busybox.pkg/prerm
index 25e55f6..ad8e863 100755
--- a/busybox.pkg/prerm
+++ b/busybox.pkg/prerm
@@ -1,5 +1,11 @@
#!/bin/sh
+# Ensure opkg saved a copy of busybox and its links. Otherwise, opkg could
+# remove busybox, try to use gzip, crash, and leave behind a broken system.
+if [ x"${OPKG_BUSYBOX_SAVED+set}" != x'set' ]; then
+ exit 1
+fi
+
if [ "x${1}" = 'xupgrade' ]; then
if [ -f /usr/share/busybox/init-scripts ]; then
while read -r script enabled; do
diff --git a/changelog b/changelog
index 45460e1..d128d68 100644
--- a/changelog
+++ b/changelog
@@ -4,6 +4,10 @@ busybox (1.32.0-3) trunk
command in case "route" is disabled.
* </sbin/init> is no longer managed with update-alternatives, as it is
needed for prokit's foreign installations.
+ * The <prerm> script now ensures that opkg has saved busybox before
+ removing it, as busybox is essential to opkg and other packages'
+ maintainer scripts. This enforces the requirement of opkg-lede
+ >= 0+git20190131.d4ba162-7.
-- Patrick McDermott <patrick.mcdermott@libiquity.com> Sat, 12 Dec 2020 10:09:01 -0500