patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Subject: [PATCH nixpkgs] spectrumPackages.rootfs: fix custom path entries
Date: Mon, 15 Mar 2021 13:58:20 +0000	[thread overview]
Message-ID: <20210315135820.6375-1-hi@alyssa.is> (raw)

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

             reply	other threads:[~2021-03-15 13:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 13:58 Alyssa Ross [this message]
2021-03-15 23:11 ` [PATCH nixpkgs] spectrumPackages.rootfs: fix custom path entries Cole Helbling
2021-03-16  0:48   ` Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210315135820.6375-1-hi@alyssa.is \
    --to=hi@alyssa.is \
    --cc=devel@spectrum-os.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).