/usr/share/tcos/hooks-addons/01busybox is in initramfs-tools-tcos 0.89.93ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | # hook addon for busybox
# check for a decent version of busybox
# ubuntu busybox-initramfs don't have some utils
if [ -e "${TCOS_BINS}/busybox" ]; then
_echo " Found busybox in ${TCOS_BINS}/busybox"
[ -e $DESTDIR/bin/busybox ] && rm -f $DESTDIR/bin/busybox
cpifexists ${TCOS_BINS}/busybox /bin/
elif [ $DESTDIR/bin/busybox ]; then
test1=$($DESTDIR/bin/busybox tftp --help 2>&1 | grep -c -i usage)
test2=$($DESTDIR/bin/busybox awk --help 2>&1 | grep -c -i usage)
test3=$($DESTDIR/bin/busybox losetup --help 2>&1 | grep -c -i usage)
if [ $test1 = 0 -o $test2 = 0 -o $test3 = 0 ]; then
if [ -x /bin/busybox ]; then
_echo " INFO: Better busybox found, replacing it..."
rm -f $DESTDIR/bin/busybox
cpifexists /bin/busybox /bin/
else
_echo "ERROR:"
_echo ""
_echo " The initramfs busybox version don't have some needed utils."
_echo " Please install other busybox that have awk, tftp, and losetup"
_echo ""
_echo " This TCOS image will not work."
_echo ""
fi
else
_echo " Busybox pass all tests OK"
fi
# check for busybox static
#if ldd /bin/busybox | grep -q libc; then
# _echo " busybox (not-static) getty and login disabled"
#fi
else
_echo "busybox not found in initramfs yet..."
fi
|