carbon-config

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

commit e40daf604c30f2fa7197d116427e1cc2dfccc790
parent bd65d529fe883326569f08f333883123532da209
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Mon, 25 Jul 2022 17:51:48 +0200

Move build artifacts into build/, generate and install fstab.

Diffstat:
MMakefile | 41++++++++++++++++++++++++++++++-----------
Aconfig.aat | 0
Mfs | 3++-
Afstab.aat | 8++++++++
Mpostinstall | 32+++++++++++++++++++++++---------
Apostinstall.aat | 0
Apostinstall.fileset | 0
Ds6-rc-mount.awk | 336-------------------------------------------------------------------------------
Ds6-rc.awk | 343-------------------------------------------------------------------------------
Ms6-rc.fileset | 6+++---
Astatic/etc/fstab | 9+++++++++
11 files changed, 75 insertions(+), 703 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,18 +1,37 @@ -.PHONY: all +.PHONY: all clean -all: s6-rc.fileset +ALL_TARGETS:= s6-rc.fileset postinstall.fileset static/etc/fstab +all: $(ALL_TARGETS) -s6-rc-mount.awk: s6-rc-mount.aat parse_fs.include.awk - aat.awk s6-rc-mount.aat >"$@.new" - # sed -f aat_macros.sed +clean: + rm -rf build $(ALL_TARGETS) + +build/%.awk: %.aat + mkdir -p build + aat.awk "$<" >"$@.new" + aat_macros.sed -i "$@.new" + mv "$@.new" "$@" + +%.qawk: %.awk + query.awk "$<" >"$@.new" + mv "$@.new" "$@" + +build/s6-rc-mount.awk: s6-rc-mount.aat parse_fs.include.awk +build/fstab.awk: fstab.aat parse_fs.include.awk + +s6-rc.fileset: build/s6-rc.qawk build/s6-rc-mount.awk fs build/config + awk -f build/s6-rc-mount.awk fs >"$@.new" + awk -f build/s6-rc.qawk build/config /dev/null >>"$@.new" + mv "$@.new" "$@" + +static/etc/fstab: build/fstab.awk fs + awk -f build/fstab.awk fs >"$@.new" mv "$@.new" "$@" -s6-rc.awk: s6-rc.aat - aat.awk s6-rc.aat >"$@.new" - # sed -f aat_macros.sed +build/config: build/config.awk + awk -f "$<" </dev/null >"$@.new" 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" +postinstall.fileset: build/config build/postinstall.qawk + awk -f build/postinstall.qawk build/config >"$@.new" mv "$@.new" "$@" diff --git a/config.aat b/config.aat diff --git a/fs b/fs @@ -1,5 +1,6 @@ / - source=LABEL="SPARK_ROOT" + source=/dev/mapper/vg-spark_root + #source=LABEL="SPARK_ROOT" type=xfs options=rw,noatime premounted=true diff --git a/fstab.aat b/fstab.aat @@ -0,0 +1,8 @@ +|### write_oneshot ### +|function write_oneshot() { +{{get("source")}} {{mtp}} {{get("type")}} {{get("options")}} 0 0 +|} +|### write_bundle ### +|function write_bundle(name) { } +|### include main loop / parsing code ### +@awk parse_fs.include.awk diff --git a/postinstall b/postinstall @@ -44,6 +44,24 @@ ensure_symlink() { fi } +symlink_static_file() { + [[ $1 == /* ]] || die "symlink_static_file: requires absolute path" + local relative_base up rel1 rel2 + rel1=./static$1 + [[ -f $rel1 ]] || die111 "Cannot symlink: file does not exist: ${(qqq)rel1}" + relative_base=$1:h + until [[ ${${"$relative_base/$up"}:a} == / ]] ; do + up=../$up + done + rel2=$relative_base/$up/current/conf/static$1 + [[ $rel1:a == $rel2:a ]] || die "Directory mismatch" + + if [[ ! -L $1 && -f $1 ]]; then + mv $1 $1.orig.$EPOCHSECONDS || exit $? + fi + ensure_symlink $1 $up/current/conf/static$1 || return $? +} + link_changed() { local pre post pre=preinstall_link_$1 @@ -54,16 +72,12 @@ link_changed() { postinstall() { local diff_ret cd $ALL_DIR || exit $? + ensure_symlink /command current/command || return $? - if [[ ! -L /etc/hostname && -f /etc/hostname ]]; then - mv /etc/hostname{,.orig.$EPOCHSECONDS} || exit $? - fi - ensure_symlink /etc/hostname ../current/conf/static/etc/hostname || return $? - ensure_symlink /etc/profile.d/slashcommand.sh ../../current/conf/static/etc/profile.d/slashcommand.sh || return $? - if [[ ! -L /etc/mkinitfs/mkinitfs.conf && -f /etc/mkinitfs/mkinitfs.conf ]]; then - mv /etc/mkinitfs/mkinitfs.conf{,.orig.$EPOCHSECONDS} || exit $? - fi - ensure_symlink /etc/mkinitfs/mkinitfs.conf ../../current/conf/static/etc/mkinitfs/mkinitfs.conf || return $? + symlink_static_file /etc/hostname || return $? + symlink_static_file /etc/fstab || return $? + symlink_static_file /etc/profile.d/slashcommand.sh || return $? + symlink_static_file /etc/mkinitfs/mkinitfs.conf || return $? if [[ -d /run/s6-rc/ ]]; then diff -Ru $preinstall_current/s6-rc-source ./s6-rc-source; diff_ret=$? diff --git a/postinstall.aat b/postinstall.aat diff --git a/postinstall.fileset b/postinstall.fileset diff --git a/s6-rc-mount.awk b/s6-rc-mount.awk @@ -1,336 +0,0 @@ -### 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 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 { mount -t " (q_vfstype) " -o " (q_remount_options) " " (q_spec) " " (q_file) " }\n" -printf "%s", " 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.awk b/s6-rc.awk @@ -1,343 +0,0 @@ -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" -# setfont -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" -#/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 -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", " rootfs\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", " rootfs\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 @@ -2,9 +2,9 @@ /rootfs/down cN mount -o remount,ro "/" m644 /rootfs/type cN oneshot m644 /rootfs/up -CN # mount LABEL="SPARK_ROOT" on / - if -n -t { mount -t "xfs" -o "remount,rw,noatime" "LABEL=\"SPARK_ROOT\"" "/" } - mount -t "xfs" -o "rw,noatime" "LABEL=\"SPARK_ROOT\"" "/" +CN # mount /dev/mapper/vg-spark_root on / + if -n -t { mount -t "xfs" -o "remount,rw,noatime" "/dev/mapper/vg-spark_root" "/" } + mount -t "xfs" -o "rw,noatime" "/dev/mapper/vg-spark_root" "/" /mount-sys d m755 /mount-sys/dependencies CN rootfs diff --git a/static/etc/fstab b/static/etc/fstab @@ -0,0 +1,9 @@ +/dev/mapper/vg-spark_root / xfs rw,noatime 0 0 +sysfs /sys sysfs rw 0 0 +proc /proc proc rw 0 0 +dev /dev devtmpfs rw,nosuid 0 0 +devpts /dev/pts devpts rw,relatime,mode=600,ptmxmode=000 0 0 +shm /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0 +mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec 0 0 +none /run/cgroup2 cgroup2 rw 0 0 +/dev/sda1 /boot ext2 ro,noatime 0 0