Support UKI enabled base image customization.#265
Merged
Conversation
gmileka
reviewed
Jun 9, 2025
cwize1
requested changes
Jun 9, 2025
63c7889 to
d38a247
Compare
cwize1
approved these changes
Jun 9, 2025
3 tasks
liulanze
added a commit
that referenced
this pull request
Jun 25, 2025
<!-- Description: Please provide a summary of the changes and the motivation behind them. --> In `prepareUki()`, when `copyUkiFiles()` is called, it attempts to find the `kernel` and its `initramfs` under the boot partition. Once found, they are placed under `UkiBuildDir` for later use when building the `UKI` with `ukify`. Additionally, `getKernelToInitramfsMap()` also heavily depends on the `kernel` and `initramfs` being present in the boot partition. This function is invoked twice: during both `prepareUki()` and `createUki()`. Therefore, `cleanupBootPartition()` should not have to be released into main yet, as we are still in the process of making the boot partition optional. Another issue blocking main from customizing a UKI-enabled base image is the ability to read the latest kernel arguments from an existing UKI. I have extended the logic - following the structure of `extractKernelCmdline()` in `partitionutils.go` - to make UKI customization more robust, enabling `kernel-to-args` mapping to be extracted from either `grub.cfg` or an existing UKI. --- - [x] Tests added/updated - [x] Documentation updated (if needed) - [x] Code conforms to style guidelines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
prepareUki(), whencopyUkiFiles()is called, it attempts to find thekerneland itsinitramfsunder the boot partition. Once found, they are placed underUkiBuildDirfor later use when building theUKIwithukify. Additionally,getKernelToInitramfsMap()also heavily depends on thekernelandinitramfsbeing present in the boot partition. This function is invoked twice: during bothprepareUki()andcreateUki(). Therefore,cleanupBootPartition()should not have to be released into main yet, as we are still in the process of making the boot partition optional.Another issue blocking main from customizing a UKI-enabled base image is the ability to read the latest kernel arguments from an existing UKI. I have extended the logic - following the structure of
extractKernelCmdline()inpartitionutils.go- to make UKI customization more robust, enablingkernel-to-argsmapping to be extracted from eithergrub.cfgor an existing UKI.Checklist