diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-02-10 13:00:48 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-02-10 13:00:48 +0000 |
commit | 89b9fd96d17ed0ed0adc2ffc1345f660bea68f10 (patch) | |
tree | 9fdb5ecf0833c802ce7ad63af224033ffcbec942 | |
parent | 934bd389d396748c3184161659af0af82312433a (diff) | |
download | lh-bootstrap-89b9fd96d17ed0ed0adc2ffc1345f660bea68f10.tar.xz |
New utmpd behaviour
Signed-off-by: Laurent Bercot <ska@appnovation.com>
16 files changed, 22 insertions, 5 deletions
diff --git a/layout/rootfs/etc/s6-rc/source-base/btmpd/dependencies.d/init-utmp-early b/layout/rootfs/etc/s6-rc/source-base/btmpd/dependencies.d/init-utmp-early new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/btmpd/dependencies.d/init-utmp-early diff --git a/layout/rootfs/etc/s6-rc/source-base/btmpd/run b/layout/rootfs/etc/s6-rc/source-base/btmpd/run index 4c7ffe6..97ab9d3 100755 --- a/layout/rootfs/etc/s6-rc/source-base/btmpd/run +++ b/layout/rootfs/etc/s6-rc/source-base/btmpd/run @@ -1,4 +1,4 @@ -#!/package/admin/execline/command/execlineb -S1 +#!/command/execlineb -S1 fdmove -c 2 1 s6-setuidgid utmp diff --git a/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/dependencies.d/00 b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/dependencies.d/00 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/dependencies.d/00 diff --git a/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/down b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/down new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/down @@ -0,0 +1 @@ + diff --git a/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/type b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/type @@ -0,0 +1 @@ +oneshot diff --git a/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/up b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/up new file mode 100644 index 0000000..cb91c16 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/up @@ -0,0 +1,5 @@ +if { s6-mkdir -p -m 0755 /run/utmps } +if { s6-envuidgid utmp s6-chown -U -- /run/utmps } +s6-setuidgid utmp +redirfd -w 1 /run/utmps/utmp +exit 0 diff --git a/layout/rootfs/etc/s6-rc/source-base/init-utmp/dependencies.d/utmpd b/layout/rootfs/etc/s6-rc/source-base/init-utmp/dependencies.d/utmpd new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/init-utmp/dependencies.d/utmpd diff --git a/layout/rootfs/etc/s6-rc/source-base/ok-local/contents.d/utmpd b/layout/rootfs/etc/s6-rc/source-base/ok-local/contents.d/utmpd new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/ok-local/contents.d/utmpd diff --git a/layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/init-utmp-early b/layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/init-utmp-early new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/init-utmp-early diff --git a/layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/mount-rwfs b/layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/mount-rwfs new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/mount-rwfs diff --git a/layout/rootfs/etc/s6-rc/source-base/utmpd/notification-fd b/layout/rootfs/etc/s6-rc/source-base/utmpd/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/utmpd/notification-fd @@ -0,0 +1 @@ +3 diff --git a/layout/rootfs/etc/s6-rc/source-base/utmpd/run b/layout/rootfs/etc/s6-rc/source-base/utmpd/run new file mode 100755 index 0000000..5c2d5d6 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/utmpd/run @@ -0,0 +1,8 @@ +#!/command/execlineb -S1 + +fdmove -c 2 1 +s6-setuidgid utmp +cd /run/utmps +fdmove 1 3 +s6-ipcserver -1 -c 1000 -- .utmpd-socket +utmps-utmpd diff --git a/layout/rootfs/etc/s6-rc/source-base/utmpd/type b/layout/rootfs/etc/s6-rc/source-base/utmpd/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/utmpd/type @@ -0,0 +1 @@ +longrun diff --git a/layout/rootfs/etc/s6-rc/source-base/wtmpd/dependencies.d/init-utmp-early b/layout/rootfs/etc/s6-rc/source-base/wtmpd/dependencies.d/init-utmp-early new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/wtmpd/dependencies.d/init-utmp-early diff --git a/layout/rootfs/etc/s6-rc/source-base/wtmpd/run b/layout/rootfs/etc/s6-rc/source-base/wtmpd/run index a49e0de..eb66ed3 100755 --- a/layout/rootfs/etc/s6-rc/source-base/wtmpd/run +++ b/layout/rootfs/etc/s6-rc/source-base/wtmpd/run @@ -4,4 +4,4 @@ s6-setuidgid utmp cd /var/log/wtmpd fdmove 1 3 s6-ipcserver -1 -c 1000 -- /run/utmps/.wtmpd-socket -utmps-wtmpd +utmps-wtmpd wtmp diff --git a/sub/skarnet.org/Makefile b/sub/skarnet.org/Makefile index 6fa030e..d33962e 100644 --- a/sub/skarnet.org/Makefile +++ b/sub/skarnet.org/Makefile @@ -10,7 +10,8 @@ EXECLINE_VERSION := bb748f0e002c8a4f9865ae0a592fcb4fac0aabc7 S6_VERSION := 47e886410b0e1e9e2f40a3447d6a9a9c1c07928f # S6_RC_VERSION := v0.5.3.4 S6_RC_VERSION := bbf31e578acd6b6e860fc2b58c1fc910e81c00dd -S6_LINUX_INIT_VERSION := v1.0.8.1 +# S6_LINUX_INIT_VERSION := v1.1.0.0 +S6_LINUX_INIT_VERSION := ebd7a0c2fea984d377f11062bc8f56f777a9a572 S6_PORTABLE_UTILS_VERSION := v2.2.5.1 # S6_LINUX_UTILS_VERSION := v2.6.1.0 S6_LINUX_UTILS_VERSION := 3caba3fd8f3825544c065ec62e4298c6edc76b28 @@ -124,7 +125,7 @@ $(foreach pkg,$(SKAWARE),$(eval $(call skaware_rules_definition,$(pkg)))) $(OUTPUT)/build-$(TRIPLE)/.lh_s6li_laidout: $(OUTPUT)/rootfs/package/admin/s6-linux-init/include/s6-linux-init/config.h | $(OUTPUT)/tmp/.lh_prepared $(OUTPUT)/build-build/.lh_skarnet_installed $(OUTPUT)/tmp/.lh_layout_installed exec mkdir -p $(OUTPUT)/rootfs/etc/s6-linux-init exec rm -rf $(OUTPUT)/rootfs/etc/s6-linux-init/s6lidir - exec s6-linux-init-maker -u $(NORMALUSER) $(EARLY_GETTY) -1 -p /command:/bin -s /run/kernel_env -U utmp -f $(OUTPUT)/build-build/etc/s6-linux-init/skel -- $(OUTPUT)/rootfs/etc/s6-linux-init/s6lidir + exec s6-linux-init-maker -u $(NORMALUSER) $(EARLY_GETTY) -1 -p /command:/bin -s /run/kernel_env -f $(OUTPUT)/build-build/etc/s6-linux-init/skel -- $(OUTPUT)/rootfs/etc/s6-linux-init/s6lidir exec sed -i 's/s6-setuidgid "$(NORMALUSER)"/s6-setuidgid catchlog/' $(OUTPUT)/rootfs/etc/s6-linux-init/s6lidir/run-image/service/s6-svscan-log/run exec rm -rf $(OUTPUT)/rootfs/etc/s6-linux-init/current exec mv -f $(OUTPUT)/rootfs/etc/s6-linux-init/s6lidir $(OUTPUT)/rootfs/etc/s6-linux-init/current @@ -174,7 +175,6 @@ $(OUTPUT)/build-build/etc/s6-linux-init/skel/rc.init: $(OUTPUT)/build-build/pack exec setuidgid $(NORMALUSER) cp -f sub/skarnet.org/rc.shutdown.final $(OUTPUT)/build-build/etc/s6-linux-init/skel/rc.shutdown.final exec setuidgid $(NORMALUSER) cp -f sub/skarnet.org/runlevel $(OUTPUT)/build-build/etc/s6-linux-init/skel/runlevel exec setuidgid $(NORMALUSER) cp -f sub/skarnet.org/rc.init $@ - exec setuidgid $(NORMALUSER) touch $@ $(OUTPUT)/build-build/.lh_skarnet_installed: $(OUTPUT)/build-build/etc/s6-linux-init/skel/rc.init |