summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick 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)
commit3e821b1d665132be24e0185c2c6885f6e2b616eb (patch)
tree0828105ebad5eedc9831b2221606eef1dcab4d7a
parente00facdaa170b45862d404a9a28874f5f0223dad (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
-rwxr-xr-xbuild10
1 files changed, 7 insertions, 3 deletions
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); \