summaryrefslogtreecommitdiffstats
path: root/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
diff options
context:
space:
mode:
authorMax <max@privatevoid.net>2021-06-24 17:52:03 +0200
committerGitHub <noreply@github.com>2021-06-24 17:52:03 +0200
commit2cf6f9e5bddd10917979dc77279a8eaf6773c7f5 (patch)
treedd72a4d0fe04064f8fadef6ff0c1444f930812c9 /nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
parent21e25c659f62a010d057c54b3e8b04ee4f7fbfbe (diff)
nixos/systemd-boot: Use os.path.realpath to fully resolve symlinks
os.readlink only resolves one layer of symlinks. This script explicitly relies on the real path of a file for deduplication, hence symlink resolution should recurse.
Diffstat (limited to 'nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py')
-rw-r--r--nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
index 63e01dd054a5..7134b4321630 100644
--- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
+++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
@@ -61,7 +61,7 @@ def write_loader_conf(profile: Optional[str], generation: int) -> None:
def profile_path(profile: Optional[str], generation: int, name: str) -> str:
- return os.readlink("%s/%s" % (system_dir(profile, generation), name))
+ return os.path.realpath("%s/%s" % (system_dir(profile, generation), name))
def copy_from_profile(profile: Optional[str], generation: int, name: str, dry_run: bool = False) -> str: