-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
systemd-boot-builder.py: add support for profiles #26318
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
Conversation
This will also list the generations of other profiles than `system` in the boot menu. See the documentation of the `--profile-name` option of nixos-rebuild for more information on profiles.
@KaiHa, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Mic92, @aszlig and @lheckemann to be potential reviewers. |
What is the use case for this? |
Suppose you want to have different kernel version. You can create a profile for each and get a boot menu entry to select them. |
for path in glob.iglob("@efiSysMountPoint@/loader/entries/nixos-generation-[1-9]*.conf"): | ||
known_paths.append(copy_from_profile(*gen, "kernel", True)) | ||
known_paths.append(copy_from_profile(*gen, "initrd", True)) | ||
for path in glob.iglob("@efiSysMountPoint@/loader/entries/nixos-*-generation-[1-9]*.conf"): |
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.
Would not this fail to match old entries?
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.
Yes, you are right I need to fix this. I will update the PR.
|
||
def remove_old_entries(gens): | ||
slice_start = len("@efiSysMountPoint@/loader/entries/nixos-generation-") | ||
slice_end = -1 * len(".conf") | ||
rex_profile = re.compile("^@efiSysMountPoint@/loader/entries/nixos-(.*)-generation-.*\.conf$") |
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.
Here as well. We need backward-compatible code.
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.
This is with intent. The rex_profile
regex is used to decide if it is a system profile or not.
Currently fails to build, when I give no profile argument to
|
Ohh, I should have checked the case that no profile exists. My bad, I will update the PR but will only have time earliest on Monday to do so. |
@Mic92, let me know if there is still something that needs to be fixed. |
This will also list the generations of other profiles than
system
inthe boot menu. See the documentation of the
--profile-name
option ofnixos-rebuild for more information on profiles.
Motivation for this change
To boot other profiles with systemd-boot.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)