[PATCH nixpkgs] spectrumPackages.rootfs: fix custom path entries
Stage 1 was supposed to be able to take a list of PATH entries to prepend to the default PATH, but it didn't do anything with them. Now, it properly adds them to the PATH as early as possible during boot. This mechanism isn't currently used anywhere, but is very useful for debugging. --- pkgs/os-specific/linux/spectrum/rootfs/generic.nix | 3 ++- pkgs/os-specific/linux/spectrum/rootfs/stage1.nix | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/spectrum/rootfs/generic.nix b/pkgs/os-specific/linux/spectrum/rootfs/generic.nix index 0a99f99bd5b..81fb80a614f 100644 --- a/pkgs/os-specific/linux/spectrum/rootfs/generic.nix +++ b/pkgs/os-specific/linux/spectrum/rootfs/generic.nix @@ -8,7 +8,8 @@ let makeStage1 = import ./stage1.nix { inherit writeScript lib - execline s6 s6-portable-utils s6-linux-utils s6-linux-init busybox mesa; + execline s6 s6-portable-utils s6-linux-utils s6-linux-init busybox mesa + path; }; makeServicesDir = import ./services.nix { diff --git a/pkgs/os-specific/linux/spectrum/rootfs/stage1.nix b/pkgs/os-specific/linux/spectrum/rootfs/stage1.nix index be7853316e9..6caf9ff93b8 100644 --- a/pkgs/os-specific/linux/spectrum/rootfs/stage1.nix +++ b/pkgs/os-specific/linux/spectrum/rootfs/stage1.nix @@ -1,16 +1,19 @@ { writeScript, lib , execline, s6, s6-portable-utils, s6-linux-utils, s6-linux-init, busybox, mesa +, path ? [] }: { run ? "true" }: let - path = [ s6 s6-portable-utils s6-linux-utils s6-linux-init busybox execline ]; + path' = path ++ [ + s6 s6-portable-utils s6-linux-utils s6-linux-init busybox execline + ]; in writeScript "init-stage1" '' #! ${execline}/bin/execlineb -P - export PATH ${lib.makeBinPath path} + export PATH ${lib.makeBinPath path'} ${s6}/bin/s6-setsid -qb -- importas -i spectrumcmd spectrumcmd -- 2.30.0
On Mon Mar 15, 2021 at 6:58 AM PDT, Alyssa Ross wrote:
Stage 1 was supposed to be able to take a list of PATH entries to prepend to the default PATH, but it didn't do anything with them. Now, it properly adds them to the PATH as early as possible during boot.
This mechanism isn't currently used anywhere, but is very useful for debugging. --- pkgs/os-specific/linux/spectrum/rootfs/generic.nix | 3 ++- pkgs/os-specific/linux/spectrum/rootfs/stage1.nix | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-)
Stuff that helps debugging is good! Reviewed-by: Cole Helbling <cole.e.helbling@outlook.com>
On Mon, Mar 15, 2021 at 04:11:42PM -0700, Cole Helbling wrote:
On Mon Mar 15, 2021 at 6:58 AM PDT, Alyssa Ross wrote:
Stage 1 was supposed to be able to take a list of PATH entries to prepend to the default PATH, but it didn't do anything with them. Now, it properly adds them to the PATH as early as possible during boot.
This mechanism isn't currently used anywhere, but is very useful for debugging. --- pkgs/os-specific/linux/spectrum/rootfs/generic.nix | 3 ++- pkgs/os-specific/linux/spectrum/rootfs/stage1.nix | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-)
Stuff that helps debugging is good!
Reviewed-by: Cole Helbling <cole.e.helbling@outlook.com>
Committed as d85408e1193. Thanks for the review!
participants (2)
-
Alyssa Ross -
Cole Helbling