mirror of
https://salsa.debian.org/kernel-team/initramfs-tools.git
synced 2026-01-26 15:39:08 +00:00
hooks/busybox: Fail if busybox is wanted but not found
Currently we silently fall back to klibc if BUSYBOX=y but we can't find it. This can result in an unusable initramfs, so fail instead of continuing. This mitigates bug #783297. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
parent
41eb6ac420
commit
7285ffb144
@ -22,7 +22,7 @@ MODULES=most
|
||||
#
|
||||
# BUSYBOX: [ y | n ]
|
||||
#
|
||||
# Use busybox if available.
|
||||
# Use busybox shell and utilities. If set to n, klibc utilities will be used.
|
||||
#
|
||||
|
||||
BUSYBOX=y
|
||||
|
||||
10
debian/NEWS
vendored
10
debian/NEWS
vendored
@ -1,3 +1,13 @@
|
||||
initramfs-tools (0.121) UNRELEASED; urgency=medium
|
||||
|
||||
* If initramfs-tools is configured to use busybox but it is not
|
||||
installed, mkinitramfs will now fail. Previously it would quietly use
|
||||
klibc instead, sometimes producing a broken initramfs. You may need
|
||||
to modify /etc/initramfs-tools/initramfs-tools.conf or install busybox
|
||||
when upgrading.
|
||||
|
||||
-- Ben Hutchings <ben@decadent.org.uk> Sun, 06 Dec 2015 02:58:35 +0000
|
||||
|
||||
initramfs-tools (0.119) unstable; urgency=medium
|
||||
|
||||
* The initramfs will now run fsck on the root filesystem before
|
||||
|
||||
@ -16,7 +16,11 @@ prereqs)
|
||||
esac
|
||||
|
||||
# busybox
|
||||
if [ "${BUSYBOX}" != "n" ] && [ -e ${BUSYBOXDIR}/busybox ]; then
|
||||
if [ "${BUSYBOX}" != "n" ]; then
|
||||
if ! [ -e ${BUSYBOXDIR}/busybox ]; then
|
||||
echo >&2 "E: busybox is required but not installed"
|
||||
exit 1
|
||||
fi
|
||||
. /usr/share/initramfs-tools/hook-functions
|
||||
rm -f ${DESTDIR}/bin/sh
|
||||
rm -f ${DESTDIR}/bin/busybox
|
||||
|
||||
@ -19,7 +19,7 @@ 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" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then
|
||||
if [ "${BUSYBOX}" = "n" ]; then
|
||||
if [ -e ${DESTDIR}/bin/sh.shared ]; then
|
||||
# Some platforms build a shared klibc/sh:
|
||||
mv ${DESTDIR}/bin/sh.shared ${DESTDIR}/bin/sh
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user