maximbaz / arch-secure-boot

UEFI Secure Boot for Arch Linux + btrfs snapshot recovery
ISC License
126 stars 8 forks source link

generate-efi: compute section offsets dynamically #18

Closed ShellCode33 closed 1 year ago

ShellCode33 commented 1 year ago

Fixes #17

I moved the .cmdline section to the end to limit the amount of offsets variations

medhefgo commented 1 year ago

And once again, people open code this and still don't get things right. You have to align section offsets to SectionAlignment.

maximbaz commented 1 year ago

It's a learning process :grin: Thanks for pointing it out @medhefgo! The reference commit mentioned in #17 contains this indeed. Would you like to have a look at it @ShellCode33 or @medhefgo?

medhefgo commented 1 year ago

Just use ukify. That's what it's there for.

maximbaz commented 1 year ago

Good point, that, or mkinitcpio --uki in fact, since it's arch-specific anyway (if it's useful for out use-case, I haven't looked deeply into it).

ShellCode33 commented 1 year ago

The ArchLinux wiki should be edited then. But I agree that we should rely on existing tools for this, it is very easy to get wrong, as can be seen in this PR :-)

ShellCode33 commented 1 year ago

@medhefgo does it look right now ? Is there something else we should be aware of ?

@maximbaz I'm a bit concerned by this comment which states that under some circumstances, the inplace decompression of the kernel could overwrite what's after it (can be the cmdline or the initrd in our case). Might be a good idea to put the kernel last just to be sure.

maximbaz commented 1 year ago

@maximbaz I'm a bit concerned by this comment which states that under some circumstances, the inplace decompression of the kernel could overwrite what's after it (can be the cmdline or the initrd in our case). Might be a good idea to put the kernel last just to be sure.

That is also what ukify is doing, nice catch! Let's do the same :+1: (and mkinitcpio is not doing it).