switch to s6-linux-init and s6-rc

This is at the point where it runs a getty and a pile of s6-supervise
processes, though it doesn't seem to run the things being supervised
This commit is contained in:
Daniel Barlow
2022-09-21 23:01:21 +01:00
parent 6be5b90c96
commit 45025f128a
12 changed files with 404 additions and 22 deletions

View File

@@ -0,0 +1,13 @@
/service/s6-linux-init-runleveld/notification-fd f 0644 0 0 echo -n "3" |qprint -d
/service/s6-linux-init-runleveld/run f 0755 0 0 echo -n " hello=0A newline=0A" |qprint -d
/service/s6-linux-init-runleveld d 0755 0 0
/service/s6-linux-init-shutdownd/fifo i 0600 0 0 f
/service/s6-linux-init-shutdownd/run f 0755 0 0 echo -n "s6-linux-init/bin/s6-linux-init-shutdownd -c =22/etc/s6-linux-init/current=22 -g 3000=0A" |qprint -d
/service/s6-linux-init-shutdownd d 0755 0 0
/service/s6-svscan-log/fifo i 0600 0 0 f
/service/s6-svscan-log/notification-fd f 0644 0 0 echo -n "3" |qprint -d
/service/s6-svscan-log/run f 0644 0 0 echo -n "gdsgdfgsdgf=0A" |qprint -d
/service/s6-svscan-log d 0755 0 0
/service d 0755 0 0
/uncaught-logs d 2750 0 0

17
tests/pseudofiles/run.sh Executable file
View File

@@ -0,0 +1,17 @@
set -e
expr=$(cat <<"EXPR"
let
overlay = import ./overlay.nix;
nixpkgs = import <nixpkgs> ( {overlays = [overlay]; });
structure = import ./tests/pseudofiles/structure.nix;
in nixpkgs.pkgs.pseudofile "pseudo.s6-init" structure
EXPR
)
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -E "${expr}" -o tests/pseudofiles/result $*
diff tests/pseudofiles/result tests/pseudofiles/result.expected
test -f /tmp/out.squashfs && rm /tmp/out.squashfs
nix-shell -p squashfsTools -p qprint --run "mksquashfs - /tmp/out.squashfs -p '/ d 755 0 0' -pf tests/pseudofiles/result -quiet -no-progress"
foo="$(nix-shell -p squashfsTools --run 'unsquashfs -cat /tmp/out.squashfs service/s6-linux-init-runleveld/run')"
test "$foo" = "$(printf "hello\nworld")"

View File

@@ -0,0 +1,45 @@
let
dir = contents: { type = "d"; inherit contents; };
structure = {
service = dir {
s6-linux-init-runleveld = dir {
notification-fd = { file = "3"; };
run = {
file = ''
hello
world
'';
mode = "0755";
};
};
s6-linux-init-shutdownd = dir {
fifo = {
type = "i";
subtype = "f";
mode = "0600";
};
run = {
file = ''
s6-linux-init/bin/s6-linux-init-shutdownd -c "/etc/s6-linux-init/current" -g 3000
'';
mode = "0755";
};
};
s6-svscan-log = dir {
fifo = {
type = "i";
subtype = "f";
mode = "0600";
};
notification-fd = { file = "3"; };
run = {
file = ''
gdsgdfgsdgf
'';
};
};
};
uncaught-logs = (dir {}) // {mode = "2750";};
};
in structure