Closed ShellCode33 closed 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.
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?
Just use ukify. That's what it's there for.
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).
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 :-)
@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 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).
Fixes #17
I moved the
.cmdline
section to the end to limit the amount of offsets variations