[base > u-boot | feature request] enable GPT support

Hitting a wall when trying to boot from a partition with GPT

scanning bus for devices...
Device 0: (0:0) Vendor: ATA Prod.: Samsung SSD 860 Rev: RVT4
Type: Hard Disk
Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
Found 1 device(s).
btrfs probe failed
** Unrecognized filesystem type **
btrfs probe failed
** Unrecognized filesystem type **

It would appear that source development has incorporated GPT support since around 2012 but I cannot figure out whether uboot in downstream has GPT support and if not that being the reason the boot fails?

never heard of that loader. which device you said it is?

what loader?

nvm, just saw that it is filesystem in question (or whatever related to ssd), why hiding output, if i didn't click accidentaly on first line i'd never thought there was some info posted..

uboot has not trouble with btrfs (through btrload), which is a filesystem.

GPT = GUID Partition Table, which is a different kettle of fish.

If uboot does not handle GPT then logical it cannot recognise the filesystem on the partition and thus the output

** Unrecognized filesystem type **

would be more of a red herring in that case

There is

but that relates to placing/loading the OS image and not booting itself though.

According to source doc there would be a cli gpt command in u-boot

However, with the u-boot implementation in OpenWrt this seems to be absent since it prints

Unknown command 'gpt'

The package's build conf stipulates

define Build/Configure
       # enable additional options beyond clearfog_defconfig
       echo CONFIG_NET_RANDOM_ETHADDR=y >> $(PKG_BUILD_DIR)/configs/$(BUILD_VARIANT)_defconfig
       echo CONFIG_CMD_SETEXPR=y >> $(PKG_BUILD_DIR)/configs/$(BUILD_VARIANT)_defconfig


From that build conf it is not cleat to me whether GPT support is explicitly excluded (=N) somewhere or just not enabled and the default build conf does not include it.

But sadly it would appear that GPT support is lacking.

Would appreciate if a developer could be obliged to enable/implement u-boot support for GPT in Master & 19.07, with MBR being sort of legacy and its issues/limitations.

If it is a space concern at least for the targets that can cope with it, e.g. mvebu & x86.

If not mistake it requires the compile conf


But there might be more.

For x86? Which x86 device does use U-Boot?

There are only clearfog and uDPU as devices for the mvebu uboot target...
I assume you don´t have one of these?

Mine is clearfrog for mvebu

The x86 I just added carelessly in light of Installing OpenWrt x86 on GPT disk but then they would have GRUB instead - me bad....

Then i would suggest sending a patch to the U-Boot mailing list...
OpenWRT does use the mainline sources for this target.

If it´s mainline, you have to bump the used version on the OpenWRT source:

You can also create a patch only for OpenWRT:


If I had the capabilities of submitting PR I would likely have done so instead of making the request here - which I was told is the way to go...

I would try forum.openwrt.org, asking politely someone to create patch or pull request which is the right thing to do anyway.

  • Where is this quote from?
  • Who told you that was the way to go?

You were already told that OpenWrt does not maintain this. It's pulled from the source. See: https://gitlab.denx.de/u-boot/u-boot/

Can you use the build system and a little bit git?
I´ll prepare a patch and you build with the build system and test if its sufficient for your use case...

1 Like

admin at Flyspray.

I am able to comprehend that - but consider the timeline/sequence logic here

  1. been told to initiate a feature request here
  2. made the feature request here
  3. been told that it is being pulled in from source development

That would be highly appreciate and I would love to do so but at the moment I do not have access to a node with compiling capacity... :frowning_face:

Here you go:

If you approve that this config symbols are sufficient, i will create a PR.
The symbol CONFIG_PARTITION_UUIDS is inferred from CONFIG_CMD_GPT.

This are the simple steps:

make package/uboot-mvebu/{clean,prepare} V=s QUILT=1
cd build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/u-boot-clearfog/u-boot-2019.04/
quilt push -a
quilt new 220-mvebu_clearfog-add-gpt-support.patch
make clearfog_defconfig
make menuconfig
Select  CONFIG_CMD_GPT and save
make savedefconfig
mv defconfig configs/clearfog_defconfig
quilt refresh
cd -
make package/uboot-mvebu/update V=s
git commit -asm "uboot-mvebu: add GPT support for clearfog"

Well so you know, I would've sent a message for you on GitHub (as I have an account), but the U-Boot repository is hosted elsewhere.

OK, I would have:

  1. contacted that source developer - https://gitlab.denx.de/u-boot/u-boot/

There's an email address, so I'm lost why you refused to email the developer directly - as opposed to making posts here. Nonetheless, I'm glad @juppin was able to assist quickly. (I haven't got thru account setup yet...)


That patch looks good. I just have no access to a suitable build system.

Seriously? Where did I refuse to contact the developer and I am not sure how you are inferring such? All said was

Sending an email to the developer and submitting a patch are not necessarily the same.

1 Like

True, I honestly felt the only difficult part was making an account; so I apologize for the inference.

1 Like