summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2021-07-23 15:12:45 +0200
committerJonathan Bauer2021-07-23 15:12:45 +0200
commitb6561f6d38ce2adea7c35b890295dd8300ad9e9a (patch)
tree3209bb68c56c70ee9276ad0e8b1ffc8cb520338c
parent[conf-tgz] unpack tgz after everything else (diff)
downloadsystemd-init-b6561f6d38ce2adea7c35b890295dd8300ad9e9a.tar.gz
systemd-init-b6561f6d38ce2adea7c35b890295dd8300ad9e9a.tar.xz
systemd-init-b6561f6d38ce2adea7c35b890295dd8300ad9e9a.zip
[busybox] fix applet install paths in stage4
using a folder when calling 'busybox --install' installs ALL applets in that directory without bin or sbin prefix. That causes some problems in some of our scripts. As a workaround, install them manually.
-rw-r--r--modules.d/busybox/install-busybox-stage4.sh17
1 files changed, 10 insertions, 7 deletions
diff --git a/modules.d/busybox/install-busybox-stage4.sh b/modules.d/busybox/install-busybox-stage4.sh
index ad34b75c..55b1ab16 100644
--- a/modules.d/busybox/install-busybox-stage4.sh
+++ b/modules.d/busybox/install-busybox-stage4.sh
@@ -3,14 +3,17 @@
if hash busybox; then
# check if the stage4 has a busybox in the same location
# as within the initramfs. If so, we keep it and just hope
- # that everything works out. If there is none, we can copy
- # our busybox there safely
+ # that everything works out and that the apps are symlinked.
+ # Otherwise we copy it and activate applets in /opt/openslx/{s,}/bin
bb_path="$(type -p busybox)"
- if ! [ -x "${NEWROOT}/${bb_path}" ]; then
- cp -f "$bb_path" "${NEWROOT}/${bb_path}"
+ if [ -n "$bb_path" ] && [ ! -x "${NEWROOT}/opt/openslx/bin/busybox" ]; then
+ mkdir -p "${NEWROOT}"/opt/openslx/{s,}bin
+ cp -f "$bb_path" "${NEWROOT}/opt/openslx/bin/busybox"
+ # --list-full gives {s,}bin prefixes
+ for app in $(busybox --list-full); do
+ ln -s "/opt/openslx/bin/busybox" "/opt/openslx/$app" \
+ || warn "Failed to symlink '$app' to busybox."
+ done
fi
- # finally install the applets under /opt/openslx/bin
- mkdir -p "${NEWROOT}/opt/openslx/bin"
- busybox --install -s "${NEWROOT}/opt/openslx/bin"
fi
true