From 78c90ddf1599b74b894460b700e25416626746e5 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 12 Dec 2020 20:10:13 -0500 Subject: busybox.pkg/prerm: Check for OPKG_BUSYBOX_SAVED --- (limited to 'busybox.pkg/prerm') 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 -- cgit v0.9.1