[PATCH 4/4] Use /etc/s6-rc/compiled for compiled s6-rc directory

Demi Marie Obenour
2025-09-04T02:09:28Z

This is the default, so it makes things simpler and avoids having to
specify "-c /etc/s6-rc" in every s6-rc-init invocation.

This is not logically part of this patch series, but it shows how
centralizing the make code makes changes easier.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
host/rootfs/image/etc/s6-linux-init/scripts/rc.init | 2 +-
img/app/image/etc/s6-linux-init/scripts/rc.init | 2 +-
lib/erofs.mk | 6 +++---
vm/sys/net/image/etc/s6-linux-init/scripts/rc.init | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/host/rootfs/image/etc/s6-linux-init/scripts/rc.init b/host/rootfs/image/etc/s6-linux-init/scripts/rc.init
index 674fd38cc76837c7be25a5ef060f0f4d4b786394..b06a4ab7518f0af204475c41ee77ea5f8d657718 100755
--- a/host/rootfs/image/etc/s6-linux-init/scripts/rc.init
+++ b/host/rootfs/image/etc/s6-linux-init/scripts/rc.init
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: EUPL-1.2+
# SPDX-FileCopyrightText: 2020-2022, 2024 Alyssa Ross <hi@alyssa.is>

-if { s6-rc-init -c /etc/s6-rc /run/service }
+if { s6-rc-init /run/service }

if { mount --make-shared /run }
if { mount -a --mkdir }
diff --git a/img/app/image/etc/s6-linux-init/scripts/rc.init b/img/app/image/etc/s6-linux-init/scripts/rc.init
index 0bf350a7015b01072c1fe8dab6be2fb51fa71d5a..e4932e4ad478db7c51ab8c63ccb601d7a60efb85 100755
--- a/img/app/image/etc/s6-linux-init/scripts/rc.init
+++ b/img/app/image/etc/s6-linux-init/scripts/rc.init
@@ -8,7 +8,7 @@ if { ln -s /proc/self/fd/0 /dev/stdin }
if { ln -s /proc/self/fd/1 /dev/stdout }
if { ln -s /proc/self/fd/2 /dev/stderr }

-if { s6-rc-init -c /etc/s6-rc /run/service }
+if { s6-rc-init /run/service }

if { modprobe overlay }
if { mount -a --mkdir }
diff --git a/lib/erofs.mk b/lib/erofs.mk
index b3fc112f5e793725977cd8c4b2e71d6ed8d888c4..a65f2d004efed9dcf218dd806cf66071fb115db1 100644
--- a/lib/erofs.mk
+++ b/lib/erofs.mk
@@ -1,6 +1,6 @@
override basedir ::= $(dir $(lastword $(MAKEFILE_LIST)))/..

-override BUILD_FILES ::= $(BUILD_FILES) build/etc/s6-rc
+override BUILD_FILES ::= $(BUILD_FILES) build/etc/s6-rc/compiled
# No override here so that it can be overridden in host/rootfs/default.nix.
dest ::= build/rootfs.erofs

@@ -41,8 +41,8 @@ update-file-list:
# including files that aren't intended to be part of the input, like
# temporary editor files or .license files. So for all these reasons,
# only explicitly listed files are made available to s6-rc-compile.
-build/etc/s6-rc: $(addprefix image/,$(S6_RC_FILES)) file-list.mk
- mkdir -p build/etc
+build/etc/s6-rc/compiled: $(addprefix image/,$(S6_RC_FILES)) file-list.mk
+ mkdir -p build/etc/s6-rc
rm -rf $@
set -euo pipefail; \
dir=$$(mktemp -d); \
diff --git a/vm/sys/net/image/etc/s6-linux-init/scripts/rc.init b/vm/sys/net/image/etc/s6-linux-init/scripts/rc.init
index 1016d0c62bc6103bc9e865a389f5d482ef6c2b76..5b3261f0356f6615bac4e1aa33352f15d4842317 100755
--- a/vm/sys/net/image/etc/s6-linux-init/scripts/rc.init
+++ b/vm/sys/net/image/etc/s6-linux-init/scripts/rc.init
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: EUPL-1.2+
# SPDX-FileCopyrightText: 2020-2022 Alyssa Ross <hi@alyssa.is>

-if { s6-rc-init -c /etc/s6-rc /run/service }
+if { s6-rc-init /run/service }

if { mkdir -p /dev/pts /dev/shm }
if { mount -a }

--
2.51.0