Restore automatic selection between busybox and klibc by default

Some systems are working alright with the old default of BUSYBOX=y and
no busybox installed.  We should only force use of busybox if another
package installing initramfs scripts needs it.

Change the default from BUSYBOX=y to BUSYBOX=auto, and give that the
old semantics.

Closes: #809204
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Ben Hutchings 2015-12-31 03:41:08 +00:00
parent 19422ac10d
commit bf445db3ed
3 changed files with 18 additions and 10 deletions

View File

@ -20,12 +20,14 @@
MODULES=most
#
# BUSYBOX: [ y | n ]
# BUSYBOX: [ y | n | auto ]
#
# Use busybox shell and utilities. If set to n, klibc utilities will be used.
# If set to auto (or unset), busybox will be used if installed and klibc will
# be used otherwise.
#
BUSYBOX=y
BUSYBOX=auto
#
# KEYMAP: [ y | n ]

View File

@ -16,14 +16,19 @@ prereqs)
esac
# busybox
if [ "${BUSYBOX}" != "n" ]; then
if ! [ -e ${BUSYBOXDIR}/busybox ]; then
if [ "${BUSYBOX}" = "n" ]; then
exit 0
fi
if ! [ -e ${BUSYBOXDIR}/busybox ]; then
if [ "${BUSYBOX}" = "y" ]; then
echo >&2 "E: busybox is required but not installed"
exit 1
else
exit 0
fi
. /usr/share/initramfs-tools/hook-functions
rm -f ${DESTDIR}/bin/sh
rm -f ${DESTDIR}/bin/busybox
copy_exec ${BUSYBOXDIR}/busybox /bin/busybox
ln -s busybox ${DESTDIR}/bin/sh
fi
. /usr/share/initramfs-tools/hook-functions
rm -f ${DESTDIR}/bin/sh
rm -f ${DESTDIR}/bin/busybox
copy_exec ${BUSYBOXDIR}/busybox /bin/busybox
ln -s busybox ${DESTDIR}/bin/sh

View File

@ -19,7 +19,8 @@ esac
cp -pnL /usr/lib/klibc/bin/* ${DESTDIR}/bin
cp -pL /lib/klibc-*.so ${DESTDIR}/lib
rm -f ${DESTDIR}/bin/kinit* ${DESTDIR}/bin/zcat
if [ "${BUSYBOX}" = "n" ]; then
if [ "${BUSYBOX}" = "n" ] || \
{ [ "${BUSYBOX}" != "y" ] && ! [ -e ${BUSYBOXDIR}/busybox ]; }; then
if [ -e ${DESTDIR}/bin/sh.shared ]; then
# Some platforms build a shared klibc/sh:
mv ${DESTDIR}/bin/sh.shared ${DESTDIR}/bin/sh