summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/busybox31
-rwxr-xr-xhooks/klibc3
2 files changed, 34 insertions, 0 deletions
diff --git a/hooks/busybox b/hooks/busybox
new file mode 100755
index 0000000..7845f58
--- /dev/null
+++ b/hooks/busybox
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+PREREQ=""
+
+prereqs()
+{
+ echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+# busybox
+if [ "${BUSYBOX}" = "n" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then
+ # those root need busybox
+ eval "$(mount | awk '/ \/ / {print "r_dev=" $1; exit}')"
+ if [ "${r_dev#/dev/mapper/}" != "${r_dev}" ]; then
+ echo "Warning: Busybox is required for successful boot!"
+ fi
+else
+ . /usr/share/initramfs-tools/hook-functions
+ rm -f ${DESTDIR}/bin/sh
+ rm -f ${DESTDIR}/bin/busybox
+ copy_exec ${BUSYBOXDIR}/busybox /bin/busybox
+ ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh
+fi
diff --git a/hooks/klibc b/hooks/klibc
index c6bb75e..56f49ef 100755
--- a/hooks/klibc
+++ b/hooks/klibc
@@ -19,3 +19,6 @@ esac
ln -s /usr/lib/klibc/bin/* ${DESTDIR}/bin
ln -s /lib/klibc-*.so ${DESTDIR}/lib
rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/gzip ${DESTDIR}/bin/zcat ${DESTDIR}/bin/gunzip
+if [ "${BUSYBOX}" = "n" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then
+ mv ${DESTDIR}/bin/sh.shared ${DESTDIR}/bin/sh
+fi