Skip to contentSkip to conversation

systemd-bootdisk.wks: use PARTUUID

PATCH In review Ed Bartosh 3 participants 4 messages Oct 24, 2016 – Oct 25, 2016

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 systemd-bootdisk.wks: use PARTUUID

Root device name in systemd-bootdisk.wks is 'sda'. This can cause images, produced using this wks to refuse booting if real device name is not 'sda'. For example, when booting MinnowBoard MAX from MicroSD card the boot process stucks with this message on the boot console output: Waiting for root device /dev/sda2...
This happens because real device name of MicroSD card on this device is mmcblk1.

Used --use-uuid option for root partition. This should make wic to put partiion UUID instead of device name into kernel command line.

[YOCTO #10485]

---
 scripts/lib/wic/canned-wks/systemd-bootdisk.wks | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/wic/canned-wks/systemd-bootdisk.wks +1 -1
index b900023..4bd9d6a 100644
@@ -4,7 +4,7 @@
 
 part /boot --source bootimg-efi --sourceparams="loader=systemd-boot" --ondisk sda --label msdos --active --align 1024
 
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
 
 part swap --ondisk sda --size 44 --label swap1 --fstype=swap
 
Signature · 1 line
2.1.4
#1 lore raw
Quoted 11 lines · Ed Bartosh

Root device name in systemd-bootdisk.wks is 'sda'. This can cause images, produced using this wks to refuse booting if real device name is not 'sda'. For example, when booting MinnowBoard MAX from MicroSD card the boot process stucks with this message on the boot console output: Waiting for root device /dev/sda2...
This happens because real device name of MicroSD card on this device is mmcblk1.

Used --use-uuid option for root partition. This should make wic to put partiion UUID instead of device name into kernel command line.

This change worked just fine, I tried it both in Minnowboard and Joule and both boot to login prompt.

Quoted 28 lines

[YOCTO #10485]

---
 scripts/lib/wic/canned-wks/systemd-bootdisk.wks | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/wic/canned-wks/systemd-bootdisk.wks +0 -0
index b900023..4bd9d6a 100644
@@ -4,7 +4,7 @@


 part /boot --source bootimg-efi --sourceparams="loader=systemd-boot" --ondisk sda --label msdos --active --align 1024

scripts/lib/wic/canned-wks/systemd-bootdisk.wks +1 -3
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform
--align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform
--align 1024 --use-uuid


 part swap --ondisk sda --size 44 --label swap1 --fstype=swap
--
2.1.4

#2 lore raw
In reply to Ed Bartosh
Quoted 33 lines · Ed Bartosh

Root device name in systemd-bootdisk.wks is 'sda'. This can cause images, produced using this wks to refuse booting if real device name is not 'sda'. For example, when booting MinnowBoard MAX from MicroSD card the boot process stucks with this message on the boot console output: Waiting for root device /dev/sda2...
This happens because real device name of MicroSD card on this device is mmcblk1.

Used --use-uuid option for root partition. This should make wic to put partiion UUID instead of device name into kernel command line.

[YOCTO #10485]

---
 scripts/lib/wic/canned-wks/systemd-bootdisk.wks | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/wic/canned-wks/systemd-bootdisk.wks +0 -0
index b900023..4bd9d6a 100644
@@ -4,7 +4,7 @@


 part /boot --source bootimg-efi --sourceparams="loader=systemd-boot" --ondisk sda --label msdos --active --align 1024

scripts/lib/wic/canned-wks/systemd-bootdisk.wks +1 -3
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform
--align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform
--align 1024 --use-uuid
Quoted 1 line

 part swap --ondisk sda --size 44 --label swap1 --fstype=swap

Quoted 1 line

I understand the --use-uuid for the partition labeling, but how does it affect everything marked as ondisk sda?  Or is ondisk ignored with use- uuid?

Sau!

Quoted 4 lines


--
2.1.4

author
#3 lore raw
Quoted 36 lines · Saul Wold
Quoted 33 lines · Ed Bartosh

Root device name in systemd-bootdisk.wks is 'sda'. This can cause images, produced using this wks to refuse booting if real device name is not 'sda'. For example, when booting MinnowBoard MAX from MicroSD card the boot process stucks with this message on the boot console output: Waiting for root device /dev/sda2...
This happens because real device name of MicroSD card on this device is mmcblk1.

Used --use-uuid option for root partition. This should make wic to put partiion UUID instead of device name into kernel command line.

[YOCTO #10485]

---
 scripts/lib/wic/canned-wks/systemd-bootdisk.wks | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/wic/canned-wks/systemd-bootdisk.wks +0 -0
index b900023..4bd9d6a 100644
@@ -4,7 +4,7 @@


 part /boot --source bootimg-efi --sourceparams="loader=systemd-boot" --ondisk sda --label msdos --active --align 1024

scripts/lib/wic/canned-wks/systemd-bootdisk.wks +1 -3
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform
--align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform
--align 1024 --use-uuid
Quoted 1 line

 part swap --ondisk sda --size 44 --label swap1 --fstype=swap

Quoted 4 lines
Quoted 1 line

I understand the --use-uuid for the partition labeling, but how does it affect everything marked as ondisk sda?  Or is ondisk ignored with use- uuid?

--use-uuid uses PARTUUID to specify root device in kernel command line instead of /dev/sdaX. In this sense yes, sda is ignored.

However, disk name(sda) is also used to group partitions to one disk image. Theoretically wic can produce several images if more than one disk name is used in .wks file.

For swap position sda is still used, which can make swap partitions not functional on the devices with different disk names. This needs to be fixed by using PARTUUID in fstab for swap partitions. For this to work in poky images busybox swapon should support PARTUUID syntax, which I'm not entirely sure it does.

--
Regards,
Ed