summaryrefslogtreecommitdiffstats
path: root/modules.d/busybox/install-busybox-stage4.sh
blob: 030717738e7311d304d80a7604fcd4fd6b7a46e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

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 and that the apps are symlinked.
	# Otherwise we copy it and activate applets in /opt/openslx/{s,}/bin
	bb_path="$(type -p busybox)"
	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" "${NEWROOT}/opt/openslx/$app"
		done
	fi
fi
true