systemd-boot-builder.py: ignore profile names with invalid chars#114637
Merged
lukegb merged 1 commit intoNixOS:masterfrom Apr 25, 2021
Merged
systemd-boot-builder.py: ignore profile names with invalid chars#114637lukegb merged 1 commit intoNixOS:masterfrom
lukegb merged 1 commit intoNixOS:masterfrom
Conversation
miallo
reviewed
Mar 2, 2021
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
Outdated
Show resolved
Hide resolved
Catch and ignore errors during writing of the boot entries. These errors could stem from profile names that are not valid filenames on vfat filesystems. fixes NixOS#114552
6f96cfc to
e2be5dc
Compare
cole-h
reviewed
Aug 4, 2021
| if os.readlink(system_dir(*gen)) == args.default_config: | ||
| write_loader_conf(*gen) | ||
| except OSError as e: | ||
| print("ignoring profile '{}' in the list of boot entries because of the following error:\n{}".format(profile, e), file=sys.stderr) |
Member
There was a problem hiding this comment.
I don't think this will ever work, because profile is undefined at this point...
This should probably be something like:
Suggested change
| print("ignoring profile '{}' in the list of boot entries because of the following error:\n{}".format(profile, e), file=sys.stderr) | |
| print("ignoring profile '{}' in the list of boot entries because of the following error:\n{}".format(gen[0] if gen[0] else "system", e), file=sys.stderr) |
Fixed in #132688.
Member
|
I think this patch is not restrictive enough since it ignores errors such as "not enough space available" which are not related to the initial issue. I proposed #206445 but it would be really nice if I could get some help to validate my PR: i didn't run it yet. |
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.
Ignore profiles that have chars in their names that are not valid in
filenames on vfat filesystems.
fixes #114552
Motivation for this change
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)