commit 1e0792801fc592f71090c593b9c9f3dab6af20cd
parent 6e895164cd905230ec05eda031c05649593b1d39
Author: ccx <ccx@te2000.cz>
Date: Thu, 7 Mar 2024 16:56:50 +0000
Work on init, install_group=pthbs
Diffstat:
10 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/command/pthbs-build b/command/pthbs-build
@@ -71,7 +71,7 @@ case $(id -u) in
export pthbs_uid=$(id -u pthbs) || exit $?
export pthbs_gid=$(id -g pthbs) || exit $?
export pthbs_install_uid=0 || exit $?
- export pthbs_install_gid=0 || exit $?
+ export pthbs_install_gid=$pthbs_gid || exit $?
;;
(*)
sandbox_mode=userns
diff --git a/command/pthbs-enter-gen b/command/pthbs-enter-gen
@@ -53,21 +53,19 @@ if test -x "$envcommand/install-as-current-environment.postinstall"; then
cat >"$exe" <<EOF
#!$envcommand/execlineb -P
"$envcommand/s6-envdir" "$envdir" "$envcommand/exec"
-printf "%s\n" TODO
-exit 100
ifelse -n { test -L /run/current } {
- if { ln -s -f -v "$envdir" }
+ if { ln -s -f -v "$envtop" /run/current }
"$envcommand/install-as-current-environment.postinstall"
}
foreground {
fdmove -c 1 2
- printf "* Swapping /run/current from %s to " "$envdir"
+ printf "* Swapping /run/current from %s to " "$envtop"
readlink /run/command
}
getpid NS_PID
importas -i NS_PID NS_PID
if { mv -v /run/current /run/previous.\${NS_PID} }
-if { ln -s -f -v "$envdir" }
+if { ln -s -f -v "$envtop" /run/current }
ifelse {
"$envcommand/install-as-current-environment.postinstall" /run/previous.\${NS_PID}
} { }
diff --git a/command/pthbs-namedenv b/command/pthbs-namedenv
@@ -25,7 +25,7 @@ case ${env_installdir##*/} in
esac
bd_link="$basedir/namedenv/$env_name"
-v_link_base="${env_installdir%/*}/env.named.$env_name"
+v_link_base="${env_installdir%/*}/namedenv.$env_name"
printf "%s => %s\n" "$v_link_base" "${env_installdir##*/}"
if test -L "$bd_link"; then
unlink "$bd_link"
diff --git a/packages/core-system-conf b/packages/core-system-conf
@@ -12,7 +12,7 @@
#+s6-rc.6cefe2791153127e0a783521ab97f3b124f023f21cdc2eddadbb865496ad0b45
#+s6.bb3974d7b49c2034b5064bac508beae2d4bfc1a7b6543aefcbc1af9e9e94f1a7
#+zsh.762204e14953017be79e356d4bf9f7681625a750ecc951f3510bf144ea7b51bb
-#@git:434374c57fc499f47b86d92a3bdfdc53bede7ac3:core-system-conf
+#@git:a4f36429f9597be5ee3f9dcedda6c21175387599:core-system-conf
def_prefix() {
prefix=/versions/$pthbs_package
@@ -40,8 +40,8 @@ linkdep() {
cd 'core-system-conf'
printf '%s\n' >config/etc/motd \
"Welcome to $(cat ./config/hostname)!" \
- 'Current running configuration was generated from core-system-conf:434374c57fc499f47b86d92a3bdfdc53bede7ac3' \
- 'Last change on 2024-03-06 23:59:03 +0000 by ccx'
+ 'Current running configuration was generated from core-system-conf:a4f36429f9597be5ee3f9dcedda6c21175387599' \
+ 'Last change on 2024-03-07 16:55:01 +0000 by ccx'
env 'pthbs_path_core-system-conf'="$prefix" \
'pthbs_path_containers=/versions/containers.environment.5c638a60055f057e241390ce3f606b4555427cd47c09becd05c48c29ca76d8bb' \
@@ -53,7 +53,7 @@ done
mkdir "$dest/command"
awk -v "zsh=$(which zsh)" <./postinstall >"$dest/command/install-as-current-environment.postinstall" '
-NR==1 { print "#!" zsh }
+NR==1 { print "#!" zsh; next }
/@@current@@/ { print "current=/run/current"; next }
/@@versions@@/ { print "versions='/versions'"; next }
1
diff --git a/packages/core-system-init b/packages/core-system-init
@@ -5,9 +5,9 @@
#+s6-portable-utils.39f4babb8cd30769f1a931708e5442244b0305c36ddafe32348c7dc30c000b00
#+s6-linux-init.396413eed542c149346f51a569f2d686c03b2104f4d062f52422e444ad9b502d
#+execline.9d9d14aad09d9643f578727ab1ed3363b975772358c4ac8e756abdad4fca7a3d
-#+core-system-rc.569010dd05cdb91341a6537af073f9c31e781fa350800aafb98fe14d673cba68
+#+core-system-rc.d7cb3721d0c1e7a04d3d2c7e192aa5b99c5d7e7386d4d924e023a0497ded1a87
-s6rcdb=/versions/core-system-rc.569010dd05cdb91341a6537af073f9c31e781fa350800aafb98fe14d673cba68/s6-rc-db
+s6rcdb=/versions/core-system-rc.d7cb3721d0c1e7a04d3d2c7e192aa5b99c5d7e7386d4d924e023a0497ded1a87/s6-rc-db
prefix=/versions/$pthbs_package
pkgdir="$pthbs_destdir/$prefix"
@@ -29,7 +29,7 @@ qx() {
# Generate init ($pkgdir must not exist but parent dir does)
mkdir -p "$pthbs_destdir//versions"
s6-linux-init-maker \
- -p "/command:/usr/local/bzr/all/sbin:/usr/local/bzr/all/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
+ -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 \
-c "$prefix" \
diff --git a/packages/core-system-rc b/packages/core-system-rc
@@ -3,7 +3,7 @@
#+busybox-diffutils.4f5a07b29246414b77a7d71b103263af8f1249d75ddcbd9864e00def3d6feded
#+s6-rc.6cefe2791153127e0a783521ab97f3b124f023f21cdc2eddadbb865496ad0b45
#+fileset.22d9abf3009dbbfe507bd7ff93fdd0bf7f86ee0bc317b37b423b89d70ab950a2
-#+core-system-conf.711c4b8980ffb2db553417aa25ef1ba3e66a3430a019024284b419f585ae66da
+#+core-system-conf.64b1d13d389cc531cb705aeac6aa2f61901b06a85043caee227d7973281e4156
def_prefix() {
prefix=/versions/$pthbs_package
@@ -13,7 +13,7 @@ def_dest() {
}
def_dest
-src=/versions/core-system-conf.711c4b8980ffb2db553417aa25ef1ba3e66a3430a019024284b419f585ae66da/config/s6-rc-source
+src=/versions/core-system-conf.64b1d13d389cc531cb705aeac6aa2f61901b06a85043caee227d7973281e4156/config/s6-rc-source
s6-rc-compile ./s6-rc-db "$src"
mkdir -p "$dest/config"
mv -v s6-rc-db "$dest/config/"
diff --git a/packages/core-system-scripts b/packages/core-system-scripts
@@ -2,7 +2,7 @@
#+busybox.e60885fe93ee85c01831673bb29f0e62a64903f4ce3094e3dc35bc8ec8887ad9
#+zsh.762204e14953017be79e356d4bf9f7681625a750ecc951f3510bf144ea7b51bb
#+pthbs-banginstall.d1e43ec62e6d2b3a2a03a2d9ce487f6fe768fb7131c09ce0d2dd9e165233cff1
-#@git:98fabf6dffa7a3a7850f1797f557e181b7e8460f:core-system-scripts
+#@git:dc793695cc0632a808af9d4415f3b0cf0f4dfba2:core-system-scripts
: ${JOBS:=1}
prefix=/versions/$pthbs_package
diff --git a/packages/default.environment b/packages/default.environment
@@ -1,7 +1,7 @@
-#+core-system-conf.711c4b8980ffb2db553417aa25ef1ba3e66a3430a019024284b419f585ae66da
-#+core-system-rc.569010dd05cdb91341a6537af073f9c31e781fa350800aafb98fe14d673cba68
-#+core-system-scripts.f41cc8b889e46da5fe1c5d25d28fcbeac5165d9457d47734a62e32f9ee58396c
-#+core-system-init.6ed6537658157fc839390880d584f43c40b21163f52078819ea1ae65ed833306
+#+core-system-conf.64b1d13d389cc531cb705aeac6aa2f61901b06a85043caee227d7973281e4156
+#+core-system-rc.d7cb3721d0c1e7a04d3d2c7e192aa5b99c5d7e7386d4d924e023a0497ded1a87
+#+core-system-scripts.132a3b1c6b226dee79156049db1244ebeacdf5a4bfcffc74b6b97175dad000fd
+#+core-system-init.91f6e14df04fd08bd86e675bc3e8cce828d839aad456d6280f67b1db606036b8
#+busybox.e60885fe93ee85c01831673bb29f0e62a64903f4ce3094e3dc35bc8ec8887ad9
#+gnu-make.782c9e6625fd7420e2cd38b847afed19db3b3844cae8a0426a0dbf73e10d78e5
#+musl-cross-make.65f98305f5666435bf0c6b9ccedffae2179ff1b3286752756886f760cf7771d2
diff --git a/templates/pkg/core-system-conf b/templates/pkg/core-system-conf
@@ -49,7 +49,7 @@ done
mkdir "$dest/command"
awk -v "zsh=$(which zsh)" <./postinstall >"$dest/command/install-as-current-environment.postinstall" '
-NR==1 { print "#!" zsh }
+NR==1 { print "#!" zsh; next }
/@@current@@/ { print "current=/run/current"; next }
/@@versions@@/ { print "versions='{{versions}}'"; next }
1
diff --git a/templates/pkg/core-system-init b/templates/pkg/core-system-init
@@ -30,7 +30,7 @@ qx() {
# Generate init ($pkgdir must not exist but parent dir does)
mkdir -p "$pthbs_destdir/{{versions}}"
s6-linux-init-maker \
- -p "/command:/usr/local/bzr/all/sbin:/usr/local/bzr/all/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
+ -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 \
-c "$prefix" \