From eea7e5df69e993feeb39e664105016b89e0e09e6 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Wed, 29 Jul 2009 16:57:15 +0200 Subject: 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 --- hooks/busybox | 31 +++++++++++++++++++++++++++++++ hooks/klibc | 3 +++ 2 files changed, 34 insertions(+) create mode 100755 hooks/busybox (limited to 'hooks') 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 -- cgit v1.2.3