Re: [PATCH 17/20] Use /etc/s6-rc/compiled for compiled s6-rc directory

Demi Marie Obenour
2025-09-08T18:15:43Z

[-- Attachment #1.1.1: Type: text/plain, Size: 5625 bytes --]

On 9/8/25 05:27, Alyssa Ross wrote:
> Demi Marie Obenour <demiobenour@gmail.com> writes:
>
>> This is the default, so it makes things simpler and avoids having to
>> specify "-c /etc/s6-rc" in every s6-rc-init invocation.
>>
>> Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
>
> It is the default, but I'm not sure it's a default that makes sense for
> Spectrum, where the source files are not part of the filesystem. There
> will never be anything else under /etc/s6-rc. There shouldn't really be
> much reason to run s6-rc-init interactively, so I don't think there's
> much value in avoiding having to specify -c.

The main value is that it makes development easier. I had a lot of
problems with the systemd stuff due to forgetting to specify -c.

>> ---
>> host/rootfs/Makefile | 4 ++--
>> host/rootfs/etc/s6-linux-init/scripts/rc.init | 2 +-
>> img/app/Makefile | 4 ++--
>> img/app/etc/s6-linux-init/scripts/rc.init | 2 +-
>> vm/sys/net/Makefile | 4 ++--
>> vm/sys/net/etc/s6-linux-init/scripts/rc.init | 2 +-
>> 6 files changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile
>> index 4faaccab8cb01d57ef7c48c01eb6fb1326cea4a0..c62f585b8b7b57918b71fbf4afc18c91965bc1f1 100644
>> --- a/host/rootfs/Makefile
>> +++ b/host/rootfs/Makefile
>> @@ -105,7 +105,7 @@ LINKS = \
>> etc/s6-linux-init/run-image/opengl-driver \
>> etc/s6-linux-init/run-image/service/vmm/template/run
>>
>> -BUILD_FILES = build/etc/s6-rc
>> +BUILD_FILES = build/etc/s6-rc/compiled
>>
>> $(dest): ../../scripts/make-erofs.sh $(PACKAGES_FILE) $(FILES) $(BUILD_FILES) build/empty build/fifo
>> ( \
>> @@ -160,7 +160,7 @@ S6_RC_FILES = \
>> # 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: $(S6_RC_FILES)
>> +build/etc/s6-rc/compiled: $(S6_RC_FILES)
>> mkdir -p $$(dirname $@)
>> rm -rf $@
>>
>> diff --git a/host/rootfs/etc/s6-linux-init/scripts/rc.init b/host/rootfs/etc/s6-linux-init/scripts/rc.init
>> index 674fd38cc76837c7be25a5ef060f0f4d4b786394..b06a4ab7518f0af204475c41ee77ea5f8d657718 100755
>> --- a/host/rootfs/etc/s6-linux-init/scripts/rc.init
>> +++ b/host/rootfs/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/Makefile b/img/app/Makefile
>> index d3c206d70eedc2b423944ecff5f7c723ba719e0d..da70c65cdcde69ae39a543b396e3c566d9e49943 100644
>> --- a/img/app/Makefile
>> +++ b/img/app/Makefile
>> @@ -68,7 +68,7 @@ VM_FIFOS = etc/s6-linux-init/run-image/service/s6-linux-init-shutdownd/fifo
>> # them as make dependencies would confuse make.
>> VM_LINKS = etc/ssl/certs/ca-certificates.crt
>>
>> -VM_BUILD_FILES = build/etc/s6-rc
>> +VM_BUILD_FILES = build/etc/s6-rc/compiled
>>
>> build/fifo:
>> mkdir -p build
>> @@ -114,7 +114,7 @@ VM_S6_RC_FILES = \
>> etc/s6-rc/wireplumber/run \
>> etc/s6-rc/wireplumber/type
>>
>> -build/etc/s6-rc: $(VM_S6_RC_FILES)
>> +build/etc/s6-rc/compiled: $(VM_S6_RC_FILES)
>> mkdir -p $$(dirname $@)
>> rm -rf $@
>>
>> diff --git a/img/app/etc/s6-linux-init/scripts/rc.init b/img/app/etc/s6-linux-init/scripts/rc.init
>> index 0bf350a7015b01072c1fe8dab6be2fb51fa71d5a..e4932e4ad478db7c51ab8c63ccb601d7a60efb85 100755
>> --- a/img/app/etc/s6-linux-init/scripts/rc.init
>> +++ b/img/app/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/vm/sys/net/Makefile b/vm/sys/net/Makefile
>> index a5ba5bbe219c3a37ba887a360cea61b3dc8eedce..b94d27d193e419291c72832f4a351c4ff099c33e 100644
>> --- a/vm/sys/net/Makefile
>> +++ b/vm/sys/net/Makefile
>> @@ -42,7 +42,7 @@ VM_FILES = \
>> etc/sysctl.conf
>> VM_DIRS = etc/s6-linux-init/env var/lib/connman
>>
>> -VM_BUILD_FILES = build/etc/s6-rc
>> +VM_BUILD_FILES = build/etc/s6-rc/compiled
>>
>> build/empty:
>> mkdir -p $@
>> @@ -75,7 +75,7 @@ VM_S6_RC_FILES = \
>> etc/s6-rc/sysctl/type \
>> etc/s6-rc/sysctl/up
>>
>> -build/etc/s6-rc: $(VM_S6_RC_FILES)
>> +build/etc/s6-rc/compiled: $(VM_S6_RC_FILES)
>> mkdir -p $$(dirname $@)
>> rm -rf $@
>>
>> diff --git a/vm/sys/net/etc/s6-linux-init/scripts/rc.init b/vm/sys/net/etc/s6-linux-init/scripts/rc.init
>> index eaf037ec123afcaeafced93096c4f35c2388f385..bcb65cb3039cf9dcfde726ffdd4126c00c0e5641 100755
>> --- a/vm/sys/net/etc/s6-linux-init/scripts/rc.init
>> +++ b/vm/sys/net/etc/s6-linux-init/scripts/rc.init
>> @@ -7,7 +7,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 { mkdir -p /dev/pts /dev/shm }
>> if { mount -a }
>>
>> --
>> 2.51.0

--
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]