From de77849ad689101c4a7af14a9d02c9906d2b0b13 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Thu, 12 May 2022 16:18:30 +0200 Subject: [PATCH] nixos/stage-1: Account for hardcoded executable paths At least pkgs/os-specific/linux/util-linux/default.nix uses ``` "--enable-fs-paths-default=/run/wrappers/bin:/run/current-system/sw/bin:/sbin" ``` which does not cover stage 1 init's PATH as all executables are put under /bin/. Fix util-linux's `mount` usage by symlinking /sbin to it. --- nixos/modules/system/boot/stage-1-init.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index 22d5ec76af70..337064034efb 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -14,6 +14,8 @@ extraUtils="@extraUtils@" export LD_LIBRARY_PATH=@extraUtils@/lib export PATH=@extraUtils@/bin ln -s @extraUtils@/bin /bin +# hardcoded in util-linux's mount helper search path `/run/wrappers/bin:/run/current-system/sw/bin:/sbin` +ln -s @extraUtils@/bin /sbin # Copy the secrets to their needed location if [ -d "@extraUtils@/secrets" ]; then