Make better use of UUIDs on Intel platform wks files 11/13711/1
authorTom Rini <trini@konsulko.com>
Tue, 3 Apr 2018 20:11:22 +0000 (16:11 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 3 Apr 2018 20:11:22 +0000 (16:11 -0400)
- Stop using --ondisk XXX in the wks files, that enforces using
  USB/SATA/etc as /etc/fstab will be referencing these devices.
- Pass --use-uuid for the boot partition
- Update mkefi-agl.sh and mkabl-agl.sh to modify the final fstab to
  use the PARTUUID they create rather than the PARTUUID of the resulting
  wic file.

Change-Id: I450ba77805fdb83e31411ea48b25aad415fa8a69
Bug-AGL: SPEC-1300
Signed-off-by: Tom Rini <trini@konsulko.com>
meta-agl-bsp/wic/systemd-intel-corei7-64-bootdisk.wks
meta-agl-bsp/wic/systemd-joule-bootdisk.wks
scripts/mkabl-agl.sh
scripts/mkefi-agl.sh

index 605d622..5639372 100644 (file)
@@ -3,9 +3,9 @@
 # can directly dd to boot media. The selected bootloader is systemd-boot
 # and we do not have swap
 
-part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=microcode.cpio" --ondisk sda --label msdos --active --align 1024
+part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=microcode.cpio" --use-uuid --label msdos --active --align 1024
 
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+part / --source rootfs --fstype=ext4 --label platform --align 1024 --use-uuid
 
 # Modify the append line here as needed to suit the environment.
 #
index 87b006f..a318e23 100644 (file)
@@ -4,9 +4,9 @@
 # and we do not have swap.  We assume a Joule system and provide an
 # appropriate kernel command line.
 
-part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=microcode.cpio" --ondisk sda --label msdos --active --align 1024
+part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=microcode.cpio" --use-uuid --label msdos --active --align 1024
 
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+part / --source rootfs --fstype=ext4 --label platform --align 1024 --use-uuid
 
 # Modify the append line here as needed to suit the environment
 bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4 console=ttyS2,115200n8 console=tty0 video=efifb maxcpus=4 noxsave reboot=efi kmemleak=off"
index 8483d23..611c08f 100755 (executable)
@@ -375,6 +375,7 @@ ROOTFS_DISKID=$(fdisk -l "$DEVICE" | grep -e "Disk identifier" | sed -n 's/^.*Di
 if [ $ROOTFS_DISKID = "" ]; then
     die "Failed to read DISKID"
 fi
+BOOTFS_PARTUUID="$ROOTFS_DISKID-01"
 ROOTFS_PARTUUID="$ROOTFS_DISKID-02"
 debug "PARTUUID for ROOTFS is $ROOTFS_PARTUUID"
 
@@ -476,6 +477,8 @@ fi
 
 debug "removing any swap entry in /etc/fstab"
 sed --in-place '/swap/d' $ROOTFS_MNT/etc/fstab 
+debug "fixing PARTUUID for /boot"
+sed --in-place -e "s#PARTUUID=[0-9a-z-]\+\t/boot#${BOOTFS_PARTUUID}\t/boot#" $ROOTFS_MNT/etc/fstab
 
 printf "flushing data on removable device. May take a while ... "
 sync --file-system $ROOTFS_MNT
index 14ade36..48a0af4 100755 (executable)
@@ -352,6 +352,7 @@ ROOTFS_DISKID=$(fdisk -l "$DEVICE" | grep -e "Disk identifier" | sed -n 's/^.*Di
 if [ $ROOTFS_DISKID = "" ]; then
     die "Failed to read DISKID"
 fi
+BOOTFS_PARTUUID="$ROOTFS_DISKID-01"
 ROOTFS_PARTUUID="$ROOTFS_DISKID-02"
 debug "PARTUUID for ROOTFS is $ROOTFS_PARTUUID"
 
@@ -500,6 +501,8 @@ else
 fi
 debug "removing any swap entry in /etc/fstab"
 sed --in-place '/swap/d' $ROOTFS_MNT/etc/fstab 
+debug "fixing PARTUUID for /boot"
+sed --in-place -e "s#PARTUUID=[0-9a-z-]\+\t/boot#${BOOTFS_PARTUUID}\t/boot#" $ROOTFS_MNT/etc/fstab
 
 printf "flushing data on removable device. May take a while ... "
 sync --file-system $ROOTFS_MNT