Skip to contentSkip to conversation

configs/orangepi_r1_defconfig: change to GPT partitions for root=PARTLABEL support

PATCH New Peter Korsgaard 2 participants 2 messages Jan 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs/orangepi_r1_defconfig: change to GPT partitions for root=PARTLABEL support

GPT provides partition labels, which can be used to tell the kernel to find the rootfs based on it (root=PARTLABEL=rootfs) as a nicer/more extensible solution than the MBR disk signature / PARTUUID.

The default GPT partition table location unfortunately conflicts with the SPL location, so move the 16KB GPT table after it.

---
 board/orangepi/orangepi-r1/boot.cmd     | 2 +-
 board/orangepi/orangepi-r1/genimage.cfg | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)
board/orangepi/orangepi-r1/boot.cmd +1 -1
index e62e31a3e4..50745f7e5e 100644
@@ -1,6 +1,6 @@
 setenv fdt_high ffffffff
 
-setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=feedc0de-02 rootwait
+setenv bootargs console=ttyS0,115200 earlyprintk root=PARTLABEL=rootfs rootwait
 
 fatload mmc 0 $kernel_addr_r zImage
 fatload mmc 0 $fdt_addr_r sun8i-h2-plus-orangepi-r1.dtb
board/orangepi/orangepi-r1/genimage.cfg +5 -3
index 3496383573..0f44b368f0 100644
@@ -13,15 +13,17 @@ image boot.vfat {
 
 image sdcard.img {
 	hdimage {
-		# for root=PARTUUID=feedc0de-02 support
-		disk-signature = 0xfeedc0de
+		# for root=PARTLABEL support
+		gpt = true
+		# default GPT location conflicts with spl, move it after
+		gpt-location = 1M
 	}
 
 	partition u-boot {
 		in-partition-table = "no"
 		image = "u-boot-sunxi-with-spl.bin"
 		offset = 8192
-		size = 1040384 # 1MB - 8192
+		size = 1056768 # 1MB - 8192 + 16384 (GPT)
 	}
 
 	partition boot {
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 configs/orangepi_r1_defconfig: change to GPT partitions for root=PARTLABEL support

Peter, All,

On 2021-01-25 09:11 +0100, Peter Korsgaard spake thusly:

Quoted 8 lines

GPT provides partition labels, which can be used to tell the kernel to find the rootfs based on it (root=PARTLABEL=rootfs) as a nicer/more extensible solution than the MBR disk signature / PARTUUID.

The default GPT partition table location unfortunately conflicts with the SPL location, so move the 16KB GPT table after it.

I added a small comment about where the 'rootfs' label comes from, amended the commit log accordingly.

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 49 lines
---
 board/orangepi/orangepi-r1/boot.cmd     | 2 +-
 board/orangepi/orangepi-r1/genimage.cfg | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)
board/orangepi/orangepi-r1/boot.cmd +1 -1
index e62e31a3e4..50745f7e5e 100644
@@ -1,6 +1,6 @@
 setenv fdt_high ffffffff
 
-setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=feedc0de-02 rootwait
+setenv bootargs console=ttyS0,115200 earlyprintk root=PARTLABEL=rootfs rootwait
 
 fatload mmc 0 $kernel_addr_r zImage
 fatload mmc 0 $fdt_addr_r sun8i-h2-plus-orangepi-r1.dtb
board/orangepi/orangepi-r1/genimage.cfg +5 -3
index 3496383573..0f44b368f0 100644
@@ -13,15 +13,17 @@ image boot.vfat {
 
 image sdcard.img {
 	hdimage {
-		# for root=PARTUUID=feedc0de-02 support
-		disk-signature = 0xfeedc0de
+		# for root=PARTLABEL support
+		gpt = true
+		# default GPT location conflicts with spl, move it after
+		gpt-location = 1M
 	}
 
 	partition u-boot {
 		in-partition-table = "no"
 		image = "u-boot-sunxi-with-spl.bin"
 		offset = 8192
-		size = 1040384 # 1MB - 8192
+		size = 1056768 # 1MB - 8192 + 16384 (GPT)
 	}
 
 	partition boot {
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'