#
# The purpose of using busybox-static for /bin/sh is for installation
# of libc6, which has a troublesome preinst script (that can and
-# should be ignored in this use case). When busybox-udeb the script is
-# replaced by a symbolic link to that binary. But libc6 is then
-# already installed
+# should be ignored in this use case), and for an /sbin/losetup
+# binary. When busybox-udeb is installed the /bin/sh script is
+# replaced by a symbolic link to the new busybox. But libc6 is then
+# already installed, and /sbin/losetup is retained (due to being hard
+# link).
target_dpkg -E --unpack $(debs busybox-static)
executable $INITRD/bin/sh <<EOF
#!$(pwd)/$INITRD/bin/busybox sh
mkdir $INITRD/etc/console-setup
mkdir -p $INITRD/cdrom
-sed 's/\(jessie.|ascii\))/\1|daedalus)/' -i \
- $INITRD/usr/share/debootstrap/scripts/daedalus
-#sed '/base-passwd/s/x/cat mawk base-/' -i \
-# $INITRD/usr/share/debootstrap/scripts/daedalus
-
+# Add a udev rule to recognize /dev/loop0 as possible media device
+heredoc $INITRD/lib/udev/rules.d/82-loop0-is-media.rules <<EOF
+KERNEL=="loop0", ENV{ID_CDROM}="1"
+EOF
######################################################################
# Install "initrd-init" as the initrd /init to run at boot time. This