Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system does not boot from specified partition, when using GPT #1733

Open
marek-szulc opened this issue Jul 28, 2022 · 6 comments
Open

system does not boot from specified partition, when using GPT #1733

marek-szulc opened this issue Jul 28, 2022 · 6 comments

Comments

@marek-szulc
Copy link

marek-szulc commented Jul 28, 2022

Describe the bug
No matter the value of "boot_partition" inside the autoboot.txt, system always finally boots from the default partition. (anyother_part.txt) (uboot_fdt.txt)
Value "PARTITION=" inside config.txt has no effect at all, from my testing autoboot.txt seems to be an only viable option to choose boot partition.

When setting boot_partition=2 the system does not boot at all. AFAIK that behaviour only occurs with "boot_partition" set to 2 (Attached file: bootpart2.txt)

Additional context
To my knowledge problem seems relevant when using GPT.
The problem doesn't seem to occur when using MBR with one exception - when partition type is different than "e".

Expected behaviour
System boots from the partition specified inside autoboot.txt, and properly sets property "partition" in the fdt, inside /chosen/bootloader to the number of partition it was booted from.

System

  • Tested on RPI4 Model B
  • 5.10.95-arm-rpi4-v7l
  • newest firmware from this repo

Logs

bootpart2.txt
anyother_part.txt
uboot_fdt.txt

@timg236
Copy link

timg236 commented Jul 28, 2022

That's correct. The firmware does not support specifying the partition number within GPT table. It just looks for the first "FAT / EFI" partition within the GPT

@srcshelton
Copy link

That's correct. The firmware does not support specifying the partition number within GPT table. It just looks for the first "FAT / EFI" partition within the GPT

What's being looked-for, though? A specified GPT UUID (I think EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 is 0700/Microsoft basic data) or some magic signature bytes known to exist at the start of any FAT32 partition?

If they differ, is the physical ordering on disk or the logical numbering in the partition table given priority?

@abaumgaertner
Copy link

abaumgaertner commented Nov 9, 2023

Booting from a 1TB USB SSD with GPT works fine. maybe consider a similar partition layout.
make sure you have latest firmware installed.

root@dc1:~# rpi-eeprom-update -a
BOOTLOADER: up to date
   CURRENT: Wed Jan 11 17:40:52 UTC 2023 (1673458852)
    LATEST: Wed Jan 11 17:40:52 UTC 2023 (1673458852)
   RELEASE: default (/lib/firmware/raspberrypi/bootloader/default)
            Use raspi-config to change the release.

  VL805_FW: Using bootloader EEPROM
     VL805: up to date
   CURRENT: 000138c0
    LATEST: 000138c0
root@dc1:~# sgdisk -p /dev/sda
Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Model:
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): C7EC176E-D8CD-4041-9C5D-111111111111
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 1076589 sectors (525.7 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048        16779263   8.0 GiB     0700  boot
   2        16779264        20973567   2.0 GiB     8200  swap
   3        20973568      1952450559   921.0 GiB   BF00  rpool
root@dc1:~#

@srcshelton
Copy link

Booting from a 1TB USB SSD with GPT works fine. maybe consider a similar partition layout.

I'm afraid that you've missed the point - this is concerning the situation where you have multiple boot partitions and wish to use the firmware configuration files to select which one to boot from (to allow for A/B-switching for firmware updates or rollback, for example).

@onorua
Copy link

onorua commented Jan 5, 2025

I confirm this, autoboot is useless with GPT partition. It is always boots from the first one. It looks like a bug of autoboot mechanism in rpi bootloader to me.

@matthiasharrer
Copy link

Can also confirm that this happens on Raspberry Pi 4B.
Caused a lot of confusion for me especially because it works fine on a Raspberry Pi 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants