Conversation
Make sure to use grub2-editenv for changing content in the grub env blob. This Fixes #2986
|
Untested, but this might actually make it worse. Remember that the grub2-editenv behavior changes depending on what it detects the disk to be, and that means it will probably produce bad data unless we're running this at the very end when we're in the "real disk" mounted as loops and whatnot. |
Hmm, that I don't understand. You are saying What always bites me is the magic in e.g grub2-probe or other grub toolings (mkconfig) which takes information from the host it is called on which is always broken because an image build process doesn't run on the target host. With regards to this change I don't see how Thoughts ? |
|
|
|
I did a number of tests and I don't see any logic applied by no complains, you can give it anything unlike other tools like then just list the contents and the hexdump So for me the editenv tool is not more than a data dumper it supports:
And all of this seems to manage just one file and no more logic was involved, at least in the tests I did. |
|
It changed in GRUB 2.14: https://gitlab.freedesktop.org/gnu-grub/grub/-/commit/d6525f0e65332555e0c65d4846050a45ea51969e |
|
This patch exists in Fedora and SUSE grub2-editenv, but it is also in upstream GRUB 2.14. |
|
🤦 man why are people doing this. There is not even an option to skip it when it doesn't make any sense for example in an image build. The only way to circumvent that is by using a non standard path and copy the result back. This will also be a problem when we apply the optional environment variables |
|
To be fair, things like the env vars need to be in the external environment block if btrfs is used for |
|
I still think we should use I'm also pretty much convinced that the error reported in #2986 is not related to the proposed change here. The manual editing would only apply to the vendor grubenv file which would be searched in As such I don't see how kiwi can cause the broken grubenv nevertheless I still believe the proposed change in this PR makes sense Thoughts ? |
|
I don't think you're wrong, but I'd like to see it run through our staging first. This change makes me nervous and I'd like to be certain we don't screw up. 😅 |
|
I fully agree, I zip a Staging build then we will see if anything fails. btw, all latest rolling releases e.g. rawhide are still on grub 2.12. I guess we will experience failed builds once they upgrade to 2.14 |
I can't follow you with this. The external environment block is a 1k size file read by grub. grub reads this file via its From a kiwi perspective the only part we do when we talk about the env blob is calling Where am I wrong with this ? |
|
Staging build runs |
|
@Conan-Kudo All staging tests passed. I did a closer look on the integration test which does env blob adaptions:
For me things are working as before |
|
But here is the funny thing, with the above image build I can see that env_block parameter kiwi only added the following The other settings were either provided by some distro package or are part of the grub tooling I cannot imagine another code part, and these settings env_block= and saved_entry= smells like grub BLS |
Make sure to use grub2-editenv for changing content in the grub env blob. This Fixes #2986