Add support for actually mounting the boot partition and copying contents to it

ubuntu/yakkety
Steve Langasek 9 years ago
parent 24b9feb58a
commit 0be484d35e

@ -8,8 +8,6 @@ case $ARCH in
exit 0 exit 0
;; ;;
*) *)
ROOTPART=1
ROOTPART_START=1
;; ;;
esac esac
@ -39,7 +37,11 @@ disk_image=binary/boot/disk.ext4
create_empty_disk_image "${disk_image}" create_empty_disk_image "${disk_image}"
create_empty_partition_table "${disk_image}" create_empty_partition_table "${disk_image}"
ROOTPART=1
if [ -n "$BOOTPART_START" ]; then if [ -n "$BOOTPART_START" ]; then
ROOTPART=2
ROOTPART_START="$BOOTPART_END"
create_empty_partition "$disk_image" 1 "$BOOTPART_START" "$BOOTPART_END" 1 create_empty_partition "$disk_image" 1 "$BOOTPART_START" "$BOOTPART_END" 1
fi fi
create_empty_partition "${disk_image}" "$ROOTPART" "$ROOTPART_START" -1 create_empty_partition "${disk_image}" "$ROOTPART" "$ROOTPART_START" -1
@ -50,6 +52,15 @@ mount_image "${disk_image}" "$ROOTPART"
make_ext4_partition "${rootfs_dev_mapper}" make_ext4_partition "${rootfs_dev_mapper}"
mkdir mountpoint mkdir mountpoint
mount "${rootfs_dev_mapper}" 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/ cp -a chroot/* mountpoint/
case $ARCH in case $ARCH in
@ -99,6 +110,10 @@ EOF
fi fi
if [ -n "$BOOT_MOUNTPOINT" ]; then
umount "mountpoint/$BOOT_MOUNTPOINT"
fi
umount_partition mountpoint umount_partition mountpoint
rmdir mountpoint rmdir mountpoint

Loading…
Cancel
Save