-
Notifications
You must be signed in to change notification settings - Fork 55
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
Fix non conforming partition table #2668
base: main
Are you sure you want to change the base?
Conversation
This change removes the legacy_boot flag from the EFI system partition. We already have a BIOS boot partition which should offer compatibility with legacy bios systems. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks straightforward, but I'll kick off a Jenkins run against it.
Build action triggered: https://github.com/flatcar/scripts/actions/runs/13444442241 |
Let me also test it out manually. Will ping back once I confirm if it works. |
Converted to draft. While using parted 3.6 (version 3.4 seemed to make the image unbootable - need to investigate) on an existing image did seem to make it work, generating a new image without the hybrid flag seems to:
|
I'm surprised by your issues, but I can at least report that CI passed on all platforms except OpenStack and Equinix Metal. I believe those are actually down to availability issues. Brightbox worked, and that uses OpenStack too. |
You need to run the tests on a fresh devstack deployment. The change that triggers issues in OpenStack was added in December. The cgpt binary in https://github.com/flatcar/seismograph/tree/flatcar-master/src/cgpt is quite outdated. Newer versions of cgpt (like the one in ubuntu 24.04) can properly set CHS entries (along with other PMBR fields) by running: cgpt boot -p path/to/raw.img We then set the bootable flag in the PMBR either via fdisk or by simply flipping the bit at offset 447 in the disk to |
to set the bootable flag via fdisk we can run: echo -e "M\na\nw\n" | fdisk flatcar_production_openstack_image.raw or we can do it via python in the def EnsurePMBRBootFlag(options, config=None, partitions=None):
# Set bootable flag
with open(options.disk_image, 'r+b') as fd:
# Seek to partition table offset
fd.seek(446)
# Read the partition entry
partition = fd.read(16)
partition_data = struct.unpack('<B3BB3BII', partition)
if partition_data[0] != 0x80:
new_partition_data = struct.pack('<B3BB3BII', 0x80, *partition_data[1:])
# Go back to offset of start of partition
fd.seek(446)
# write the modified partition data
fd.write(new_partition_data) |
This change pulls in the latest commit of seismograph. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2973faa
to
10ce3cc
Compare
the boot flag is not needed. To pass the OpenStack Validation, the CHS values are enough. |
seems to pass on OpenStack. @chewi could you kick off another test in the CI as well? |
Fix non conforming partition table
This change removes the legacy_boot flag from the EFI system partition. We already have a BIOS boot partition which should offer compatibility with legacy bios systems.
How to use
Upload the image in a fresh OpenStack devstack deploy and boot.
Testing done
changelog/
directory (user-facing change, bug fix, security fix, update)/boot
and/usr
size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc./update-sdk