carbon-config

config submodule of carbon-core-system
git clone https://ccx.te2000.cz/git/carbon-config
Log | Files | Refs

commit ce0e6493b605c0e13a61ce22de839cef7ce2d31b
parent 14fe8e1bc232d26f8ea76f6bc98295b6e9585e1d
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Mon, 25 Jul 2022 08:41:06 +0200

Generate s6-rc.fileset from aat templates and fs definition.

Diffstat:
AMakefile | 18++++++++++++++++++
Afs | 116+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aparse_fs.include.awk | 303+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
As6-rc-mount.aat | 32++++++++++++++++++++++++++++++++
As6-rc-mount.awk | 336+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
As6-rc.aat | 343+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
As6-rc.awk | 343+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ms6-rc.fileset | 466++++++++++++++++++++++++++++++++++++++++++-------------------------------------
Cs6-rc.fileset -> s6-rc.fileset.orig | 0
9 files changed, 1741 insertions(+), 216 deletions(-)

diff --git a/Makefile b/Makefile @@ -0,0 +1,18 @@ +.PHONY: all + +all: s6-rc.fileset + +s6-rc-mount.awk: s6-rc-mount.aat parse_fs.include.awk + aat.awk s6-rc-mount.aat >"$@.new" + # sed -f aat_macros.sed + mv "$@.new" "$@" + +s6-rc.awk: s6-rc.aat + aat.awk s6-rc.aat >"$@.new" + # sed -f aat_macros.sed + mv "$@.new" "$@" + +s6-rc.fileset: s6-rc.awk s6-rc-mount.awk fs + awk -f s6-rc-mount.awk fs >"$@.new" + awk -f s6-rc.awk /dev/null >>"$@.new" + mv "$@.new" "$@" diff --git a/fs b/fs @@ -0,0 +1,116 @@ +/ + source=LABEL="INSTALL_ROOT" + type=xfs + options=rw,noatime + premounted=true + down=readonly + bundles=ok-localmount + +/sys + source=sysfs + type=sysfs + bundles=ok-sysinit + down=keep + +/proc + source=proc + type=proc + bundles=ok-sysinit + down=keep + +/dev + source=dev + type=devtmpfs + options=rw,nosuid + bundles=ok-sysinit + down=keep +# premounted=true + +/dev/pts + source=devpts + type=devpts + options=rw,relatime,mode=600,ptmxmode=000 + bundles=ok-sysinit + down=keep + +/dev/shm + source=shm + type=tmpfs + options=rw,nosuid,nodev,relatime + bundles=ok-sysinit + down=keep + +/dev/mqueue + source=mqueue + mkdir=true + type=mqueue + options=rw,nosuid,nodev,noexec + bundles=ok-sysinit + down=keep + +#/run +# source=tmpfs +# ... managed by s-l-i + +/run/cgroup2 + source=none + type=cgroup2 + mkdir=true + bundles=ok-sysinit + # override dependency on rootfs as /run is always rw + dependencies= + +/boot + source=LABEL="SPARK_BOOT" + type=ext2 + options=ro,noatime + bundles=ok-localmount + +#/var +# source=/dev/mapper/vg-var +# type=xfs +# options=rw,noatime +# bundles=ok-localmount +# +#/var/lib/postgresql +# source=/dev/mapper/vg-postgresql +# type=xfs +# options=rw,noatime +# extra_dependencies=mount-dev +# bundles=ok-localmount + +#sysfs /sys +# mount -wt sysfs sys /sys -o remount || exec mount -wt sysfs sys /sys +# +#devtmpfs /dev +# mount -wt devtmpfs dev /dev -o remount,nosuid || exec mount -wt devtmpfs dev /dev -o nosuid +# +#proc /proc +# mount -wt proc proc /proc -o remount || mount -wt proc proc /proc +# +#devpts /dev/pts +# mkdir -p /dev/pts || exit $?; mount -wt devpts devpts /dev/pts -o remount,rw,relatime,mode=600,ptmxmode=000 || exec mount -wt devpts devpts /dev/pts -o rw,relatime,mode=600,ptmxmode=000 +# +#shm /dev/shm +# mount -wt tmpfs shm /dev/shm -o remount,rw,nosuid,nodev,relatime || exec mount -wt tmpfs shm /dev/shm -o rw,nosuid,nodev,relatime +# +#LABEL="INSTALL_ROOT" / xfs noatime 0 2 +# +#tmpfs /run +#none /run/cgroup2 +#CN if { mkdir /run/cgroup2 } +# mount -t cgroup2 none /run/cgroup2 +# +#mqueue /dev/mqueue +# mkdir -p /dev/mqueue || exit $?; mount -t mqueue mqueue /dev/mqueue -o remount,rw,nosuid,nodev,noexec || mount -t mqueue mqueue /dev/mqueue -o nosuid,nodev,noexec +#LABEL="SPARK_BOOT" /boot ext2 ro,noatime 0 2 +# +#CN if { mkdir -p /tmp/.X11-unix /run/X11 } +# if { chmod 771 /run/X11 } +# if { chown root:xorg /run/X11 } +# mount --bind /run/X11 /tmp/.X11-unix +# +### # umount all filesystems except specials, if possible +### foreground { umount --all --verbose --detach-loop -t nodevtmpfs,noproc,nosysfs,nodevpts,nomqueue } +### # remount the rest read-only, except for tmpfs +### foreground { umount --all --read-only --verbose -t nodevtmpfs,noproc,nosysfs,nodevpts,nomqueue,notmpfs } diff --git a/parse_fs.include.awk b/parse_fs.include.awk @@ -0,0 +1,303 @@ +BEGIN{ + param_validator["source"] = ".+" + param_validator["type"] = "[a-z0-9._]+" + param_validator["options"] = ".*" + param_validator["bundles"] = "[^ ]+" + param_validator["down"] = "(umount|readonly|keep)" + param_validator["mkdir"] = "(true|false)" + param_validator["premounted"] = "(true|false)" + param_validator["service_name"] = "[^ /]+" + param_validator["dependencies"] = "[^/]*" + param_validator["extra_dependencies"] = "[^/]+" + fail = 0 +} + +function q(s) { # quote string for execline + gsub(/\\/, "\\\\", s) + gsub(/\n/, "\\n", s) + gsub(/\"/, "\\\"", s) + return "\"" s "\"" +} + +function fatal_mtp(s){ + print mountpoints[mtp] ": Error: " s " [" mtp "]" >"/dev/stderr" + fail=1 + exit 1 +} + +function fatal_parse(s){ + print FILENAME ":" FNR ": Error: " s >"/dev/stderr" + fail=1 + exit 1 +} + +function dbg(s){ + if(debug) { + print("#" s) + } +} + +function is_parent(child_path, parent_path) { + if(child_path == "/") { + return 0 + } + if(parent_path == "/") { + return 1 + } + parent_path = parent_path "/" + return substr(child_path, 1, length(parent_path)) == parent_path +} +# function is_parent(child_path, parent_path, result) { +# result = is_parent_(child_path, parent_path) +# dbg("++ '" parent_path "' " (result?"is":"is NOT") " parent of '" child_path "'") +# return result +# } + +function mtp_get(mtp_x, name) { + if(!((mtp_x,name) in params)) { + fatal_mtp("parameter '" name "' not set") + } + if(name in param_validator) { + if(params[mtp_x,name] !~ ("^" param_validator[name] "$")) { + fatal_mtp("Internal: parameter '" mtp_x "','" name "' set to unrecognized value '" params[mtp_x,name] "'") + } + } else if (!(name in param_extras)) { + fatal_mtp("Internal: parameter name '" mtp_x "','" name "' not known") + } + return params[mtp_x,name] +} + +function get(name) { + return mtp_get(mtp, name) +} + +function set(name, value) { + if(name in param_validator) { + if(value !~ ("^" param_validator[name] "$")) { + fatal_mtp("Internal: tried to set '" name "' set to unrecognized value '" value "'") + } + } else if (!(name in param_extras)) { + fatal_mtp("Internal: parameter name '" name "' not known") + } + params[mtp,name] = value +} + +function set1(name, value) { + if((mtp,name) in params) { + fatal_mtp("parameter '" name "' already set to '" params[mtp,value] "', tried to assign '" value "'") + } + set(name, value) +} + +function boolean(name) { # Check boolean parameter + return get(name) == "true" +} + +function down(is_value) { # Check "down" parameter + return is_value == get("down") +} + +function down_umount() { return down("umount") } +function down_keep() { return down("keep") } +function down_readonly() { return down("readonly") } + +function dependencies( s, i) { + s = "" + for(i=1; i<=dn; i++) { + s = s "\t" ds[i] "\n" + } + return s +} + +function find_topmost_mount( found, mtp2) { + found = "" + for(mtp2 in mountpoints) { + if(length(mtp2) > length(found) && is_parent(mtp, mtp2)) { + found = mtp2 + } + } + if(!length(found)) { + # consider if this should be error for mtp != "/" + return "" + } + dbg(" dep FOUND: '" found "' -> svc: '" mtp_get(found, "service_name") "'") + if(!boolean("mkdir")) { + if(mtp_get(found,"premounted") == "true" && mtp_get(found,"down") != "umount") { + # Dependency would be superfluous + return "" + } + } + # fatal_mtp("FOUND: '" found "' -> svc: '" mtp_get(found, "service_name") "'") + return params[found, "service_name"] +} + +function process_record( name, i, mtp2) { + dbg("## ----------------------------------------------------------------------") + if(!((mtp,"premounted") in params)) { + set1("premounted", "false") + } + + if(!((mtp,"mkdir") in params)) { + set1("mkdir", boolean("premounted") ? "false" : "true") + } + + if(!((mtp,"down") in params)) { + set1("down", "umount") + } + + if(!((mtp,"options") in params)) { + set1("options", "rw") + } + + # set1("dependencies", "foo bar") + if(((mtp,"dependencies") in params)) { + if(((mtp,"extra_dependencies") in params)) { + fatal_mtp("Define either 'extra_dependencies' or 'dependencies', not both") + } + dn = split(get("dependencies"), ds) + + } else { + if(((mtp,"extra_dependencies") in params)) { + dn = split(get("extra_dependencies"), ds) + } else { + dn = 0 + } + i = find_topmost_mount() + if(length(i)) { + dn += 1 + ds[dn] = i + } + + } + + #print(">>> " mtp " <<< " ((mtp,"service_name") in params)) + # if(!((mtp,"service_name") in params)) { + # It may be initialized by access from find_topmost_mount() + if(length(params[mtp,"service_name"]) == 0) { + if(mtp == "/") { + if(!boolean("premounted")) { + fatal_mtp("rootfs not set as premounted") + } + set("service_name", "rootfs") + } else { + svc_name = mtp + gsub("/", "-", svc_name) + set("service_name", "mount" svc_name) + } + } + svc_name = get("service_name") + if(svc_name !~ ("^" param_validator["service_name"] "$")) { + fatal_mtp("Service name '" svc_name "' not valid") + } + if(svc_name in services) { + fatal_mtp("Service name '" svc_name "' collides with mountpoint '" services[svc_name] "' defined at " mountpoints[services[svc_name]]) + } + services[svc_name] = mtp + + if(debug) { + printf("#>> mtp='%s'\n", mtp) + for(name in params) { + if(substr(name, 1, length(mtp)+1) == mtp SUBSEP) { + printf("#>> %s='%s'\n", substr(name, length(mtp)+1), params[name]) + } + } + } + + + q_file = q(mtp) + q_spec = q(get("source")) + q_vfstype = q(get("type")) + q_remount_options = get("options") == "defaults" ? "remount" : q("remount," get("options")) + q_options = q(get("options")) + + write_oneshot() + + if((mtp,"bundles") in params) { + split(get("bundles"), bundle_list) + for(i in bundle_list) { + bundles[bundle_list[i]] = bundles[bundle_list[i]] "\t" svc_name "\n" + } + delete bundle_list + } + + #delete params + mtp = "" +} + +function process_bundles( name) { + for(name in bundles) { + write_bundle(name) + } +} + +function validate_mountpoint( mtp2) { + if(mtp in mountpoints) { + fatal_parse("duplicate definition of mountpoint '" $0 "', previous definition at " mountpoints[$0]) + } + if(mtp != "/" && mtp ~ "/$") { + fatal_parse("Trailing slash not allowed: '" mtp "'") + } + if(mtp ~ "/(|\\.|\\.\\.)/") { + fatal_parse("Mountpoint '" mtp "' is not canonical absolute path") + } + for(mtp2 in mountpoints) { + if(is_parent(mtp2, mtp)) { + fatal_parse("mountpoint '" mtp "' defined after implicit reverse dependency '" mtp2 "' located at " mountpoints[mtp2]) + } + } +} + +# Skip comments +/^[ \t]*#/{ next } + +# mountpoint (aka fs_file in fstab) +/^\//{ + if(mtp) { + process_record() + } + mtp=$0 + validate_mountpoint() + mountpoints[mtp] = FILENAME ":" FNR + next +} + +# All other lines +{ + line=$0 + m = match(line, /^[ \t]+/) + if(m) { + # Strip leading whitespace + line = substr(line, m+RLENGTH) + } + if(length(line) == 0) { + # Skip empty lines + next + } + m = match(line, /=/) + if(m) { + name = substr(line, 1, m-1) + value = substr(line, m+RLENGTH) + if((mtp, name) in params) { + fatal_parse("Duplicate definition of parameter '" name "'") + } + if(!(name in param_validator)) { + fatal_parse("Unrecognized parameter '" name "'") + } + if(value !~ ("^" param_validator[name] "$")) { + fatal_parse("Invalid value for parameter '" name "': '" value "'") + } + params[mtp,name] = value + } else { + fatal_parse("missing '=' in parameter definition") + } +} + +END{ + if(fail) { + exit fail + } + if(mtp) { + process_record() + } + process_bundles() +} diff --git a/s6-rc-mount.aat b/s6-rc-mount.aat @@ -0,0 +1,32 @@ +|### write_oneshot ### +|function write_oneshot() { +/{{svc_name}} d m755 +|if(dependencies()) { +/{{svc_name}}/dependencies +CN{{dependencies()}} +m644 +|} +|if(down_umount()) { +/{{svc_name}}/down cN s6-umount {{q_file}} m644 +|} else if (down_readonly()) { +/{{svc_name}}/down cN s6-mount -o remount,ro {{q_file}} m644 +|} +/{{svc_name}}/type cN oneshot m644 +/{{svc_name}}/up +CN # mount {{get("source")}} on {{mtp}} +|if(boolean("mkdir")) { + if { mkdir -p {{q_file}} } +|} + if -n -t { s6-mount -t {{q_vfstype}} -o {{q_remount_options}} {{q_spec}} {{q_file}} } + s6-mount -t {{q_vfstype}} -o {{q_options}} {{q_spec}} {{q_file}} +|} +|### write_bundle ### +|function write_bundle(name) { +/{{name}} d m755 +/{{name}}/contents +CN{{bundles[name]}} +m644 +/{{name}}/type cN bundle m644 +|} +|### include main loop / parsing code ### +@awk parse_fs.include.awk diff --git a/s6-rc-mount.awk b/s6-rc-mount.awk @@ -0,0 +1,336 @@ +### write_oneshot ### +function write_oneshot() { +printf "%s", "/" (svc_name) " d m755\n" +if(dependencies()) { +printf "%s", "/" (svc_name) "/dependencies\n" +printf "%s", "CN" (dependencies()) "\n" +printf "%s", "m644\n" +} +if(down_umount()) { +printf "%s", "/" (svc_name) "/down cN s6-umount " (q_file) " m644\n" +} else if (down_readonly()) { +printf "%s", "/" (svc_name) "/down cN s6-mount -o remount,ro " (q_file) " m644\n" +} +printf "%s", "/" (svc_name) "/type cN oneshot m644\n" +printf "%s", "/" (svc_name) "/up\n" +printf "%s", "CN # mount " (get("source")) " on " (mtp) "\n" +if(boolean("mkdir")) { +printf "%s", " if { mkdir -p " (q_file) " }\n" +} +printf "%s", " if -n -t { s6-mount -t " (q_vfstype) " -o " (q_remount_options) " " (q_spec) " " (q_file) " }\n" +printf "%s", " s6-mount -t " (q_vfstype) " -o " (q_options) " " (q_spec) " " (q_file) "\n" +} +### write_bundle ### +function write_bundle(name) { +printf "%s", "/" (name) " d m755\n" +printf "%s", "/" (name) "/contents\n" +printf "%s", "CN" (bundles[name]) "\n" +printf "%s", "m644\n" +printf "%s", "/" (name) "/type cN bundle m644\n" +} +### include main loop / parsing code ### +# start @awk parse_fs.include.awk {{{ +BEGIN{ + param_validator["source"] = ".+" + param_validator["type"] = "[a-z0-9._]+" + param_validator["options"] = ".*" + param_validator["bundles"] = "[^ ]+" + param_validator["down"] = "(umount|readonly|keep)" + param_validator["mkdir"] = "(true|false)" + param_validator["premounted"] = "(true|false)" + param_validator["service_name"] = "[^ /]+" + param_validator["dependencies"] = "[^/]*" + param_validator["extra_dependencies"] = "[^/]+" + fail = 0 +} + +function q(s) { # quote string for execline + gsub(/\\/, "\\\\", s) + gsub(/\n/, "\\n", s) + gsub(/\"/, "\\\"", s) + return "\"" s "\"" +} + +function fatal_mtp(s){ + print mountpoints[mtp] ": Error: " s " [" mtp "]" >"/dev/stderr" + fail=1 + exit 1 +} + +function fatal_parse(s){ + print FILENAME ":" FNR ": Error: " s >"/dev/stderr" + fail=1 + exit 1 +} + +function dbg(s){ + if(debug) { + print("#" s) + } +} + +function is_parent(child_path, parent_path) { + if(child_path == "/") { + return 0 + } + if(parent_path == "/") { + return 1 + } + parent_path = parent_path "/" + return substr(child_path, 1, length(parent_path)) == parent_path +} +# function is_parent(child_path, parent_path, result) { +# result = is_parent_(child_path, parent_path) +# dbg("++ '" parent_path "' " (result?"is":"is NOT") " parent of '" child_path "'") +# return result +# } + +function mtp_get(mtp_x, name) { + if(!((mtp_x,name) in params)) { + fatal_mtp("parameter '" name "' not set") + } + if(name in param_validator) { + if(params[mtp_x,name] !~ ("^" param_validator[name] "$")) { + fatal_mtp("Internal: parameter '" mtp_x "','" name "' set to unrecognized value '" params[mtp_x,name] "'") + } + } else if (!(name in param_extras)) { + fatal_mtp("Internal: parameter name '" mtp_x "','" name "' not known") + } + return params[mtp_x,name] +} + +function get(name) { + return mtp_get(mtp, name) +} + +function set(name, value) { + if(name in param_validator) { + if(value !~ ("^" param_validator[name] "$")) { + fatal_mtp("Internal: tried to set '" name "' set to unrecognized value '" value "'") + } + } else if (!(name in param_extras)) { + fatal_mtp("Internal: parameter name '" name "' not known") + } + params[mtp,name] = value +} + +function set1(name, value) { + if((mtp,name) in params) { + fatal_mtp("parameter '" name "' already set to '" params[mtp,value] "', tried to assign '" value "'") + } + set(name, value) +} + +function boolean(name) { # Check boolean parameter + return get(name) == "true" +} + +function down(is_value) { # Check "down" parameter + return is_value == get("down") +} + +function down_umount() { return down("umount") } +function down_keep() { return down("keep") } +function down_readonly() { return down("readonly") } + +function dependencies( s, i) { + s = "" + for(i=1; i<=dn; i++) { + s = s "\t" ds[i] "\n" + } + return s +} + +function find_topmost_mount( found, mtp2) { + found = "" + for(mtp2 in mountpoints) { + if(length(mtp2) > length(found) && is_parent(mtp, mtp2)) { + found = mtp2 + } + } + if(!length(found)) { + # consider if this should be error for mtp != "/" + return "" + } + dbg(" dep FOUND: '" found "' -> svc: '" mtp_get(found, "service_name") "'") + if(!boolean("mkdir")) { + if(mtp_get(found,"premounted") == "true" && mtp_get(found,"down") != "umount") { + # Dependency would be superfluous + return "" + } + } + # fatal_mtp("FOUND: '" found "' -> svc: '" mtp_get(found, "service_name") "'") + return params[found, "service_name"] +} + +function process_record( name, i, mtp2) { + dbg("## ----------------------------------------------------------------------") + if(!((mtp,"premounted") in params)) { + set1("premounted", "false") + } + + if(!((mtp,"mkdir") in params)) { + set1("mkdir", boolean("premounted") ? "false" : "true") + } + + if(!((mtp,"down") in params)) { + set1("down", "umount") + } + + if(!((mtp,"options") in params)) { + set1("options", "rw") + } + + # set1("dependencies", "foo bar") + if(((mtp,"dependencies") in params)) { + if(((mtp,"extra_dependencies") in params)) { + fatal_mtp("Define either 'extra_dependencies' or 'dependencies', not both") + } + dn = split(get("dependencies"), ds) + + } else { + if(((mtp,"extra_dependencies") in params)) { + dn = split(get("extra_dependencies"), ds) + } else { + dn = 0 + } + i = find_topmost_mount() + if(length(i)) { + dn += 1 + ds[dn] = i + } + + } + + #print(">>> " mtp " <<< " ((mtp,"service_name") in params)) + # if(!((mtp,"service_name") in params)) { + # It may be initialized by access from find_topmost_mount() + if(length(params[mtp,"service_name"]) == 0) { + if(mtp == "/") { + if(!boolean("premounted")) { + fatal_mtp("rootfs not set as premounted") + } + set("service_name", "rootfs") + } else { + svc_name = mtp + gsub("/", "-", svc_name) + set("service_name", "mount" svc_name) + } + } + svc_name = get("service_name") + if(svc_name !~ ("^" param_validator["service_name"] "$")) { + fatal_mtp("Service name '" svc_name "' not valid") + } + if(svc_name in services) { + fatal_mtp("Service name '" svc_name "' collides with mountpoint '" services[svc_name] "' defined at " mountpoints[services[svc_name]]) + } + services[svc_name] = mtp + + if(debug) { + printf("#>> mtp='%s'\n", mtp) + for(name in params) { + if(substr(name, 1, length(mtp)+1) == mtp SUBSEP) { + printf("#>> %s='%s'\n", substr(name, length(mtp)+1), params[name]) + } + } + } + + + q_file = q(mtp) + q_spec = q(get("source")) + q_vfstype = q(get("type")) + q_remount_options = get("options") == "defaults" ? "remount" : q("remount," get("options")) + q_options = q(get("options")) + + write_oneshot() + + if((mtp,"bundles") in params) { + split(get("bundles"), bundle_list) + for(i in bundle_list) { + bundles[bundle_list[i]] = bundles[bundle_list[i]] "\t" svc_name "\n" + } + delete bundle_list + } + + #delete params + mtp = "" +} + +function process_bundles( name) { + for(name in bundles) { + write_bundle(name) + } +} + +function validate_mountpoint( mtp2) { + if(mtp in mountpoints) { + fatal_parse("duplicate definition of mountpoint '" $0 "', previous definition at " mountpoints[$0]) + } + if(mtp != "/" && mtp ~ "/$") { + fatal_parse("Trailing slash not allowed: '" mtp "'") + } + if(mtp ~ "/(|\\.|\\.\\.)/") { + fatal_parse("Mountpoint '" mtp "' is not canonical absolute path") + } + for(mtp2 in mountpoints) { + if(is_parent(mtp2, mtp)) { + fatal_parse("mountpoint '" mtp "' defined after implicit reverse dependency '" mtp2 "' located at " mountpoints[mtp2]) + } + } +} + +# Skip comments +/^[ \t]*#/{ next } + +# mountpoint (aka fs_file in fstab) +/^\//{ + if(mtp) { + process_record() + } + mtp=$0 + validate_mountpoint() + mountpoints[mtp] = FILENAME ":" FNR + next +} + +# All other lines +{ + line=$0 + m = match(line, /^[ \t]+/) + if(m) { + # Strip leading whitespace + line = substr(line, m+RLENGTH) + } + if(length(line) == 0) { + # Skip empty lines + next + } + m = match(line, /=/) + if(m) { + name = substr(line, 1, m-1) + value = substr(line, m+RLENGTH) + if((mtp, name) in params) { + fatal_parse("Duplicate definition of parameter '" name "'") + } + if(!(name in param_validator)) { + fatal_parse("Unrecognized parameter '" name "'") + } + if(value !~ ("^" param_validator[name] "$")) { + fatal_parse("Invalid value for parameter '" name "': '" value "'") + } + params[mtp,name] = value + } else { + fatal_parse("missing '=' in parameter definition") + } +} + +END{ + if(fail) { + exit fail + } + if(mtp) { + process_record() + } + process_bundles() +} +# }}} end @awk parse_fs.include.awk diff --git a/s6-rc.aat b/s6-rc.aat @@ -0,0 +1,343 @@ +|BEGIN{ +/ d m755 +/dhcpcd d m755 +/dhcpcd/dependencies +CN modules + ok-mount + ok-sysinit +m644 +/dhcpcd/run +CN #!/command/execlineb -P + getpid SERVICE_PID + foreground { + importas -i SERVICE_PID SERVICE_PID + if { test -d /run/cgroup2 } + if { mkdir -p /run/cgroup2/s6-rc/dhcpcd } + redirfd -w 1 /run/cgroup2/s6-rc/dhcpcd/cgroup.procs + printf "%s" ${SERVICE_PID} + } + unexport SERVICE_PID + + dhcpcd --nobackground +m755 +/dhcpcd/type cN longrun m644 +/dmesg d m755 +/dmesg/type cN oneshot m644 +/dmesg/up +CN # description="Set the dmesg level for a cleaner boot" + # dmesg_level=1 + dmesg -n1 +m755 +/gettys d m755 +/gettys/contents +CN tty1 + tty3 + tty2 + tty4 +m644 +/gettys/type cN bundle m644 +/hostname d m755 +/hostname/type cN oneshot m644 +/hostname/up cN hostname -F /etc/hostname m755 +/kbd_mode d m755 +/kbd_mode/contents +CN kbd_mode-tty1 + kbd_mode-tty2 + kbd_mode-tty3 + kbd_mode-tty4 + kbd_mode-tty9 + kbd_mode-tty10 + kbd_mode-tty11 + kbd_mode-tty12 +m644 +/kbd_mode-tty1 d m755 +/kbd_mode-tty1/type cN oneshot m644 +/kbd_mode-tty1/up cN kbd_mode -u -C /dev/tty1 m644 +/kbd_mode-tty10 d m755 +/kbd_mode-tty10/type cN oneshot m644 +/kbd_mode-tty10/up cN kbd_mode -u -C /dev/tty10 m644 +/kbd_mode-tty11 d m755 +/kbd_mode-tty11/type cN oneshot m644 +/kbd_mode-tty11/up cN kbd_mode -u -C /dev/tty11 m644 +/kbd_mode-tty12 d m755 +/kbd_mode-tty12/type cN oneshot m644 +/kbd_mode-tty12/up cN kbd_mode -u -C /dev/tty12 m644 +/kbd_mode-tty2 d m755 +/kbd_mode-tty2/type cN oneshot m644 +/kbd_mode-tty2/up cN kbd_mode -u -C /dev/tty2 m644 +/kbd_mode-tty3 d m755 +/kbd_mode-tty3/type cN oneshot m644 +/kbd_mode-tty3/up cN kbd_mode -u -C /dev/tty3 m644 +/kbd_mode-tty4 d m755 +/kbd_mode-tty4/type cN oneshot m644 +/kbd_mode-tty4/up cN kbd_mode -u -C /dev/tty4 m644 +/kbd_mode-tty5 d m755 +/kbd_mode-tty5/type cN oneshot m644 +/kbd_mode-tty5/up cN kbd_mode -u -C /dev/tty5 m644 +/kbd_mode-tty6 d m755 +/kbd_mode-tty6/type cN oneshot m644 +/kbd_mode-tty6/up cN kbd_mode -u -C /dev/tty6 m644 +/kbd_mode-tty7 d m755 +/kbd_mode-tty7/type cN oneshot m644 +/kbd_mode-tty7/up cN kbd_mode -u -C /dev/tty7 m644 +/kbd_mode-tty8 d m755 +/kbd_mode-tty8/type cN oneshot m644 +/kbd_mode-tty8/up cN kbd_mode -u -C /dev/tty8 m644 +/kbd_mode-tty9 d m755 +/kbd_mode-tty9/type cN oneshot m644 +/kbd_mode-tty9/up cN kbd_mode -u -C /dev/tty9 m644 +/kbd_mode/type cN bundle m644 +/loadkeys d m755 +/loadkeys/dependencies cN kbd_mode m644 +/loadkeys/type cN oneshot m644 +/loadkeys/up cN loadkeys --unicode /root/keymap m644 +/loopback d m755 +/loopback/type cN oneshot m644 +/loopback/up +CN if { ip link set lo up } + if -nt { ip addr add 127.0.0.1/8 dev lo brd + } + pipeline { ip addr show dev lo } grep -q "inet 127\\.0\\.0\\.1" +m755 +/modules d m755 +/modules/dependencies cN dmesg m644 +/modules/type cN oneshot m644 +/modules/up +CN foreground { modprobe fuse } + foreground { modprobe overlay } + foreground { modprobe tun } + foreground { modprobe e1000 } + foreground { modprobe vmxnet3 } + foreground { modprobe virtio_pci } + foreground { modprobe virtio_net } +m755 +/net-all d m755 +/net-all/contents +CN dhcpcd + unbound + loopback +m644 +/net-all/type cN bundle m644 +/ok-all d m755 +/ok-all-but-tty d m755 +/ok-all-but-tty/contents +CN ok-mount + net-all + setfont + dmesg + hostname + modules + sshd +m644 +/ok-all-but-tty/type cN bundle m644 +/ok-all/contents +CN ok-all-but-tty + gettys +m644 +/ok-all/type cN bundle m644 +/ok-mount d m755 +/ok-mount/contents +CN ok-sysinit + ok-localmount +m644 +/ok-mount/type cN bundle m644 +/openrc d m755 +/openrc/dependencies +CN ok-sysinit + ok-mount + modules +m644 +/openrc/down +CN export TERM "linux" + /sbin/openrc shutdown +m644 +/openrc/type cN oneshot m644 +/openrc/up +CN export TERM "linux" + foreground { /sbin/openrc boot } + /sbin/openrc default +m644 +/.scripts d m755 +/setfont d m755 +/setfont/contents +CN setfont-tty1 + setfont-tty2 + setfont-tty3 + setfont-tty4 +m644 +/setfont-tty1 d m755 +/setfont-tty1/type cN oneshot m644 +/setfont-tty1/up cN redirfd -r 0 /dev/tty1 setfont ter-v14n m644 +/setfont-tty2 d m755 +/setfont-tty2/type cN oneshot m644 +/setfont-tty2/up cN redirfd -r 0 /dev/tty2 setfont ter-v14n m644 +/setfont-tty3 d m755 +/setfont-tty3/type cN oneshot m644 +/setfont-tty3/up cN redirfd -r 0 /dev/tty3 setfont ter-v14n m644 +/setfont-tty4 d m755 +/setfont-tty4/type cN oneshot m644 +/setfont-tty4/up cN redirfd -r 0 /dev/tty4 setfont ter-v14n m644 +/setfont/type cN bundle m644 +/sshd d m755 +/sshd/dependencies +CN ssh_host_ed25519_key + ssh_host_rsa_key + ok-sysinit +m644 +/sshd/run +CN #!/command/execlineb -P + fdmove -c 2 1 + getpid SERVICE_PID + foreground { + importas -i SERVICE_PID SERVICE_PID + if { test -d /run/cgroup2 } + if { mkdir -p /run/cgroup2/s6-rc/sshd } + redirfd -w 1 /run/cgroup2/s6-rc/sshd/cgroup.procs + printf "%s" ${SERVICE_PID} + } + unexport SERVICE_PID + + /usr/sbin/sshd -D -f /etc/ssh/sshd_config +m755 +/sshd/type cN longrun m644 +/ssh_host_ed25519_key d m755 +/ssh_host_ed25519_key/dependencies +CN hostname + root-writable +m644 +/ssh_host_ed25519_key/type cN oneshot m644 +/ssh_host_ed25519_key/up +CN if -n -t { s6-test -f /etc/ssh/ssh_host_ed25519_key } + ssh-keygen -N "" -t ed25519 -f /etc/ssh/ssh_host_ed25519_key +m644 +/ssh_host_rsa_key d m755 +/ssh_host_rsa_key/dependencies +CN hostname + root-writable +m644 +/ssh_host_rsa_key/type cN oneshot m644 +/ssh_host_rsa_key/up +CN if -n -t { s6-test -f /etc/ssh/ssh_host_rsa_key } + ssh-keygen -N "" -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key +m644 +/swap d m755 +/swap/down cN swapoff -a m644 +/swap/type cN oneshot m644 +/swap/up cN swapon -a m644 +/tty1 d m755 +/tty1/dependencies cN ok-sysinit m644 +/tty1/finish +CN #!/command/execlineb -P + redirfd -w 1 /dev/tty1 + fdmove -c 2 1 + foreground { s6-echo "\nwaiting for session cleanup" } + flock /run/ttylock/tty1 true +m755 +/tty1/run +CN #!/command/execlineb -P + getpid SERVICE_PID + foreground { + importas -i SERVICE_PID SERVICE_PID + if { test -d /run/cgroup2 } + if { mkdir -p /run/cgroup2/s6-rc/tty1 } + redirfd -w 1 /run/cgroup2/s6-rc/tty1/cgroup.procs + printf "%s" ${SERVICE_PID} + } + unexport SERVICE_PID + + env LOGIN_TTY=/dev/tty1 /sbin/getty 38400 tty1 linux +m755 +/tty1/type cN longrun m644 +/tty2 d m755 +/tty2/dependencies cN ok-sysinit m644 +/tty2/finish +CN #!/command/execlineb -P + redirfd -w 1 /dev/tty2 + fdmove -c 2 1 + foreground { s6-echo "\nwaiting for session cleanup" } + flock /run/ttylock/tty2 true +m755 +/tty2/run +CN #!/command/execlineb -P + getpid SERVICE_PID + foreground { + importas -i SERVICE_PID SERVICE_PID + if { test -d /run/cgroup2 } + if { mkdir -p /run/cgroup2/s6-rc/tty2 } + redirfd -w 1 /run/cgroup2/s6-rc/tty2/cgroup.procs + printf "%s" ${SERVICE_PID} + } + unexport SERVICE_PID + + env LOGIN_TTY=/dev/tty2 /sbin/getty 38400 tty2 linux +m755 +/tty2/type cN longrun m644 +/tty3 d m755 +/tty3/dependencies cN ok-sysinit m644 +/tty3/finish +CN #!/command/execlineb -P + redirfd -w 1 /dev/tty3 + fdmove -c 2 1 + foreground { s6-echo "\nwaiting for session cleanup" } + flock /run/ttylock/tty3 true +m755 +/tty3/run +CN #!/command/execlineb -P + getpid SERVICE_PID + foreground { + importas -i SERVICE_PID SERVICE_PID + if { test -d /run/cgroup2 } + if { mkdir -p /run/cgroup2/s6-rc/tty3 } + redirfd -w 1 /run/cgroup2/s6-rc/tty3/cgroup.procs + printf "%s" ${SERVICE_PID} + } + unexport SERVICE_PID + + env LOGIN_TTY=/dev/tty3 /sbin/getty 38400 tty3 linux +m755 +/tty3/type cN longrun m644 +/tty4 d m755 +/tty4/dependencies cN ok-sysinit m644 +/tty4/finish +CN #!/command/execlineb -P + redirfd -w 1 /dev/tty4 + fdmove -c 2 1 + foreground { s6-echo "\nwaiting for session cleanup" } + flock /run/ttylock/tty4 true +m755 +/tty4/run +CN #!/command/execlineb -P + getpid SERVICE_PID + foreground { + importas -i SERVICE_PID SERVICE_PID + if { test -d /run/cgroup2 } + if { mkdir -p /run/cgroup2/s6-rc/tty4 } + redirfd -w 1 /run/cgroup2/s6-rc/tty4/cgroup.procs + printf "%s" ${SERVICE_PID} + } + unexport SERVICE_PID + + env LOGIN_TTY=/dev/tty4 /sbin/getty 38400 tty4 linux +m755 +/tty4/type cN longrun m644 +/unbound d m755 +/unbound/dependencies +CN loopback + ok-mount + ok-sysinit +m644 +/unbound/run +CN #!/command/execlineb -P + getpid SERVICE_PID + foreground { + importas -i SERVICE_PID SERVICE_PID + if { test -d /run/cgroup2 } + if { mkdir -p /run/cgroup2/s6-rc/unbound } + redirfd -w 1 /run/cgroup2/s6-rc/unbound/cgroup.procs + printf "%s" ${SERVICE_PID} + } + unexport SERVICE_PID + + unbound -d +m755 +/unbound/type cN longrun m644 +|} diff --git a/s6-rc.awk b/s6-rc.awk @@ -0,0 +1,343 @@ +BEGIN{ +printf "%s", "/ d m755\n" +printf "%s", "/dhcpcd d m755\n" +printf "%s", "/dhcpcd/dependencies\n" +printf "%s", "CN modules\n" +printf "%s", " ok-mount\n" +printf "%s", " ok-sysinit\n" +printf "%s", "m644\n" +printf "%s", "/dhcpcd/run\n" +printf "%s", "CN #!/command/execlineb -P\n" +printf "%s", " getpid SERVICE_PID\n" +printf "%s", " foreground {\n" +printf "%s", " importas -i SERVICE_PID SERVICE_PID\n" +printf "%s", " if { test -d /run/cgroup2 }\n" +printf "%s", " if { mkdir -p /run/cgroup2/s6-rc/dhcpcd }\n" +printf "%s", " redirfd -w 1 /run/cgroup2/s6-rc/dhcpcd/cgroup.procs\n" +printf "%s", " printf \"%s\" ${SERVICE_PID}\n" +printf "%s", " }\n" +printf "%s", " unexport SERVICE_PID\n" +printf "%s", " \n" +printf "%s", " dhcpcd --nobackground\n" +printf "%s", "m755\n" +printf "%s", "/dhcpcd/type cN longrun m644\n" +printf "%s", "/dmesg d m755\n" +printf "%s", "/dmesg/type cN oneshot m644\n" +printf "%s", "/dmesg/up\n" +printf "%s", "CN # description=\"Set the dmesg level for a cleaner boot\"\n" +printf "%s", " # dmesg_level=1\n" +printf "%s", " dmesg -n1\n" +printf "%s", "m755\n" +printf "%s", "/gettys d m755\n" +printf "%s", "/gettys/contents\n" +printf "%s", "CN tty1\n" +printf "%s", " tty3\n" +printf "%s", " tty2\n" +printf "%s", " tty4\n" +printf "%s", "m644\n" +printf "%s", "/gettys/type cN bundle m644\n" +printf "%s", "/hostname d m755\n" +printf "%s", "/hostname/type cN oneshot m644\n" +printf "%s", "/hostname/up cN hostname -F /etc/hostname m755\n" +printf "%s", "/kbd_mode d m755\n" +printf "%s", "/kbd_mode/contents\n" +printf "%s", "CN kbd_mode-tty1\n" +printf "%s", " kbd_mode-tty2\n" +printf "%s", " kbd_mode-tty3\n" +printf "%s", " kbd_mode-tty4\n" +printf "%s", " kbd_mode-tty9\n" +printf "%s", " kbd_mode-tty10\n" +printf "%s", " kbd_mode-tty11\n" +printf "%s", " kbd_mode-tty12\n" +printf "%s", "m644\n" +printf "%s", "/kbd_mode-tty1 d m755\n" +printf "%s", "/kbd_mode-tty1/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty1/up cN kbd_mode -u -C /dev/tty1 m644\n" +printf "%s", "/kbd_mode-tty10 d m755\n" +printf "%s", "/kbd_mode-tty10/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty10/up cN kbd_mode -u -C /dev/tty10 m644\n" +printf "%s", "/kbd_mode-tty11 d m755\n" +printf "%s", "/kbd_mode-tty11/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty11/up cN kbd_mode -u -C /dev/tty11 m644\n" +printf "%s", "/kbd_mode-tty12 d m755\n" +printf "%s", "/kbd_mode-tty12/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty12/up cN kbd_mode -u -C /dev/tty12 m644\n" +printf "%s", "/kbd_mode-tty2 d m755\n" +printf "%s", "/kbd_mode-tty2/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty2/up cN kbd_mode -u -C /dev/tty2 m644\n" +printf "%s", "/kbd_mode-tty3 d m755\n" +printf "%s", "/kbd_mode-tty3/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty3/up cN kbd_mode -u -C /dev/tty3 m644\n" +printf "%s", "/kbd_mode-tty4 d m755\n" +printf "%s", "/kbd_mode-tty4/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty4/up cN kbd_mode -u -C /dev/tty4 m644\n" +printf "%s", "/kbd_mode-tty5 d m755\n" +printf "%s", "/kbd_mode-tty5/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty5/up cN kbd_mode -u -C /dev/tty5 m644\n" +printf "%s", "/kbd_mode-tty6 d m755\n" +printf "%s", "/kbd_mode-tty6/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty6/up cN kbd_mode -u -C /dev/tty6 m644\n" +printf "%s", "/kbd_mode-tty7 d m755\n" +printf "%s", "/kbd_mode-tty7/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty7/up cN kbd_mode -u -C /dev/tty7 m644\n" +printf "%s", "/kbd_mode-tty8 d m755\n" +printf "%s", "/kbd_mode-tty8/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty8/up cN kbd_mode -u -C /dev/tty8 m644\n" +printf "%s", "/kbd_mode-tty9 d m755\n" +printf "%s", "/kbd_mode-tty9/type cN oneshot m644\n" +printf "%s", "/kbd_mode-tty9/up cN kbd_mode -u -C /dev/tty9 m644\n" +printf "%s", "/kbd_mode/type cN bundle m644\n" +printf "%s", "/loadkeys d m755\n" +printf "%s", "/loadkeys/dependencies cN kbd_mode m644\n" +printf "%s", "/loadkeys/type cN oneshot m644\n" +printf "%s", "/loadkeys/up cN loadkeys --unicode /root/keymap m644\n" +printf "%s", "/loopback d m755\n" +printf "%s", "/loopback/type cN oneshot m644\n" +printf "%s", "/loopback/up\n" +printf "%s", "CN if { ip link set lo up }\n" +printf "%s", " if -nt { ip addr add 127.0.0.1/8 dev lo brd + }\n" +printf "%s", " pipeline { ip addr show dev lo } grep -q \"inet 127\\\\.0\\\\.0\\\\.1\"\n" +printf "%s", "m755\n" +printf "%s", "/modules d m755\n" +printf "%s", "/modules/dependencies cN dmesg m644\n" +printf "%s", "/modules/type cN oneshot m644\n" +printf "%s", "/modules/up\n" +printf "%s", "CN foreground { modprobe fuse }\n" +printf "%s", " foreground { modprobe overlay }\n" +printf "%s", " foreground { modprobe tun }\n" +printf "%s", " foreground { modprobe e1000 }\n" +printf "%s", " foreground { modprobe vmxnet3 }\n" +printf "%s", " foreground { modprobe virtio_pci }\n" +printf "%s", " foreground { modprobe virtio_net }\n" +printf "%s", "m755\n" +printf "%s", "/net-all d m755\n" +printf "%s", "/net-all/contents\n" +printf "%s", "CN dhcpcd\n" +printf "%s", " unbound\n" +printf "%s", " loopback\n" +printf "%s", "m644\n" +printf "%s", "/net-all/type cN bundle m644\n" +printf "%s", "/ok-all d m755\n" +printf "%s", "/ok-all-but-tty d m755\n" +printf "%s", "/ok-all-but-tty/contents\n" +printf "%s", "CN ok-mount\n" +printf "%s", " net-all\n" +printf "%s", " setfont\n" +printf "%s", " dmesg\n" +printf "%s", " hostname\n" +printf "%s", " modules\n" +printf "%s", " sshd\n" +printf "%s", "m644\n" +printf "%s", "/ok-all-but-tty/type cN bundle m644\n" +printf "%s", "/ok-all/contents\n" +printf "%s", "CN ok-all-but-tty\n" +printf "%s", " gettys\n" +printf "%s", "m644\n" +printf "%s", "/ok-all/type cN bundle m644\n" +printf "%s", "/ok-mount d m755\n" +printf "%s", "/ok-mount/contents\n" +printf "%s", "CN ok-sysinit\n" +printf "%s", " ok-localmount\n" +printf "%s", "m644\n" +printf "%s", "/ok-mount/type cN bundle m644\n" +printf "%s", "/openrc d m755\n" +printf "%s", "/openrc/dependencies\n" +printf "%s", "CN ok-sysinit\n" +printf "%s", " ok-mount\n" +printf "%s", " modules\n" +printf "%s", "m644\n" +printf "%s", "/openrc/down\n" +printf "%s", "CN export TERM \"linux\"\n" +printf "%s", " /sbin/openrc shutdown\n" +printf "%s", "m644\n" +printf "%s", "/openrc/type cN oneshot m644\n" +printf "%s", "/openrc/up\n" +printf "%s", "CN export TERM \"linux\"\n" +printf "%s", " foreground { /sbin/openrc boot }\n" +printf "%s", " /sbin/openrc default\n" +printf "%s", "m644\n" +printf "%s", "/.scripts d m755\n" +printf "%s", "/setfont d m755\n" +printf "%s", "/setfont/contents\n" +printf "%s", "CN setfont-tty1\n" +printf "%s", " setfont-tty2\n" +printf "%s", " setfont-tty3\n" +printf "%s", " setfont-tty4\n" +printf "%s", "m644\n" +printf "%s", "/setfont-tty1 d m755\n" +printf "%s", "/setfont-tty1/type cN oneshot m644\n" +printf "%s", "/setfont-tty1/up cN redirfd -r 0 /dev/tty1 setfont ter-v14n m644\n" +printf "%s", "/setfont-tty2 d m755\n" +printf "%s", "/setfont-tty2/type cN oneshot m644\n" +printf "%s", "/setfont-tty2/up cN redirfd -r 0 /dev/tty2 setfont ter-v14n m644\n" +printf "%s", "/setfont-tty3 d m755\n" +printf "%s", "/setfont-tty3/type cN oneshot m644\n" +printf "%s", "/setfont-tty3/up cN redirfd -r 0 /dev/tty3 setfont ter-v14n m644\n" +printf "%s", "/setfont-tty4 d m755\n" +printf "%s", "/setfont-tty4/type cN oneshot m644\n" +printf "%s", "/setfont-tty4/up cN redirfd -r 0 /dev/tty4 setfont ter-v14n m644\n" +printf "%s", "/setfont/type cN bundle m644\n" +printf "%s", "/sshd d m755\n" +printf "%s", "/sshd/dependencies\n" +printf "%s", "CN ssh_host_ed25519_key\n" +printf "%s", " ssh_host_rsa_key\n" +printf "%s", " ok-sysinit\n" +printf "%s", "m644\n" +printf "%s", "/sshd/run\n" +printf "%s", "CN #!/command/execlineb -P\n" +printf "%s", " fdmove -c 2 1\n" +printf "%s", " getpid SERVICE_PID\n" +printf "%s", " foreground {\n" +printf "%s", " importas -i SERVICE_PID SERVICE_PID\n" +printf "%s", " if { test -d /run/cgroup2 }\n" +printf "%s", " if { mkdir -p /run/cgroup2/s6-rc/sshd }\n" +printf "%s", " redirfd -w 1 /run/cgroup2/s6-rc/sshd/cgroup.procs\n" +printf "%s", " printf \"%s\" ${SERVICE_PID}\n" +printf "%s", " }\n" +printf "%s", " unexport SERVICE_PID\n" +printf "%s", " \n" +printf "%s", " /usr/sbin/sshd -D -f /etc/ssh/sshd_config\n" +printf "%s", "m755\n" +printf "%s", "/sshd/type cN longrun m644\n" +printf "%s", "/ssh_host_ed25519_key d m755\n" +printf "%s", "/ssh_host_ed25519_key/dependencies\n" +printf "%s", "CN hostname\n" +printf "%s", " root-writable\n" +printf "%s", "m644\n" +printf "%s", "/ssh_host_ed25519_key/type cN oneshot m644\n" +printf "%s", "/ssh_host_ed25519_key/up\n" +printf "%s", "CN if -n -t { s6-test -f /etc/ssh/ssh_host_ed25519_key }\n" +printf "%s", " ssh-keygen -N \"\" -t ed25519 -f /etc/ssh/ssh_host_ed25519_key\n" +printf "%s", "m644\n" +printf "%s", "/ssh_host_rsa_key d m755\n" +printf "%s", "/ssh_host_rsa_key/dependencies\n" +printf "%s", "CN hostname\n" +printf "%s", " root-writable\n" +printf "%s", "m644\n" +printf "%s", "/ssh_host_rsa_key/type cN oneshot m644\n" +printf "%s", "/ssh_host_rsa_key/up\n" +printf "%s", "CN if -n -t { s6-test -f /etc/ssh/ssh_host_rsa_key }\n" +printf "%s", " ssh-keygen -N \"\" -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key\n" +printf "%s", "m644\n" +printf "%s", "/swap d m755\n" +printf "%s", "/swap/down cN swapoff -a m644\n" +printf "%s", "/swap/type cN oneshot m644\n" +printf "%s", "/swap/up cN swapon -a m644\n" +printf "%s", "/tty1 d m755\n" +printf "%s", "/tty1/dependencies cN ok-sysinit m644\n" +printf "%s", "/tty1/finish\n" +printf "%s", "CN #!/command/execlineb -P\n" +printf "%s", " redirfd -w 1 /dev/tty1\n" +printf "%s", " fdmove -c 2 1\n" +printf "%s", " foreground { s6-echo \"\\nwaiting for session cleanup\" }\n" +printf "%s", " flock /run/ttylock/tty1 true\n" +printf "%s", "m755\n" +printf "%s", "/tty1/run\n" +printf "%s", "CN #!/command/execlineb -P\n" +printf "%s", " getpid SERVICE_PID\n" +printf "%s", " foreground {\n" +printf "%s", " importas -i SERVICE_PID SERVICE_PID\n" +printf "%s", " if { test -d /run/cgroup2 }\n" +printf "%s", " if { mkdir -p /run/cgroup2/s6-rc/tty1 }\n" +printf "%s", " redirfd -w 1 /run/cgroup2/s6-rc/tty1/cgroup.procs\n" +printf "%s", " printf \"%s\" ${SERVICE_PID}\n" +printf "%s", " }\n" +printf "%s", " unexport SERVICE_PID\n" +printf "%s", " \n" +printf "%s", " env LOGIN_TTY=/dev/tty1 /sbin/getty 38400 tty1 linux\n" +printf "%s", "m755\n" +printf "%s", "/tty1/type cN longrun m644\n" +printf "%s", "/tty2 d m755\n" +printf "%s", "/tty2/dependencies cN ok-sysinit m644\n" +printf "%s", "/tty2/finish\n" +printf "%s", "CN #!/command/execlineb -P\n" +printf "%s", " redirfd -w 1 /dev/tty2\n" +printf "%s", " fdmove -c 2 1\n" +printf "%s", " foreground { s6-echo \"\\nwaiting for session cleanup\" }\n" +printf "%s", " flock /run/ttylock/tty2 true\n" +printf "%s", "m755\n" +printf "%s", "/tty2/run\n" +printf "%s", "CN #!/command/execlineb -P\n" +printf "%s", " getpid SERVICE_PID\n" +printf "%s", " foreground {\n" +printf "%s", " importas -i SERVICE_PID SERVICE_PID\n" +printf "%s", " if { test -d /run/cgroup2 }\n" +printf "%s", " if { mkdir -p /run/cgroup2/s6-rc/tty2 }\n" +printf "%s", " redirfd -w 1 /run/cgroup2/s6-rc/tty2/cgroup.procs\n" +printf "%s", " printf \"%s\" ${SERVICE_PID}\n" +printf "%s", " }\n" +printf "%s", " unexport SERVICE_PID\n" +printf "%s", " \n" +printf "%s", " env LOGIN_TTY=/dev/tty2 /sbin/getty 38400 tty2 linux\n" +printf "%s", "m755\n" +printf "%s", "/tty2/type cN longrun m644\n" +printf "%s", "/tty3 d m755\n" +printf "%s", "/tty3/dependencies cN ok-sysinit m644\n" +printf "%s", "/tty3/finish\n" +printf "%s", "CN #!/command/execlineb -P\n" +printf "%s", " redirfd -w 1 /dev/tty3\n" +printf "%s", " fdmove -c 2 1\n" +printf "%s", " foreground { s6-echo \"\\nwaiting for session cleanup\" }\n" +printf "%s", " flock /run/ttylock/tty3 true\n" +printf "%s", "m755\n" +printf "%s", "/tty3/run\n" +printf "%s", "CN #!/command/execlineb -P\n" +printf "%s", " getpid SERVICE_PID\n" +printf "%s", " foreground {\n" +printf "%s", " importas -i SERVICE_PID SERVICE_PID\n" +printf "%s", " if { test -d /run/cgroup2 }\n" +printf "%s", " if { mkdir -p /run/cgroup2/s6-rc/tty3 }\n" +printf "%s", " redirfd -w 1 /run/cgroup2/s6-rc/tty3/cgroup.procs\n" +printf "%s", " printf \"%s\" ${SERVICE_PID}\n" +printf "%s", " }\n" +printf "%s", " unexport SERVICE_PID\n" +printf "%s", " \n" +printf "%s", " env LOGIN_TTY=/dev/tty3 /sbin/getty 38400 tty3 linux\n" +printf "%s", "m755\n" +printf "%s", "/tty3/type cN longrun m644\n" +printf "%s", "/tty4 d m755\n" +printf "%s", "/tty4/dependencies cN ok-sysinit m644\n" +printf "%s", "/tty4/finish\n" +printf "%s", "CN #!/command/execlineb -P\n" +printf "%s", " redirfd -w 1 /dev/tty4\n" +printf "%s", " fdmove -c 2 1\n" +printf "%s", " foreground { s6-echo \"\\nwaiting for session cleanup\" }\n" +printf "%s", " flock /run/ttylock/tty4 true\n" +printf "%s", "m755\n" +printf "%s", "/tty4/run\n" +printf "%s", "CN #!/command/execlineb -P\n" +printf "%s", " getpid SERVICE_PID\n" +printf "%s", " foreground {\n" +printf "%s", " importas -i SERVICE_PID SERVICE_PID\n" +printf "%s", " if { test -d /run/cgroup2 }\n" +printf "%s", " if { mkdir -p /run/cgroup2/s6-rc/tty4 }\n" +printf "%s", " redirfd -w 1 /run/cgroup2/s6-rc/tty4/cgroup.procs\n" +printf "%s", " printf \"%s\" ${SERVICE_PID}\n" +printf "%s", " }\n" +printf "%s", " unexport SERVICE_PID\n" +printf "%s", " \n" +printf "%s", " env LOGIN_TTY=/dev/tty4 /sbin/getty 38400 tty4 linux\n" +printf "%s", "m755\n" +printf "%s", "/tty4/type cN longrun m644\n" +printf "%s", "/unbound d m755\n" +printf "%s", "/unbound/dependencies\n" +printf "%s", "CN loopback\n" +printf "%s", " ok-mount\n" +printf "%s", " ok-sysinit\n" +printf "%s", "m644\n" +printf "%s", "/unbound/run\n" +printf "%s", "CN #!/command/execlineb -P\n" +printf "%s", " getpid SERVICE_PID\n" +printf "%s", " foreground {\n" +printf "%s", " importas -i SERVICE_PID SERVICE_PID\n" +printf "%s", " if { test -d /run/cgroup2 }\n" +printf "%s", " if { mkdir -p /run/cgroup2/s6-rc/unbound }\n" +printf "%s", " redirfd -w 1 /run/cgroup2/s6-rc/unbound/cgroup.procs\n" +printf "%s", " printf \"%s\" ${SERVICE_PID}\n" +printf "%s", " }\n" +printf "%s", " unexport SERVICE_PID\n" +printf "%s", " \n" +printf "%s", " unbound -d\n" +printf "%s", "m755\n" +printf "%s", "/unbound/type cN longrun m644\n" +} diff --git a/s6-rc.fileset b/s6-rc.fileset @@ -1,10 +1,122 @@ -/ d o0:0 m755 -/dhcpcd d o0:0 m755 +/rootfs d m755 +/rootfs/down cN s6-mount -o remount,ro "/" m644 +/rootfs/type cN oneshot m644 +/rootfs/up +CN # mount LABEL="INSTALL_ROOT" on / + if -n -t { s6-mount -t "xfs" -o "remount,rw,noatime" "LABEL=\"INSTALL_ROOT\"" "/" } + s6-mount -t "xfs" -o "rw,noatime" "LABEL=\"INSTALL_ROOT\"" "/" +/mount-sys d m755 +/mount-sys/dependencies +CN rootfs + +m644 +/mount-sys/type cN oneshot m644 +/mount-sys/up +CN # mount sysfs on /sys + if { mkdir -p "/sys" } + if -n -t { s6-mount -t "sysfs" -o "remount,rw" "sysfs" "/sys" } + s6-mount -t "sysfs" -o "rw" "sysfs" "/sys" +/mount-proc d m755 +/mount-proc/dependencies +CN rootfs + +m644 +/mount-proc/type cN oneshot m644 +/mount-proc/up +CN # mount proc on /proc + if { mkdir -p "/proc" } + if -n -t { s6-mount -t "proc" -o "remount,rw" "proc" "/proc" } + s6-mount -t "proc" -o "rw" "proc" "/proc" +/mount-dev d m755 +/mount-dev/dependencies +CN rootfs + +m644 +/mount-dev/type cN oneshot m644 +/mount-dev/up +CN # mount dev on /dev + if { mkdir -p "/dev" } + if -n -t { s6-mount -t "devtmpfs" -o "remount,rw,nosuid" "dev" "/dev" } + s6-mount -t "devtmpfs" -o "rw,nosuid" "dev" "/dev" +/mount-dev-pts d m755 +/mount-dev-pts/dependencies +CN mount-dev + +m644 +/mount-dev-pts/type cN oneshot m644 +/mount-dev-pts/up +CN # mount devpts on /dev/pts + if { mkdir -p "/dev/pts" } + if -n -t { s6-mount -t "devpts" -o "remount,rw,relatime,mode=600,ptmxmode=000" "devpts" "/dev/pts" } + s6-mount -t "devpts" -o "rw,relatime,mode=600,ptmxmode=000" "devpts" "/dev/pts" +/mount-dev-shm d m755 +/mount-dev-shm/dependencies +CN mount-dev + +m644 +/mount-dev-shm/type cN oneshot m644 +/mount-dev-shm/up +CN # mount shm on /dev/shm + if { mkdir -p "/dev/shm" } + if -n -t { s6-mount -t "tmpfs" -o "remount,rw,nosuid,nodev,relatime" "shm" "/dev/shm" } + s6-mount -t "tmpfs" -o "rw,nosuid,nodev,relatime" "shm" "/dev/shm" +/mount-dev-mqueue d m755 +/mount-dev-mqueue/dependencies +CN mount-dev + +m644 +/mount-dev-mqueue/type cN oneshot m644 +/mount-dev-mqueue/up +CN # mount mqueue on /dev/mqueue + if { mkdir -p "/dev/mqueue" } + if -n -t { s6-mount -t "mqueue" -o "remount,rw,nosuid,nodev,noexec" "mqueue" "/dev/mqueue" } + s6-mount -t "mqueue" -o "rw,nosuid,nodev,noexec" "mqueue" "/dev/mqueue" +/mount-run-cgroup2 d m755 +/mount-run-cgroup2/down cN s6-umount "/run/cgroup2" m644 +/mount-run-cgroup2/type cN oneshot m644 +/mount-run-cgroup2/up +CN # mount none on /run/cgroup2 + if { mkdir -p "/run/cgroup2" } + if -n -t { s6-mount -t "cgroup2" -o "remount,rw" "none" "/run/cgroup2" } + s6-mount -t "cgroup2" -o "rw" "none" "/run/cgroup2" +/mount-boot d m755 +/mount-boot/dependencies +CN rootfs + +m644 +/mount-boot/down cN s6-umount "/boot" m644 +/mount-boot/type cN oneshot m644 +/mount-boot/up +CN # mount LABEL="SPARK_BOOT" on /boot + if { mkdir -p "/boot" } + if -n -t { s6-mount -t "ext2" -o "remount,ro,noatime" "LABEL=\"SPARK_BOOT\"" "/boot" } + s6-mount -t "ext2" -o "ro,noatime" "LABEL=\"SPARK_BOOT\"" "/boot" +/ok-sysinit d m755 +/ok-sysinit/contents +CN mount-sys + mount-proc + mount-dev + mount-dev-pts + mount-dev-shm + mount-dev-mqueue + mount-run-cgroup2 + +m644 +/ok-sysinit/type cN bundle m644 +/ok-localmount d m755 +/ok-localmount/contents +CN rootfs + mount-boot + +m644 +/ok-localmount/type cN bundle m644 +/ d m755 +/dhcpcd d m755 /dhcpcd/dependencies CN modules ok-mount ok-sysinit -o0:0 m644 +m644 /dhcpcd/run CN #!/command/execlineb -P getpid SERVICE_PID @@ -18,29 +130,27 @@ CN #!/command/execlineb -P unexport SERVICE_PID dhcpcd --nobackground -o0:0 m755 -/dhcpcd/type cN longrun o0:0 m644 -/dmesg d o0:0 m755 -/dmesg/type cN oneshot o0:0 m644 +m755 +/dhcpcd/type cN longrun m644 +/dmesg d m755 +/dmesg/type cN oneshot m644 /dmesg/up CN # description="Set the dmesg level for a cleaner boot" # dmesg_level=1 dmesg -n1 -o0:0 m755 -/gettys d o0:0 m755 +m755 +/gettys d m755 /gettys/contents CN tty1 tty3 tty2 tty4 -o0:0 m644 -/gettys/type cN bundle o0:0 m644 -/.git cN gitdir: ../.git/modules/carbon-s6-rc o0:0 m644 -/.gitignore cN .*.sw[po] o0:0 m644 -/hostname d o0:0 m755 -/hostname/type cN oneshot o0:0 m644 -/hostname/up cN hostname -F /etc/hostname o0:0 m755 -/kbd_mode d o0:0 m755 +m644 +/gettys/type cN bundle m644 +/hostname d m755 +/hostname/type cN oneshot m644 +/hostname/up cN hostname -F /etc/hostname m755 +/kbd_mode d m755 /kbd_mode/contents CN kbd_mode-tty1 kbd_mode-tty2 @@ -50,72 +160,58 @@ CN kbd_mode-tty1 kbd_mode-tty10 kbd_mode-tty11 kbd_mode-tty12 -o0:0 m644 -/kbd_mode-tty1 d o0:0 m755 -/kbd_mode-tty1/type cN oneshot o0:0 m644 -/kbd_mode-tty1/up cN kbd_mode -u -C /dev/tty1 o0:0 m644 -/kbd_mode-tty10 d o0:0 m755 -/kbd_mode-tty10/type cN oneshot o0:0 m644 -/kbd_mode-tty10/up cN kbd_mode -u -C /dev/tty10 o0:0 m644 -/kbd_mode-tty11 d o0:0 m755 -/kbd_mode-tty11/type cN oneshot o0:0 m644 -/kbd_mode-tty11/up cN kbd_mode -u -C /dev/tty11 o0:0 m644 -/kbd_mode-tty12 d o0:0 m755 -/kbd_mode-tty12/type cN oneshot o0:0 m644 -/kbd_mode-tty12/up cN kbd_mode -u -C /dev/tty12 o0:0 m644 -/kbd_mode-tty2 d o0:0 m755 -/kbd_mode-tty2/type cN oneshot o0:0 m644 -/kbd_mode-tty2/up cN kbd_mode -u -C /dev/tty2 o0:0 m644 -/kbd_mode-tty3 d o0:0 m755 -/kbd_mode-tty3/type cN oneshot o0:0 m644 -/kbd_mode-tty3/up cN kbd_mode -u -C /dev/tty3 o0:0 m644 -/kbd_mode-tty4 d o0:0 m755 -/kbd_mode-tty4/type cN oneshot o0:0 m644 -/kbd_mode-tty4/up cN kbd_mode -u -C /dev/tty4 o0:0 m644 -/kbd_mode-tty5 d o0:0 m755 -/kbd_mode-tty5/type cN oneshot o0:0 m644 -/kbd_mode-tty5/up cN kbd_mode -u -C /dev/tty5 o0:0 m644 -/kbd_mode-tty6 d o0:0 m755 -/kbd_mode-tty6/type cN oneshot o0:0 m644 -/kbd_mode-tty6/up cN kbd_mode -u -C /dev/tty6 o0:0 m644 -/kbd_mode-tty7 d o0:0 m755 -/kbd_mode-tty7/type cN oneshot o0:0 m644 -/kbd_mode-tty7/up cN kbd_mode -u -C /dev/tty7 o0:0 m644 -/kbd_mode-tty8 d o0:0 m755 -/kbd_mode-tty8/type cN oneshot o0:0 m644 -/kbd_mode-tty8/up cN kbd_mode -u -C /dev/tty8 o0:0 m644 -/kbd_mode-tty9 d o0:0 m755 -/kbd_mode-tty9/type cN oneshot o0:0 m644 -/kbd_mode-tty9/up cN kbd_mode -u -C /dev/tty9 o0:0 m644 -/kbd_mode/type cN bundle o0:0 m644 -/loadkeys d o0:0 m755 -/loadkeys/dependencies cN kbd_mode o0:0 m644 -/loadkeys/type cN oneshot o0:0 m644 -/loadkeys/up cN loadkeys --unicode /root/keymap o0:0 m644 -/localmount d o0:0 m755 -/localmount/dependencies -CN ok-sysinit - modules - root-writable -o0:0 m644 -/localmount/down -CN # umount all filesystems except specials, if possible - foreground { umount --all --verbose --detach-loop -t nodevtmpfs,noproc,nosysfs,nodevpts,nomqueue } - # remount the rest read-only, except for tmpfs - foreground { umount --all --read-only --verbose -t nodevtmpfs,noproc,nosysfs,nodevpts,nomqueue,notmpfs } -o0:0 m644 -/localmount/type cN oneshot o0:0 m644 -/localmount/up cN mount -at noproc -O no_netdev o0:0 m644 -/loopback d o0:0 m755 -/loopback/type cN oneshot o0:0 m644 +m644 +/kbd_mode-tty1 d m755 +/kbd_mode-tty1/type cN oneshot m644 +/kbd_mode-tty1/up cN kbd_mode -u -C /dev/tty1 m644 +/kbd_mode-tty10 d m755 +/kbd_mode-tty10/type cN oneshot m644 +/kbd_mode-tty10/up cN kbd_mode -u -C /dev/tty10 m644 +/kbd_mode-tty11 d m755 +/kbd_mode-tty11/type cN oneshot m644 +/kbd_mode-tty11/up cN kbd_mode -u -C /dev/tty11 m644 +/kbd_mode-tty12 d m755 +/kbd_mode-tty12/type cN oneshot m644 +/kbd_mode-tty12/up cN kbd_mode -u -C /dev/tty12 m644 +/kbd_mode-tty2 d m755 +/kbd_mode-tty2/type cN oneshot m644 +/kbd_mode-tty2/up cN kbd_mode -u -C /dev/tty2 m644 +/kbd_mode-tty3 d m755 +/kbd_mode-tty3/type cN oneshot m644 +/kbd_mode-tty3/up cN kbd_mode -u -C /dev/tty3 m644 +/kbd_mode-tty4 d m755 +/kbd_mode-tty4/type cN oneshot m644 +/kbd_mode-tty4/up cN kbd_mode -u -C /dev/tty4 m644 +/kbd_mode-tty5 d m755 +/kbd_mode-tty5/type cN oneshot m644 +/kbd_mode-tty5/up cN kbd_mode -u -C /dev/tty5 m644 +/kbd_mode-tty6 d m755 +/kbd_mode-tty6/type cN oneshot m644 +/kbd_mode-tty6/up cN kbd_mode -u -C /dev/tty6 m644 +/kbd_mode-tty7 d m755 +/kbd_mode-tty7/type cN oneshot m644 +/kbd_mode-tty7/up cN kbd_mode -u -C /dev/tty7 m644 +/kbd_mode-tty8 d m755 +/kbd_mode-tty8/type cN oneshot m644 +/kbd_mode-tty8/up cN kbd_mode -u -C /dev/tty8 m644 +/kbd_mode-tty9 d m755 +/kbd_mode-tty9/type cN oneshot m644 +/kbd_mode-tty9/up cN kbd_mode -u -C /dev/tty9 m644 +/kbd_mode/type cN bundle m644 +/loadkeys d m755 +/loadkeys/dependencies cN kbd_mode m644 +/loadkeys/type cN oneshot m644 +/loadkeys/up cN loadkeys --unicode /root/keymap m644 +/loopback d m755 +/loopback/type cN oneshot m644 /loopback/up CN if { ip link set lo up } if -nt { ip addr add 127.0.0.1/8 dev lo brd + } pipeline { ip addr show dev lo } grep -q "inet 127\\.0\\.0\\.1" -o0:0 m755 -/modules d o0:0 m755 -/modules/dependencies cN dmesg o0:0 m644 -/modules/type cN oneshot o0:0 m644 +m755 +/modules d m755 +/modules/dependencies cN dmesg m644 +/modules/type cN oneshot m644 /modules/up CN foreground { modprobe fuse } foreground { modprobe overlay } @@ -124,62 +220,16 @@ CN foreground { modprobe fuse } foreground { modprobe vmxnet3 } foreground { modprobe virtio_pci } foreground { modprobe virtio_net } -o0:0 m755 -/mount-dev d o0:0 m755 -/mount-dev/contents cN mount-devtmpfs o0:0 m644 -/mount-dev-mqueue d o0:0 m755 -/mount-dev-mqueue/dependencies cN mount-dev o0:0 m644 -/mount-dev-mqueue/down cN s6-umount /dev/mqueue o0:0 m644 -/mount-dev-mqueue/type cN oneshot o0:0 m644 -/mount-dev-mqueue/up cN sh -xc "mkdir -p /dev/mqueue || exit $?; mount -t mqueue mqueue /dev/mqueue -o remount,rw,nosuid,nodev,noexec || mount -t mqueue mqueue /dev/mqueue -o nosuid,nodev,noexec" o0:0 m644 -/mount-dev-pts d o0:0 m755 -/mount-dev-pts/dependencies cN mount-dev o0:0 m644 -/mount-dev-pts/down cN s6-umount /dev/pts o0:0 m644 -/mount-dev-pts/type cN oneshot o0:0 m644 -/mount-dev-pts/up cN sh -xc "mkdir -p /dev/pts || exit $?; mount -wt devpts devpts /dev/pts -o remount,rw,relatime,mode=600,ptmxmode=000 || exec mount -wt devpts devpts /dev/pts -o rw,relatime,mode=600,ptmxmode=000" o0:0 m644 -/mount-dev-shm d o0:0 m755 -/mount-dev-shm/dependencies cN mount-dev o0:0 m644 -/mount-dev-shm/down cN foreground { s6-umount /dev/shm } o0:0 m644 -/mount-dev-shm/type cN oneshot o0:0 m644 -/mount-dev-shm/up cN sh -xc "mount -wt tmpfs shm /dev/shm -o remount,rw,nosuid,nodev,relatime || exec mount -wt tmpfs shm /dev/shm -o rw,nosuid,nodev,relatime" o0:0 m644 -/mount-devtmpfs d o0:0 m755 -/mount-devtmpfs/down cN s6-umount /dev o0:0 m644 -/mount-devtmpfs/type cN oneshot o0:0 m644 -/mount-devtmpfs/up cN sh -xc "mount -wt devtmpfs dev /dev -o remount,nosuid || exec mount -wt devtmpfs dev /dev -o nosuid" o0:0 m644 -/mount-dev/type cN bundle o0:0 m644 -/mount-proc d o0:0 m755 -/mount-proc/down cN s6-umount /proc o0:0 m644 -/mount-proc/type cN oneshot o0:0 m644 -/mount-proc/up cN sh -xc "mount -wt proc proc /proc -o remount || mount -wt proc proc /proc" o0:0 m644 -/mount-run-cgroup2 d o0:0 m755 -/mount-run-cgroup2/down cN s6-umount /run/cgroup2 o0:0 m644 -/mount-run-cgroup2/type cN oneshot o0:0 m644 -/mount-run-cgroup2/up -CN if { mkdir /run/cgroup2 } - mount -t cgroup2 none /run/cgroup2 -o0:0 m644 -/mount-sys d o0:0 m755 -/mount-sys/down cN s6-umount /sys o0:0 m644 -/mount-sys/type cN oneshot o0:0 m644 -/mount-sys/up cN sh -xc "mount -wt sysfs sys /sys -o remount || exec mount -wt sysfs sys /sys" o0:0 m644 -/mount-tmp-X11 d o0:0 m755 -/mount-tmp-X11/down cN foreground { umount /tmp/.X11-unix } o0:0 m644 -/mount-tmp-X11/type cN oneshot o0:0 m644 -/mount-tmp-X11/up -CN if { mkdir -p /tmp/.X11-unix /run/X11 } - if { chmod 771 /run/X11 } - if { chown root:xorg /run/X11 } - mount --bind /run/X11 /tmp/.X11-unix -o0:0 m644 -/net-all d o0:0 m755 +m755 +/net-all d m755 /net-all/contents CN dhcpcd unbound loopback -o0:0 m644 -/net-all/type cN bundle o0:0 m644 -/ok-all d o0:0 m755 -/ok-all-but-tty d o0:0 m755 +m644 +/net-all/type cN bundle m644 +/ok-all d m755 +/ok-all-but-tty d m755 /ok-all-but-tty/contents CN ok-mount net-all @@ -188,78 +238,62 @@ CN ok-mount hostname modules sshd -o0:0 m644 -/ok-all-but-tty/type cN bundle o0:0 m644 +m644 +/ok-all-but-tty/type cN bundle m644 /ok-all/contents CN ok-all-but-tty gettys -o0:0 m644 -/ok-all/type cN bundle o0:0 m644 -/ok-mount d o0:0 m755 +m644 +/ok-all/type cN bundle m644 +/ok-mount d m755 /ok-mount/contents CN ok-sysinit - localmount - root-writable -o0:0 m644 -/ok-mount/type cN bundle o0:0 m644 -/ok-sysinit d o0:0 m755 -/ok-sysinit/contents -CN mount-dev - mount-dev-mqueue - mount-dev-pts - mount-dev-shm - mount-proc - mount-sys - mount-run-cgroup2 -o0:0 m644 -/ok-sysinit/type cN bundle o0:0 m644 -/openrc d o0:0 m755 + ok-localmount +m644 +/ok-mount/type cN bundle m644 +/openrc d m755 /openrc/dependencies CN ok-sysinit ok-mount modules -o0:0 m644 +m644 /openrc/down CN export TERM "linux" /sbin/openrc shutdown -o0:0 m644 -/openrc/type cN oneshot o0:0 m644 +m644 +/openrc/type cN oneshot m644 /openrc/up CN export TERM "linux" foreground { /sbin/openrc boot } /sbin/openrc default -o0:0 m644 -/root-writable d o0:0 m755 -/root-writable/down cN foreground { mount -o remount,ro / } o0:0 m644 -/root-writable/type cN oneshot o0:0 m644 -/root-writable/up cN mount -o remount,rw / o0:0 m644 -/.scripts d o0:0 m755 -/setfont d o0:0 m755 +m644 +/.scripts d m755 +/setfont d m755 /setfont/contents CN setfont-tty1 setfont-tty2 setfont-tty3 setfont-tty4 -o0:0 m644 -/setfont-tty1 d o0:0 m755 -/setfont-tty1/type cN oneshot o0:0 m644 -/setfont-tty1/up cN redirfd -r 0 /dev/tty1 setfont ter-v14n o0:0 m644 -/setfont-tty2 d o0:0 m755 -/setfont-tty2/type cN oneshot o0:0 m644 -/setfont-tty2/up cN redirfd -r 0 /dev/tty2 setfont ter-v14n o0:0 m644 -/setfont-tty3 d o0:0 m755 -/setfont-tty3/type cN oneshot o0:0 m644 -/setfont-tty3/up cN redirfd -r 0 /dev/tty3 setfont ter-v14n o0:0 m644 -/setfont-tty4 d o0:0 m755 -/setfont-tty4/type cN oneshot o0:0 m644 -/setfont-tty4/up cN redirfd -r 0 /dev/tty4 setfont ter-v14n o0:0 m644 -/setfont/type cN bundle o0:0 m644 -/sshd d o0:0 m755 +m644 +/setfont-tty1 d m755 +/setfont-tty1/type cN oneshot m644 +/setfont-tty1/up cN redirfd -r 0 /dev/tty1 setfont ter-v14n m644 +/setfont-tty2 d m755 +/setfont-tty2/type cN oneshot m644 +/setfont-tty2/up cN redirfd -r 0 /dev/tty2 setfont ter-v14n m644 +/setfont-tty3 d m755 +/setfont-tty3/type cN oneshot m644 +/setfont-tty3/up cN redirfd -r 0 /dev/tty3 setfont ter-v14n m644 +/setfont-tty4 d m755 +/setfont-tty4/type cN oneshot m644 +/setfont-tty4/up cN redirfd -r 0 /dev/tty4 setfont ter-v14n m644 +/setfont/type cN bundle m644 +/sshd d m755 /sshd/dependencies CN ssh_host_ed25519_key ssh_host_rsa_key ok-sysinit -o0:0 m644 +m644 /sshd/run CN #!/command/execlineb -P fdmove -c 2 1 @@ -274,41 +308,41 @@ CN #!/command/execlineb -P unexport SERVICE_PID /usr/sbin/sshd -D -f /etc/ssh/sshd_config -o0:0 m755 -/sshd/type cN longrun o0:0 m644 -/ssh_host_ed25519_key d o0:0 m755 +m755 +/sshd/type cN longrun m644 +/ssh_host_ed25519_key d m755 /ssh_host_ed25519_key/dependencies CN hostname root-writable -o0:0 m644 -/ssh_host_ed25519_key/type cN oneshot o0:0 m644 +m644 +/ssh_host_ed25519_key/type cN oneshot m644 /ssh_host_ed25519_key/up CN if -n -t { s6-test -f /etc/ssh/ssh_host_ed25519_key } ssh-keygen -N "" -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -o0:0 m644 -/ssh_host_rsa_key d o0:0 m755 +m644 +/ssh_host_rsa_key d m755 /ssh_host_rsa_key/dependencies CN hostname root-writable -o0:0 m644 -/ssh_host_rsa_key/type cN oneshot o0:0 m644 +m644 +/ssh_host_rsa_key/type cN oneshot m644 /ssh_host_rsa_key/up CN if -n -t { s6-test -f /etc/ssh/ssh_host_rsa_key } ssh-keygen -N "" -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -o0:0 m644 -/swap d o0:0 m755 -/swap/down cN swapoff -a o0:0 m644 -/swap/type cN oneshot o0:0 m644 -/swap/up cN swapon -a o0:0 m644 -/tty1 d o0:0 m755 -/tty1/dependencies cN ok-sysinit o0:0 m644 +m644 +/swap d m755 +/swap/down cN swapoff -a m644 +/swap/type cN oneshot m644 +/swap/up cN swapon -a m644 +/tty1 d m755 +/tty1/dependencies cN ok-sysinit m644 /tty1/finish CN #!/command/execlineb -P redirfd -w 1 /dev/tty1 fdmove -c 2 1 foreground { s6-echo "\nwaiting for session cleanup" } flock /run/ttylock/tty1 true -o0:0 m755 +m755 /tty1/run CN #!/command/execlineb -P getpid SERVICE_PID @@ -322,17 +356,17 @@ CN #!/command/execlineb -P unexport SERVICE_PID env LOGIN_TTY=/dev/tty1 /sbin/getty 38400 tty1 linux -o0:0 m755 -/tty1/type cN longrun o0:0 m644 -/tty2 d o0:0 m755 -/tty2/dependencies cN ok-sysinit o0:0 m644 +m755 +/tty1/type cN longrun m644 +/tty2 d m755 +/tty2/dependencies cN ok-sysinit m644 /tty2/finish CN #!/command/execlineb -P redirfd -w 1 /dev/tty2 fdmove -c 2 1 foreground { s6-echo "\nwaiting for session cleanup" } flock /run/ttylock/tty2 true -o0:0 m755 +m755 /tty2/run CN #!/command/execlineb -P getpid SERVICE_PID @@ -346,17 +380,17 @@ CN #!/command/execlineb -P unexport SERVICE_PID env LOGIN_TTY=/dev/tty2 /sbin/getty 38400 tty2 linux -o0:0 m755 -/tty2/type cN longrun o0:0 m644 -/tty3 d o0:0 m755 -/tty3/dependencies cN ok-sysinit o0:0 m644 +m755 +/tty2/type cN longrun m644 +/tty3 d m755 +/tty3/dependencies cN ok-sysinit m644 /tty3/finish CN #!/command/execlineb -P redirfd -w 1 /dev/tty3 fdmove -c 2 1 foreground { s6-echo "\nwaiting for session cleanup" } flock /run/ttylock/tty3 true -o0:0 m755 +m755 /tty3/run CN #!/command/execlineb -P getpid SERVICE_PID @@ -370,17 +404,17 @@ CN #!/command/execlineb -P unexport SERVICE_PID env LOGIN_TTY=/dev/tty3 /sbin/getty 38400 tty3 linux -o0:0 m755 -/tty3/type cN longrun o0:0 m644 -/tty4 d o0:0 m755 -/tty4/dependencies cN ok-sysinit o0:0 m644 +m755 +/tty3/type cN longrun m644 +/tty4 d m755 +/tty4/dependencies cN ok-sysinit m644 /tty4/finish CN #!/command/execlineb -P redirfd -w 1 /dev/tty4 fdmove -c 2 1 foreground { s6-echo "\nwaiting for session cleanup" } flock /run/ttylock/tty4 true -o0:0 m755 +m755 /tty4/run CN #!/command/execlineb -P getpid SERVICE_PID @@ -394,14 +428,14 @@ CN #!/command/execlineb -P unexport SERVICE_PID env LOGIN_TTY=/dev/tty4 /sbin/getty 38400 tty4 linux -o0:0 m755 -/tty4/type cN longrun o0:0 m644 -/unbound d o0:0 m755 +m755 +/tty4/type cN longrun m644 +/unbound d m755 /unbound/dependencies CN loopback ok-mount ok-sysinit -o0:0 m644 +m644 /unbound/run CN #!/command/execlineb -P getpid SERVICE_PID @@ -415,5 +449,5 @@ CN #!/command/execlineb -P unexport SERVICE_PID unbound -d -o0:0 m755 -/unbound/type cN longrun o0:0 m644 +m755 +/unbound/type cN longrun m644 diff --git a/s6-rc.fileset b/s6-rc.fileset.orig