From 0be484d35ece0291ec1181c2e1b870a4b72538d4 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Sat, 6 Feb 2016 01:28:35 -0800 Subject: [PATCH] Add support for actually mounting the boot partition and copying contents to it --- .../ubuntu-cpc/hooks/032-disk-image.binary | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/live-build/ubuntu-cpc/hooks/032-disk-image.binary b/live-build/ubuntu-cpc/hooks/032-disk-image.binary index 06fa4f39..1eae3308 100755 --- a/live-build/ubuntu-cpc/hooks/032-disk-image.binary +++ b/live-build/ubuntu-cpc/hooks/032-disk-image.binary @@ -8,8 +8,6 @@ case $ARCH in exit 0 ;; *) - ROOTPART=1 - ROOTPART_START=1 ;; esac @@ -39,7 +37,11 @@ disk_image=binary/boot/disk.ext4 create_empty_disk_image "${disk_image}" create_empty_partition_table "${disk_image}" + +ROOTPART=1 if [ -n "$BOOTPART_START" ]; then + ROOTPART=2 + ROOTPART_START="$BOOTPART_END" create_empty_partition "$disk_image" 1 "$BOOTPART_START" "$BOOTPART_END" 1 fi create_empty_partition "${disk_image}" "$ROOTPART" "$ROOTPART_START" -1 @@ -50,6 +52,15 @@ mount_image "${disk_image}" "$ROOTPART" make_ext4_partition "${rootfs_dev_mapper}" mkdir mountpoint mount "${rootfs_dev_mapper}" mountpoint + +if [ -n "$BOOT_MOUNTPOINT" ]; then + boot_dev_mapper="${rootfs_dev_mapper%[0-9]*}1" + # assume fat32 for now + mkfs.vfat -n system-boot "$boot_dev_mapper" + mkdir -p "mountpoint/$BOOT_MOUNTPOINT" + mount "$boot_dev_mapper" "mountpoint/$BOOT_MOUNTPOINT" +fi + cp -a chroot/* mountpoint/ case $ARCH in @@ -99,6 +110,10 @@ EOF fi +if [ -n "$BOOT_MOUNTPOINT" ]; then + umount "mountpoint/$BOOT_MOUNTPOINT" +fi + umount_partition mountpoint rmdir mountpoint