Skip to contentSkip to conversation

wic: Switch to using --use-uuid by default

PATCH In review Tom Rini 2 participants 3 messages Jul 25, 2017 – Jul 26, 2017

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 wic: Switch to using --use-uuid by default

The most portable way to specifiy a root device in a disk image that we create is to use PARTUUID rather than /dev/sda2. As background, both GPT and MBR tables provide valid UUID values for each partition and the Linux Kernel contains the logic to parse this value. With this change we can now boot the default disk images when used as any valid block device that the included kernel uses. This for example means that VirtualBox can be used to run vmdk without changes as it uses IDE for the virtual disk controller.

Cc Ed Bartosh <[email protected]>
Cc Matt Porter <[email protected]>
---
 scripts/lib/wic/canned-wks/common.wks.inc                   | 2 +-
 scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg | 8 ++++----
 scripts/lib/wic/canned-wks/qemux86-directdisk.wks           | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
scripts/lib/wic/canned-wks/common.wks.inc +1 -1
index 5cf2fd1..89880b4 100644
@@ -1,3 +1,3 @@
 # This file is included into 3 canned wks files from this directory
 part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024
+part / --source rootfs --use-uuid --fstype=ext4 --label platform --align 1024
scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg +4 -4
index d5a07d2..c58e74a 100644
@@ -12,16 +12,16 @@ DEFAULT Graphics console boot
 
 LABEL Graphics console boot
 KERNEL /vmlinuz
-APPEND label=boot root=/dev/sda2 rootwait
+APPEND label=boot rootwait
 
 LABEL Serial console boot
 KERNEL /vmlinuz
-APPEND label=boot root=/dev/sda2 rootwait console=ttyS0,115200
+APPEND label=boot rootwait console=ttyS0,115200
 
 LABEL Graphics console install
 KERNEL /vmlinuz
-APPEND label=install root=/dev/sda2 rootwait
+APPEND label=install rootwait
 
 LABEL Serial console install
 KERNEL /vmlinuz
-APPEND label=install root=/dev/sda2 rootwait console=ttyS0,115200
+APPEND label=install rootwait console=ttyS0,115200
scripts/lib/wic/canned-wks/qemux86-directdisk.wks +1 -1
index db30bbc..1f8466a 100644
@@ -4,5 +4,5 @@
 
 include common.wks.inc
 
-bootloader  --timeout=0  --append="vga=0 uvesafb.mode_option=640x480-32 root=/dev/sda2 rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 rootfstype=ext4 "
+bootloader  --timeout=0  --append="vga=0 uvesafb.mode_option=640x480-32 rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 rootfstype=ext4 "
 
Signature · 1 line
2.1.4
#1 lore raw
Quoted 9 lines · Tom Rini

The most portable way to specifiy a root device in a disk image that we create is to use PARTUUID rather than /dev/sda2. As background, both GPT and MBR tables provide valid UUID values for each partition and the Linux Kernel contains the logic to parse this value. With this change we can now boot the default disk images when used as any valid block device that the included kernel uses. This for example means that VirtualBox can be used to run vmdk without changes as it uses IDE for the virtual disk controller.

I suspect oe-selftest needs to be adjusted for this change.

Please run "oe-selftest -r wic" to ensure all tests pass.

Quoted 57 lines
Cc Ed Bartosh <[email protected]>
Cc Matt Porter <[email protected]>
---
 scripts/lib/wic/canned-wks/common.wks.inc                   | 2 +-
 scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg | 8 ++++----
 scripts/lib/wic/canned-wks/qemux86-directdisk.wks           | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
scripts/lib/wic/canned-wks/common.wks.inc +1 -1
index 5cf2fd1..89880b4 100644
@@ -1,3 +1,3 @@
 # This file is included into 3 canned wks files from this directory
 part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024
+part / --source rootfs --use-uuid --fstype=ext4 --label platform --align 1024
scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg +4 -4
index d5a07d2..c58e74a 100644
@@ -12,16 +12,16 @@ DEFAULT Graphics console boot
 
 LABEL Graphics console boot
 KERNEL /vmlinuz
-APPEND label=boot root=/dev/sda2 rootwait
+APPEND label=boot rootwait
 
 LABEL Serial console boot
 KERNEL /vmlinuz
-APPEND label=boot root=/dev/sda2 rootwait console=ttyS0,115200
+APPEND label=boot rootwait console=ttyS0,115200
 
 LABEL Graphics console install
 KERNEL /vmlinuz
-APPEND label=install root=/dev/sda2 rootwait
+APPEND label=install rootwait
 
 LABEL Serial console install
 KERNEL /vmlinuz
-APPEND label=install root=/dev/sda2 rootwait console=ttyS0,115200
+APPEND label=install rootwait console=ttyS0,115200
scripts/lib/wic/canned-wks/qemux86-directdisk.wks +1 -1
index db30bbc..1f8466a 100644
@@ -4,5 +4,5 @@
 
 include common.wks.inc
 
-bootloader  --timeout=0  --append="vga=0 uvesafb.mode_option=640x480-32 root=/dev/sda2 rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 rootfstype=ext4 "
+bootloader  --timeout=0  --append="vga=0 uvesafb.mode_option=640x480-32 rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 rootfstype=ext4 "
 
Signature · 1 line
2.1.4
Signature · 3 lines
--
Regards,
Ed
Acked-by
#2 lore raw
Quoted 10 lines · Ed Bartosh
Quoted 9 lines · Tom Rini

The most portable way to specifiy a root device in a disk image that we create is to use PARTUUID rather than /dev/sda2. As background, both GPT and MBR tables provide valid UUID values for each partition and the Linux Kernel contains the logic to parse this value. With this change we can now boot the default disk images when used as any valid block device that the included kernel uses. This for example means that VirtualBox can be used to run vmdk without changes as it uses IDE for the virtual disk controller.

Quoted 4 lines

I suspect oe-selftest needs to be adjusted for this change.

Please run "oe-selftest -r wic" to ensure all tests pass.

I've just run all wic tests in the branch with your changes - everything works, no breakages.

Quoted 67 lines
Quoted 57 lines
Cc Ed Bartosh <[email protected]>
Cc Matt Porter <[email protected]>
---
 scripts/lib/wic/canned-wks/common.wks.inc                   | 2 +-
 scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg | 8 ++++----
 scripts/lib/wic/canned-wks/qemux86-directdisk.wks           | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
scripts/lib/wic/canned-wks/common.wks.inc +1 -1
index 5cf2fd1..89880b4 100644
@@ -1,3 +1,3 @@
 # This file is included into 3 canned wks files from this directory
 part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024
+part / --source rootfs --use-uuid --fstype=ext4 --label platform --align 1024
scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg +4 -4
index d5a07d2..c58e74a 100644
@@ -12,16 +12,16 @@ DEFAULT Graphics console boot
 
 LABEL Graphics console boot
 KERNEL /vmlinuz
-APPEND label=boot root=/dev/sda2 rootwait
+APPEND label=boot rootwait
 
 LABEL Serial console boot
 KERNEL /vmlinuz
-APPEND label=boot root=/dev/sda2 rootwait console=ttyS0,115200
+APPEND label=boot rootwait console=ttyS0,115200
 
 LABEL Graphics console install
 KERNEL /vmlinuz
-APPEND label=install root=/dev/sda2 rootwait
+APPEND label=install rootwait
 
 LABEL Serial console install
 KERNEL /vmlinuz
-APPEND label=install root=/dev/sda2 rootwait console=ttyS0,115200
+APPEND label=install rootwait console=ttyS0,115200
scripts/lib/wic/canned-wks/qemux86-directdisk.wks +1 -1
index db30bbc..1f8466a 100644
@@ -4,5 +4,5 @@
 
 include common.wks.inc
 
-bootloader  --timeout=0  --append="vga=0 uvesafb.mode_option=640x480-32 root=/dev/sda2 rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 rootfstype=ext4 "
+bootloader  --timeout=0  --append="vga=0 uvesafb.mode_option=640x480-32 rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 rootfstype=ext4 "
 
Signature · 1 line
2.1.4
Signature · 8 lines
--
Regards,
Ed
-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 3 lines
--
Regards,
Ed