summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2009-07-29 16:57:15 +0200
committermaximilian attems <maks@debian.org>2009-07-29 16:58:31 +0200
commiteea7e5df69e993feeb39e664105016b89e0e09e6 (patch)
tree3ac6c5254e8c3637eddf52e320c1fe4d277e1783 /hooks
parenta71705c44cc48a31ad57443dbbdb1fdf8815f9fb (diff)
downloadinitramfs-tools-eea7e5df69e993feeb39e664105016b89e0e09e6.tar.gz
initramfs-tools-eea7e5df69e993feeb39e664105016b89e0e09e6.zip
move busybox addition to a hook script
thus export the 2 needed busybox variables, be sure to have the klibc shell for now around. Signed-off-by: maximilian attems <maks@debian.org>
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