commit e6759dc06ae149e36f92cab8e85b28d4f1734e9c
parent 9639186099c18ebd3be6d66cb98071374ef58275
Author: ccx <ccx@te2000.cz>
Date: Sat, 16 Mar 2024 21:36:33 +0000
regenerate packages
Diffstat:
4 files changed, 454 insertions(+), 0 deletions(-)
diff --git a/packages/system-config b/packages/system-config
@@ -0,0 +1,130 @@
+#!/usr/bin/env pthbs-build
+#+busybox.e60885fe93ee85c01831673bb29f0e62a64903f4ce3094e3dc35bc8ec8887ad9
+#+diffutils.fd5fae528e3d092e2e30271e8e273cd7fdecce4642547308ca3356e654c3990b
+#+gnu-make.782c9e6625fd7420e2cd38b847afed19db3b3844cae8a0426a0dbf73e10d78e5
+#+aat.e073f6b23349ea7153987ad737fc80f909241ae4a0c0a22adc12392fcad71597
+#+fileset.22d9abf3009dbbfe507bd7ff93fdd0bf7f86ee0bc317b37b423b89d70ab950a2
+#+rsync.b356835b04c5d49533ce9cd7660fd7d61f50d1c1d527b123f46e3eb2f25d3989
+#+execline.9d9d14aad09d9643f578727ab1ed3363b975772358c4ac8e756abdad4fca7a3d
+#+kbd.4d0b59602cb299724eca17b59bddd6fbb1a72ad73b0103801da528856c31d461
+#+mdevd.d0ffd7f79efbd9ff9af5e2a93e8fe5fae0d994325eb28e2af7e5d6783c50afb3
+#+s6-linux-utils.198acb1d9ef7c0d4eade19a06d07864bfda68d89e4d65990af8bc1026c069885
+#+s6-rc.6cefe2791153127e0a783521ab97f3b124f023f21cdc2eddadbb865496ad0b45
+#+s6.bb3974d7b49c2034b5064bac508beae2d4bfc1a7b6543aefcbc1af9e9e94f1a7
+#+zsh.762204e14953017be79e356d4bf9f7681625a750ecc951f3510bf144ea7b51bb
+#+system-config-scripts.ac300ce9214b7e302ac630c3335cd537000ec030b409ee951e53c563d9f71891
+#+logincaps.5faea56c51b05e8cb2f04ab7cbbb9fe7c6050e1f901fdecd616dca315b365dad
+#@git:2cc99f80fa391437063c1bd43f889016b5e7be2c:system-config
+
+def_prefix() {
+ prefix=/versions/$pthbs_package
+}
+def_dest() {
+ dest=${pthbs_destdir%/}//versions/$pthbs_package
+}
+def_prefix
+def_dest
+err_notfound() {
+ printf >&2 'Executable not found for command "%s"\n' "$1"
+ exit 1
+}
+linkdep() {
+ exe=$(command which "$1") || err_notfound "$1"
+ exe=$(realpath "$exe")
+ name=$(basename "$1")
+ if ! test -x "$exe"; then
+ printf 'Error: executable not found: %s\n' "$1"
+ fi
+ mkdir -p "$dest/deps/command"
+ ln -sf $exe "$dest/deps/command/$name"
+}
+
+cd 'system-config'
+
+printf '%s\n' >config/etc/motd \
+ "Welcome to $(cat ./config/hostname)!" \
+ 'Current running configuration was generated from system-config:2cc99f80fa391437063c1bd43f889016b5e7be2c' \
+ 'Last change on 2024-03-16 21:30:28 +0000 by ccx'
+
+printf '%s\n' >config/etc/skel/loginexec \
+ "#!$(which execlineb) -S0" \
+ 'user_loginexec $@'
+chmod +x config/etc/skel/loginexec
+
+env 'pthbs_path_system-config'="$prefix" \
+ 'pthbs_path_containers=/versions/env.a00885f01e307362180c83a60ff605b1d75d3df7a4ee95f8e9ee31067dd9f1a0' \
+ 'pthbs_path_mdevd=/versions/env.9ff4ae1aa76157d331d77b75c4dec8d6fd85395776d90a931bfb285a671a5c32' \
+ make -j${JOBS:-1} -l$((1+${JOBS:-1})) all
+
+sort -u build/execfile | while IFS= read exename; do
+ linkdep "$exename"
+done
+
+mkdir "$dest/command"
+awk -v "zsh=$(which zsh)" <./postinstall >"$dest/command/install-as-current-environment.postinstall" '
+NR==1 { print "#!" zsh; next }
+/@@current@@/ { print "current=/run/current"; next }
+/@@versions@@/ { print "versions='/versions'"; next }
+1
+'
+chmod +x "$dest/command/install-as-current-environment.postinstall"
+
+mkdir -p "$dest/config/"
+rsync -ai ./config/ "$dest/config/"
+rsync -ai ./out/ "$dest/config/"
+mv -v keys "$dest/"
+
+
+cd "$pthbs_destdir/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+}
+
+function r1(s) {
+ sub("^[.]/[^/]*", ".", s)
+ return s
+}
+function s1(repl, s) {
+ sub("^[.]/[^/]*", "./"repl, s)
+ return s
+}
+function link(src) {
+ x[$0]=0
+ printf "%s\t%s\n", $0, src
+ printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
+}
+$1!="."{exit 1}
+
+
+$2 == "config" { link($0); next }
+$2 == "keys" { link($0); next }
+$2 == "command" { link($0); next }
+$2 == "bin" { link(s1("command", $0)); next }
+
+$2 == "library.so" { link($0); next }
+$2 == "library" { link($0); next }
+$2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
+$2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
+
+$2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
+
+$2 == "man" { link($0); next }
+$2 == "info" { link($0); next }
+$2 == "doc" { link($0); next }
+$2 == "icons" { link($0); next }
+$2 == "terminfo" { link($0); next }
+$2 == "data" { link($0); next }
+$2 == "include" { link($0); next }
+
+{ printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
+
+END {
+ for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
+ for(fname in x) {
+ if(x[fname]) {
+ printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
+ exit 3
+ }
+ }
+}' >.install-links.new
+mv .install-links.new .install-links
diff --git a/packages/system-config-init b/packages/system-config-init
@@ -0,0 +1,170 @@
+#!/usr/bin/env pthbs-build
+#+busybox.e60885fe93ee85c01831673bb29f0e62a64903f4ce3094e3dc35bc8ec8887ad9
+#+s6.bb3974d7b49c2034b5064bac508beae2d4bfc1a7b6543aefcbc1af9e9e94f1a7
+#+s6-rc.6cefe2791153127e0a783521ab97f3b124f023f21cdc2eddadbb865496ad0b45
+#+s6-portable-utils.39f4babb8cd30769f1a931708e5442244b0305c36ddafe32348c7dc30c000b00
+#+s6-linux-init.396413eed542c149346f51a569f2d686c03b2104f4d062f52422e444ad9b502d
+#+execline.9d9d14aad09d9643f578727ab1ed3363b975772358c4ac8e756abdad4fca7a3d
+#+system-config-rc.f5e2185bd14499a3355fc29957a75a6a3e750a5888654daf90b105c74b0e9964
+
+s6rcdb=/versions/system-config-rc.f5e2185bd14499a3355fc29957a75a6a3e750a5888654daf90b105c74b0e9964/config/s6-rc-db
+prefix=/versions/$pthbs_package
+pkgdir="$pthbs_destdir/$prefix"
+
+q() {
+ "s6-quote" "$@"
+}
+
+qx() {
+ exe=$(realpath "$(which "$1")")
+ name=$(basename "$1")
+ if ! test -x "$exe"; then
+ printf 'Error: executable not found: %s\n' "$1"
+ fi
+ mkdir -p "$pkgdir/deps/command"
+ ln -sf $exe "$pkgdir/deps/command/$name"
+ "s6-quote" "$prefix/deps/command/$name"
+}
+
+# Generate init ($pkgdir must not exist but parent dir does)
+mkdir -p "$pthbs_destdir//versions"
+s6-linux-init-maker \
+ -p "/run/current/command:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
+ -G "$(q "$prefix/deps/command/env") TERM=linux $(q "$prefix/deps/command/getty") 38400 tty9" \
+ -t 1 \
+ -N \
+ -c "$prefix" \
+ "$pkgdir"
+
+
+# Link deps that are passed to s6-l-i-m
+qx env
+qx getty
+
+# Link execlineb - can't quote shebang
+qx execlineb
+el=$prefix/deps/command/$name
+
+# Rewrite bin/init as it fails finding it's own s6-linux-init
+s6-cat >"$pkgdir/bin/init.new" <<EOF || exit $?
+#!$el -S0
+$(qx pthbs-enter)
+$(qx s6-envdir) -I /run/current/env
+EOF
+s6-cat >>"$pkgdir/bin/init.new" <"$pkgdir/bin/init"
+chmod +x "$pkgdir/bin/init.new"
+mv -v "$pkgdir/bin/init.new" "$pkgdir/bin/init"
+
+# Rewrite dynamically generated scripts
+s6-cat >"$pkgdir/scripts/rc.init" <<EOF || exit $?
+#!$el -S1
+$(qx export) TERM "linux"
+$(qx foreground) { $(qx s6-echo) "* Starting s6-rc from "$(q "$s6rcdb") }
+$(qx if) { $(qx s6-rc-init) -d -c $(q "$s6rcdb") /run/service }
+$prefix/scripts/runlevel \$1
+EOF
+
+s6-cat >"$pkgdir/scripts/rc.shutdown" <<EOF || exit $?
+#!$el -P
+
+### Things to do before hardware halt/reboot/poweroff.
+### Ideally, it should be a single call to the service manager,
+### telling it to bring all the services down.
+
+$(qx redirfd) -w 1 /dev/console
+$(qx redirfd) -w 2 /dev/console
+$(qx s6-rc) -v2 -bDa change
+EOF
+
+s6-cat >"$pkgdir/scripts/runlevel" <<EOF || exit $?
+#!$el -S1
+export TERM "linux"
+
+# The requested runlevel is in "\$1" but currently ignored.
+
+# Run the service manager.
+# Call it twice because the first time may spuriously "timeout"
+# due to the clock jumping forward.
+
+$(qx ifelse) -X {
+ $(qx s6-rc) -v 2 -t 600000 -- change ok-all-but-tty
+} {
+ # no timeout, start ttys properly
+ $(qx foreground) { $(qx s6-echo) "* System started normally (bundle ok-all-but-tty)" }
+ $(qx foreground) { sleep 0.3 }
+ $(qx foreground) { $(qx s6-svc) -d /run/service/console-log-tail }
+ $(qx s6-rc) -v 2 -t 600000 -- change ok-all
+}
+$(qx foreground) { $(qx s6-echo) "* System startup failure: retry" }
+# try again without tty and then with
+$(qx foreground) { $(qx s6-rc) -v 2 -t 600000 -- change ok-all-but-tty }
+$(qx foreground) { $(qx sleep) 0.1 }
+$(qx foreground) { $(qx s6-svc) -d /run/service/console-log-tail }
+$(qx s6-rc) -v 2 -t 600000 -- change ok-all
+EOF
+
+s6-mkdir "$pkgdir/run-image/service/console-log-tail" || exit $?
+s6-cat >"$pkgdir/run-image/service/console-log-tail/run" <<EOF || exit $?
+#!$el -P
+$(qx redirfd) -w 1 /dev/console
+$(qx fdmove) -c 2 1
+$(qx pipeline) -w { $(qx s6-tai64nlocal) }
+$(qx tail) -F -n +1 /run/uncaught-logs/current
+EOF
+s6-chmod 755 "$pkgdir/run-image/service/console-log-tail/run" exit $?
+
+
+cd "$pthbs_destdir/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+ x["./bin/init"]=1
+ x["./bin/halt"]=1
+ x["./bin/poweroff"]=1
+ x["./bin/reboot"]=1}
+
+function r1(s) {
+ sub("^[.]/[^/]*", ".", s)
+ return s
+}
+function s1(repl, s) {
+ sub("^[.]/[^/]*", "./"repl, s)
+ return s
+}
+function link(src) {
+ x[$0]=0
+ printf "%s\t%s\n", $0, src
+ printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
+}
+$1!="."{exit 1}
+
+
+$2 == "command" { link($0); next }
+$2 == "bin" { link(s1("command", $0)); next }
+
+$2 == "library.so" { link($0); next }
+$2 == "library" { link($0); next }
+$2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
+$2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
+
+$2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
+
+$2 == "man" { link($0); next }
+$2 == "info" { link($0); next }
+$2 == "doc" { link($0); next }
+$2 == "icons" { link($0); next }
+$2 == "terminfo" { link($0); next }
+$2 == "data" { link($0); next }
+$2 == "include" { link($0); next }
+
+{ printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
+
+END {
+ for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
+ for(fname in x) {
+ if(x[fname]) {
+ printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
+ exit 3
+ }
+ }
+}' >.install-links.new
+mv .install-links.new .install-links
diff --git a/packages/system-config-rc b/packages/system-config-rc
@@ -0,0 +1,72 @@
+#!/usr/bin/env pthbs-build
+#+busybox.e60885fe93ee85c01831673bb29f0e62a64903f4ce3094e3dc35bc8ec8887ad9
+#+busybox-diffutils.4f5a07b29246414b77a7d71b103263af8f1249d75ddcbd9864e00def3d6feded
+#+s6-rc.6cefe2791153127e0a783521ab97f3b124f023f21cdc2eddadbb865496ad0b45
+#+fileset.22d9abf3009dbbfe507bd7ff93fdd0bf7f86ee0bc317b37b423b89d70ab950a2
+#+system-config.f5d7e5a11eaae279e472fe1739fdeb03feefc570410babf2cb47d87821980171
+
+def_prefix() {
+ prefix=/versions/$pthbs_package
+}
+def_dest() {
+ dest=${pthbs_destdir%/}//versions/$pthbs_package
+}
+def_dest
+
+src=/versions/system-config.f5d7e5a11eaae279e472fe1739fdeb03feefc570410babf2cb47d87821980171/config/s6-rc-source
+s6-rc-compile ./s6-rc-db "$src"
+mkdir -p "$dest/config"
+mv -v s6-rc-db "$dest/config/"
+
+cd "$pthbs_destdir/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+}
+
+function r1(s) {
+ sub("^[.]/[^/]*", ".", s)
+ return s
+}
+function s1(repl, s) {
+ sub("^[.]/[^/]*", "./"repl, s)
+ return s
+}
+function link(src) {
+ x[$0]=0
+ printf "%s\t%s\n", $0, src
+ printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
+}
+$1!="."{exit 1}
+
+
+$2 == "config" { link($0); next }
+$2 == "command" { link($0); next }
+$2 == "bin" { link(s1("command", $0)); next }
+
+$2 == "library.so" { link($0); next }
+$2 == "library" { link($0); next }
+$2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
+$2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
+
+$2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
+
+$2 == "man" { link($0); next }
+$2 == "info" { link($0); next }
+$2 == "doc" { link($0); next }
+$2 == "icons" { link($0); next }
+$2 == "terminfo" { link($0); next }
+$2 == "data" { link($0); next }
+$2 == "include" { link($0); next }
+
+{ printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
+
+END {
+ for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
+ for(fname in x) {
+ if(x[fname]) {
+ printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
+ exit 3
+ }
+ }
+}' >.install-links.new
+mv .install-links.new .install-links
diff --git a/packages/system-config-scripts b/packages/system-config-scripts
@@ -0,0 +1,82 @@
+#!/usr/bin/env pthbs-build
+#+busybox.e60885fe93ee85c01831673bb29f0e62a64903f4ce3094e3dc35bc8ec8887ad9
+#+zsh.762204e14953017be79e356d4bf9f7681625a750ecc951f3510bf144ea7b51bb
+#+pthbs-banginstall.d1e43ec62e6d2b3a2a03a2d9ce487f6fe768fb7131c09ce0d2dd9e165233cff1
+#@git:dc793695cc0632a808af9d4415f3b0cf0f4dfba2:system-config-scripts
+
+: ${JOBS:=1}
+prefix=/versions/$pthbs_package
+pkgdir="$pthbs_destdir/$prefix"
+mkdir -p "$pkgdir/"
+cd 'system-config-scripts'
+
+for d in bin sbin command; do
+ if test -d "$d"; then
+ pthbs-banginstall "$d"/* "$pkgdir"
+ fi
+done
+
+if test -d vim; then
+ mkdir -p "$pkgdir/vimfiles/pack/plugins/start"
+ mv -v vim "$pkgdir/vimfiles/pack/plugins/start/$pthbs_package"
+fi
+
+if test -d zsh-functions; then
+ mkdir -p "$pkgdir/zsh"
+ mv -v zsh-functions "$pkgdir/zsh/site-functions"
+fi
+
+cd "$pthbs_destdir/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+ x["./command/s"]=1
+ x["./command/issue-gen"]=1}
+
+function r1(s) {
+ sub("^[.]/[^/]*", ".", s)
+ return s
+}
+function s1(repl, s) {
+ sub("^[.]/[^/]*", "./"repl, s)
+ return s
+}
+function link(src) {
+ x[$0]=0
+ printf "%s\t%s\n", $0, src
+ printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
+}
+$1!="."{exit 1}
+
+
+$2 == "zsh" { link($0); next }
+$2 == "vimfiles" { link($0); next }
+$2 == "command" { link($0); next }
+$2 == "bin" { link(s1("command", $0)); next }
+
+$2 == "library.so" { link($0); next }
+$2 == "library" { link($0); next }
+$2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
+$2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
+
+$2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
+
+$2 == "man" { link($0); next }
+$2 == "info" { link($0); next }
+$2 == "doc" { link($0); next }
+$2 == "icons" { link($0); next }
+$2 == "terminfo" { link($0); next }
+$2 == "data" { link($0); next }
+$2 == "include" { link($0); next }
+
+{ printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
+
+END {
+ for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
+ for(fname in x) {
+ if(x[fname]) {
+ printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
+ exit 3
+ }
+ }
+}' >.install-links.new
+mv .install-links.new .install-links