Skip to content
Snippets Groups Projects
Unverified Commit 9a50d339 authored by Oliver Smith's avatar Oliver Smith
Browse files

pmb/data/merge-usr: deduplicate code (MR 2388)

Create a common merge() function that can be adjusted in the next patch,
because the logic for merging needs to be more complicated now.
parent f38d5255
No related branches found
No related tags found
No related merge requests found
# SC3043: "In POSIX sh, 'local' is undefined" - busybox sh and pretty much all
# other shells can handle it though and Alpine uses it too in lots of scripts.
disable=SC3043
......@@ -17,22 +17,16 @@ if [ -L "$CHROOT"/bin ]; then
exit 1
fi
# /bin -> /usr/bin
mv "$CHROOT"/bin/* "$CHROOT"/usr/bin/
rmdir "$CHROOT"/bin
ln -s usr/bin "$CHROOT"/bin
# /sbin -> /usr/bin
mv "$CHROOT"/sbin/* "$CHROOT"/usr/bin/
rmdir "$CHROOT"/sbin
ln -s usr/bin "$CHROOT"/sbin
# /lib -> /usr/lib
mv "$CHROOT"/lib/* "$CHROOT"/usr/lib/
rmdir "$CHROOT"/lib
ln -s usr/lib "$CHROOT"/lib
# /usr/sbin -> /usr/bin
mv "$CHROOT"/usr/sbin/* "$CHROOT"/usr/bin/
rmdir "$CHROOT"/usr/sbin
ln -s bin "$CHROOT"/usr/sbin
merge() {
local src="$1"
local dest="$2"
mv "$CHROOT/$src/"* "$CHROOT/$dest/"
rmdir "$CHROOT/$src"
ln -s "/$dest" "$CHROOT/$src"
}
merge bin usr/bin
merge sbin usr/bin
merge lib usr/lib
merge usr/sbin usr/bin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment