patches and low-level development discussion
 help / color / mirror / code / Atom feed
be7853316e95d46908443ba6b4d3ad5473060c3b blob 1216 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 
{ writeScript, lib
, execline, s6, s6-portable-utils, s6-linux-utils, s6-linux-init, busybox, mesa
}:

{ run ? "true" }:

let
  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}
  ${s6}/bin/s6-setsid -qb --

  importas -i spectrumcmd spectrumcmd

  umask 022
  if { s6-mount -t tmpfs -o mode=0755 tmpfs /run }
  if { s6-hiercopy /etc/service /run/service }
  emptyenv -p

  background {
    s6-setsid --
    if { s6-mkdir -p /run/user/0 /dev/pts /dev/shm }
    if { install -o user -g user -d /run/user/1000 }
    if { s6-mount -t devpts -o gid=4,mode=620 none /dev/pts }
    if { s6-mount -t tmpfs none /dev/shm }
    if { s6-mount -t proc none /proc }
    if { s6-mount -t sysfs none /sys }
    if { s6-ln -s ${mesa.drivers} /run/opengl-driver }

    export HOME /
    export XDG_RUNTIME_DIR /run/user/0
    foreground {
      ifelse { test -n $spectrumcmd }
        { pipeline { heredoc 0 $spectrumcmd base64 -d } /bin/sh }
        ${run}
    }
    importas -i ? ?
    if { s6-echo STATUS: $? }
    s6-svscanctl -6 /run/service
  }

  unexport !
  cd /run/service
  s6-svscan
''
debug log:

solving be7853316e9 ...
found be7853316e9 in https://spectrum-os.org/git/nixpkgs

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).