SUITE="daedalus"
SECTION="main"
ARCH="amd64"
+MBR=gpt # or dos
PKGFILE=${REPO//\//_}_${SUITE}_${SECTION}_binary-${ARCH}_Packages
if [ ! -r $PKGFILE ] ; then
awk '
BEGIN { print "###" > "mapdepends.txt"; print "###" > "mapfile.txt"; }
$1=="Package:" {P=$2; next}
-$1=="Depends:" {print P,$2 >> "mapdepends.txt";next }
+$1=="Pre-Depends:" {print P,$0 >> "mapdepends.txt";next }
+$1=="Depends:" {print P,$0 >> "mapdepends.txt";next }
$1=="Filename:" {print P,$2 >> "mapfile.txt";next }
' ${PKGFILE}
# later pivoting onto a "full" filesystem.
echo "# Create initrd filesystem"
-rm -r initrd
+rm -fr initrd
-echo "# Install busybox, and fluff it up"
-fakechroot fakeroot \
-dpkg --log=dpkg.log --root=initrd -i $(debfile busybox-static)
+echo "# Extract busybox, and fluff it up"
+mkdir initrd
+debextract initrd $(debfile busybox-static)
for L in $(initrd/bin/busybox --listfull) ; do
mkdir -p $(dirname initrd/$L)
case "$L" in
debextract kernel $(debfile syslinux-common)
debextract kernel $(debfile syslinux-efi)
debextract kernel $(debfile syslinux-utils)
+ debextract kernel $(debfile isolinux)
fi
echo "# Include some kernel modules in the initrd"
# disk
scsi_common scsi_mod libata ata_piix ata_generic cdrom sr_mod
crc32-pclmul crct10dif_common crc-t10dif crc64 crc64-rocksoft
- t10-pi sd_mod sg nls_cp437 nls_ascii fat vfat ext4 isofs
+ t10-pi sd_mod sg
+ nls_cp437 nls_ascii fat vfat
+ crc32c_generic jbd2 mbcache crc16 ext4
+ isofs
+ overlay
# input
psmouse evdev
# network
rm -f bootimage.raw
dd if=/dev/zero of=bootimage.raw bs=32M count=1
-# Prepare a dos partition table with a first partition marked as EFI
+# Prepare a gpt/dos partition table with a first partition marked as EFI
sfdisk bootimage.raw <<EOF
+label: $MBR
+
2048 32767 U *
- - L
EOF
# Add an ext2 filesystem at offset 61440*512
# Copy initrd.gz and kernel into the fat filesystem root
-mke2fs -E offset=$((61440*512)) -F bootimage.raw
+mke2fs -t ext4 -E offset=$((34816*512)) -F bootimage.raw 15M
mcopy $IMG initrd.gz ::
mcopy $IMG kernel/boot/vm* ::/vmlinuz
kernel/usr/lib/syslinux/modules/efi64/* ::/EFI/BOOT
mcopy $IMG syslinux-uefi.cfg ::/EFI/BOOT/syslx64.cfg
+
syslinux --install --offset=${IMG#*@@} bootimage.raw
+
+case "$MBR" in
+ dos) MBRBIN=mbr.bin ;;
+ gpt)
+ MBRBIN=gptmbr.bin
+ sfdisk --relocate gpt-bak-std bootimage.raw
+ sfdisk -f --part-attrs bootimage.raw 1 LegacyBIOSBootable
+ ;;
+ *) exit 1 ;;
+esac
dd conv=notrunc of=bootimage.raw bs=440 count=1 \
- if=kernel/usr/lib/syslinux/mbr/mbr.bin
+ if=kernel/usr/lib/syslinux/mbr/$MBRBIN
exit