From 3e821b1d665132be24e0185c2c6885f6e2b616eb Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 23 Nov 2020 05:46:41 -0500 Subject: build: Don't u-a /bin/sh Doing so requires patching [1] opkg-cl and update-alternatives to not use /bin/sh in case busybox is in an unconfigured state when running any package's maintainer scripts. Such a patch would force all maintainer scripts to be ash scripts (fun fact: in Debian, bash's preinst is actually a compiled C program). [1]: http://git.proteanos.com/pkg/opkg-lede.git/commit/?id=d711e8cd5e0d7186dad840b9883a97a93f2dd383 --- diff --git a/build b/build index 57f9148..7dd21f6 100755 --- a/build +++ b/build @@ -39,9 +39,13 @@ install: build mkdir -p dest/usr/share/busybox set -e; exec 3>dest/usr/share/busybox/alternatives; \ for f in dest/bin/* dest/sbin/* dest/usr/bin/* dest/usr/sbin/*; do \ - [ x"$${f}" = x'dest/bin/busybox' ] && continue; \ - mv "$${f}" "$${f}.busybox"; \ - printf '%s\n' "$${f#dest}" >&3; \ + case "$${f}" in \ + dest/bin/busybox | dest/bin/sh) ;; \ + *) \ + mv "$${f}" "$${f}.busybox"; \ + printf '%s\n' "$${f#dest}" >&3; \ + ;; \ + esac; \ done; \ exec 3>&- set -e; $(config_enabled); $(install_init_script); \ -- cgit v0.9.1