diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-11-23 05:46:41 (EST) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-11-23 05:50:55 (EST) |
commit | 3e821b1d665132be24e0185c2c6885f6e2b616eb (patch) | |
tree | 0828105ebad5eedc9831b2221606eef1dcab4d7a /build | |
parent | e00facdaa170b45862d404a9a28874f5f0223dad (diff) |
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
Diffstat (limited to 'build')
-rwxr-xr-x | build | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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); \ |