patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Demi Marie Obenour <demiobenour@gmail.com>
To: Alyssa Ross <hi@alyssa.is>,
	Spectrum OS Development <devel@spectrum-os.org>
Subject: Re: [PATCH v5 2/8] img/app: Use separate service to create directories
Date: Tue, 22 Jul 2025 19:48:35 -0400	[thread overview]
Message-ID: <d2d728b7-b576-4197-a93b-98beabc53460@gmail.com> (raw)
In-Reply-To: <871pq9nbl4.fsf@alyssa.is>


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

On 7/21/25 05:21, Alyssa Ross wrote:
> Demi Marie Obenour <demiobenour@gmail.com> writes:
> 
>> The app, D-Bus, and wayland-proxy-virtwl all rely on /run/user and
>> /run/user/0 to exist.  The app and wayland-proxy-virtwl also relies on
>> /tmp/.X11-unix existing.  Move the directory creation to a oneshot
>> service that other services rely on.
>>
>> Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
>> ---
>>  img/app/Makefile                                      |  5 +++++
>>  img/app/etc/s6-rc/app/dependencies.d/directories      |  0
>>  img/app/etc/s6-rc/dbus/dependencies.d/directories     |  0
>>  img/app/etc/s6-rc/directories/type                    |  1 +
>>  img/app/etc/s6-rc/directories/type.license            |  2 ++
>>  img/app/etc/s6-rc/directories/up                      | 10 ++++++++++
>>  .../wayland-proxy-virtwl/dependencies.d/directories   |  0
>>  img/app/etc/s6-rc/wayland-proxy-virtwl/run            | 11 -----------
>>  8 files changed, 18 insertions(+), 11 deletions(-)
>>  create mode 100644 img/app/etc/s6-rc/app/dependencies.d/directories
>>  create mode 100644 img/app/etc/s6-rc/dbus/dependencies.d/directories
>>  create mode 100644 img/app/etc/s6-rc/directories/type
>>  create mode 100644 img/app/etc/s6-rc/directories/type.license
>>  create mode 100644 img/app/etc/s6-rc/directories/up
>>  create mode 100644 img/app/etc/s6-rc/wayland-proxy-virtwl/dependencies.d/directories
>>
>> diff --git a/img/app/Makefile b/img/app/Makefile
>> index 80ef37ddf0c44636813725bd499e4ea5fad03c06..e11be09a3c6ca801d9211e49b58e3d05d57e344e 100644
>> --- a/img/app/Makefile
>> +++ b/img/app/Makefile
>> @@ -82,12 +82,16 @@ build/rootfs.erofs: ../../scripts/make-erofs.sh $(PACKAGES_FILE) $(VM_FILES) $(V
>>  
>>  VM_S6_RC_FILES = \
>>  	etc/s6-rc/app/dependencies.d/dbus \
>> +	etc/s6-rc/app/dependencies.d/directories \
>>  	etc/s6-rc/app/dependencies.d/wayland-proxy-virtwl \
>>  	etc/s6-rc/app/run \
>>  	etc/s6-rc/app/type \
>> +	etc/s6-rc/dbus/dependencies.d/directories \
>>  	etc/s6-rc/dbus/notification-fd \
>>  	etc/s6-rc/dbus/run \
>>  	etc/s6-rc/dbus/type \
>> +	etc/s6-rc/directories/type \
>> +	etc/s6-rc/directories/up \
>>  	etc/s6-rc/mdevd-coldplug/dependencies \
>>  	etc/s6-rc/mdevd-coldplug/type \
>>  	etc/s6-rc/mdevd-coldplug/up \
>> @@ -96,6 +100,7 @@ VM_S6_RC_FILES = \
>>  	etc/s6-rc/mdevd/type \
>>  	etc/s6-rc/ok-all/contents \
>>  	etc/s6-rc/ok-all/type \
>> +	etc/s6-rc/wayland-proxy-virtwl/dependencies.d/directories \
>>  	etc/s6-rc/wayland-proxy-virtwl/notification-fd \
>>  	etc/s6-rc/wayland-proxy-virtwl/run \
>>  	etc/s6-rc/wayland-proxy-virtwl/type
>> diff --git a/img/app/etc/s6-rc/app/dependencies.d/directories b/img/app/etc/s6-rc/app/dependencies.d/directories
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
>> diff --git a/img/app/etc/s6-rc/dbus/dependencies.d/directories b/img/app/etc/s6-rc/dbus/dependencies.d/directories
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
>> diff --git a/img/app/etc/s6-rc/directories/type b/img/app/etc/s6-rc/directories/type
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..bdd22a1850ae6c03a414eeb8084998679a2cdf92
>> --- /dev/null
>> +++ b/img/app/etc/s6-rc/directories/type
>> @@ -0,0 +1 @@
>> +oneshot
>> diff --git a/img/app/etc/s6-rc/directories/type.license b/img/app/etc/s6-rc/directories/type.license
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..c4a0586a407fe14c3e0855749a7524ac3871dda4
>> --- /dev/null
>> +++ b/img/app/etc/s6-rc/directories/type.license
>> @@ -0,0 +1,2 @@
>> +SPDX-License-Identifier: CC0-1.0
>> +SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
>> diff --git a/img/app/etc/s6-rc/directories/up b/img/app/etc/s6-rc/directories/up
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..0ce4a06a37077cef8881d45382a81950e164560f
>> --- /dev/null
>> +++ b/img/app/etc/s6-rc/directories/up
>> @@ -0,0 +1,10 @@
>> +#!/bin/execlineb -P
>> +# SPDX-License-Identifier: EUPL-1.2+
>> +# SPDX-FileCopyrightText: 2023-2024 Alyssa Ross <hi@alyssa.is>
>> +#
>> +# Directory creation (if it's copyrightable):
>> +# SPDX-License-Identifier: MIT
>> +# SPDX-FileCopyrightText: 2022 Unikie
>> +
>> +if { mkdir /run/user /tmp/.X11-unix }
>> +if { mkdir -m 0700 /run/user/0 }
> 
> Since you've basically rewritten this, let's reset the copyright here.
> 
> We could also create /run/user in VM_DIRS in the Makefile, like we
> already do for /run/service — probably good to keep that consistent when
> we don't have reasons not to like a special mode.

For v6, my plan is:

- Create /run/user and /run/wait in the Makefile via VM_DIRs.
  Make the corresponding change on the host too.
- Have /run/user/0 be a separate tmpfs mount created in /etc/fstab.
  This is for consistency with systemd-based systems, which automatically
  create such a mount.  If you prefer, I can use mkdir in rc.init instead.
- Create the X11 directories (/tmp/.*-unix) in rc.init before starting
  any services.

Should these be a single patch or in separate ones?  I know that it is
normally best to separate them out, but these patches are all tiny compared
to the giant patch that follows them.
-- 
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 --]

  reply	other threads:[~2025-07-22 23:48 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-11  2:44 [PATCH v3] Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-14 14:54 ` Alyssa Ross
2025-07-15 20:22   ` Demi Marie Obenour
2025-07-16 10:26     ` Alyssa Ross
2025-07-16 21:16   ` Demi Marie Obenour
2025-07-16 21:27     ` Demi Marie Obenour
2025-07-18 12:16       ` Alyssa Ross
2025-07-17  5:53   ` Demi Marie Obenour
2025-07-18 10:02     ` Alyssa Ross
2025-07-18 10:19       ` Alyssa Ross
2025-07-18  2:07 ` [PATCH v4 0/3] Sound support in Spectrum VMs Demi Marie Obenour
2025-07-18  2:13   ` [PATCH v4 1/3] Rebuild the root filesystem when the makefile changes Demi Marie Obenour
2025-07-18 11:14     ` Alyssa Ross
2025-07-18  2:13   ` [PATCH v4 2/3] Fix permissions on /tmp Demi Marie Obenour
2025-07-18 11:51     ` Alyssa Ross
2025-07-18 11:51     ` Alyssa Ross
2025-07-18 11:53     ` Alyssa Ross
2025-07-18  2:14   ` [PATCH v4 3/3] Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-18 11:27     ` Alyssa Ross
2025-07-18 17:59       ` Demi Marie Obenour
2025-07-19  9:22         ` Alyssa Ross
2025-07-19 20:05           ` Demi Marie Obenour
2025-07-19  8:06     ` Alyssa Ross
2025-07-19 20:03       ` Demi Marie Obenour
2025-07-19 20:07         ` Demi Marie Obenour
2025-07-20  7:50           ` Alyssa Ross
2025-07-20 17:58   ` [PATCH v5 0/8] Sound support in Spectrum VMs Demi Marie Obenour
2025-07-20 18:02     ` [PATCH v5 1/8] Revert "img/app: fix permissions on /tmp" Demi Marie Obenour
2025-07-21  9:34       ` Alyssa Ross
2025-07-20 18:03     ` [PATCH v5 2/8] img/app: Use separate service to create directories Demi Marie Obenour
2025-07-21  9:21       ` Alyssa Ross
2025-07-22 23:48         ` Demi Marie Obenour [this message]
2025-07-20 18:04     ` [PATCH v5 3/8] img/app: Fix permissions of /tmp/.X11-unix Demi Marie Obenour
2025-07-20 18:05     ` [PATCH v5 4/8] img/app: Create other X11 directories Demi Marie Obenour
2025-07-21  9:23       ` Alyssa Ross
2025-07-21 19:03         ` Demi Marie Obenour
2025-07-20 18:06     ` [PATCH v5 5/8] img/app: Be explicit about directory modes Demi Marie Obenour
2025-07-20 18:08     ` [PATCH v5 6/8] img/app: create /run/user and /run/wait very early in boot Demi Marie Obenour
2025-07-21  9:23       ` Alyssa Ross
2025-07-20 18:10     ` [PATCH v5 7/8] host/rootfs: " Demi Marie Obenour
2025-07-20 18:11     ` [PATCH v5 8/8] img/app: Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-21  9:42       ` Alyssa Ross
2025-07-21 19:09         ` Demi Marie Obenour
2025-07-26 10:11           ` Alyssa Ross
2025-07-21 19:10         ` Demi Marie Obenour
2025-07-24 22:15     ` [PATCH v6 0/5] Sound support in Spectrum VMs Demi Marie Obenour
2025-07-24 22:30       ` [PATCH v6 1/5] host/rootfs: Create /run/user and /run/wait via run-image Demi Marie Obenour
2025-07-26 10:46         ` Alyssa Ross
2025-07-24 22:32       ` [PATCH v6 2/5] img/app: " Demi Marie Obenour
2025-07-24 22:33       ` [PATCH v6 3/5] img/app: tell mount(8) to create directories Demi Marie Obenour
2025-07-26 11:20         ` Alyssa Ross
2025-07-26 11:26         ` Alyssa Ross
2025-07-24 22:35       ` [PATCH v6 4/5] img/app: Create needed directories in early boot Demi Marie Obenour
2025-07-26 10:24         ` Alyssa Ross
2025-07-27 20:13           ` Demi Marie Obenour
2025-07-24 22:36       ` [PATCH v6 5/5] img/app: Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-26 11:29         ` Alyssa Ross
2025-07-26 10:57       ` [PATCH v6 0/5] Sound support in Spectrum VMs Alyssa Ross
2025-07-28  5:57       ` [PATCH v7 0/2] " Demi Marie Obenour
2025-07-28  6:01         ` [PATCH v7 1/2] img/app: Create needed directories in early boot Demi Marie Obenour
2025-07-28  6:03         ` [PATCH v7 2/2] img/app: Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-28  6:18           ` Demi Marie Obenour
2025-07-28 23:13         ` [PATCH v8 0/2] Sound support in Spectrum VMs Demi Marie Obenour
2025-07-29  0:32           ` [PATCH v9 " Demi Marie Obenour
2025-07-29  0:33             ` [PATCH v9 1/2] img/app: Create needed directories in early boot Demi Marie Obenour
2025-07-29 12:44               ` Alyssa Ross
2025-07-29  0:33             ` [PATCH v9 2/2] img/app: Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-29 13:08               ` Alyssa Ross
2025-07-29 21:17                 ` Demi Marie Obenour
2025-07-30  8:10                   ` Alyssa Ross
2025-07-30  9:59             ` [PATCH v10] " Demi Marie Obenour
2025-07-31  9:12               ` Alyssa Ross
2025-07-31  9:40               ` Alyssa Ross
2025-07-31 17:06               ` [PATCH v11] " Demi Marie Obenour
2025-08-01 17:53                 ` Alyssa Ross
2025-08-02  7:54                 ` Alyssa Ross
2025-07-28 23:13         ` [PATCH v8 1/2] img/app: Create needed directories in early boot Demi Marie Obenour
2025-07-28 23:19           ` Demi Marie Obenour
2025-07-28 23:13         ` [PATCH v8 2/2] img/app: Run PipeWire and WirePlumber in the VMs Demi Marie Obenour
2025-07-29 12:41         ` [PATCH v7 0/2] Sound support in Spectrum VMs Alyssa Ross
2025-07-24 22:23     ` [PATCH v6 1/5] host/rootfs: Create /run/user and /run/wait via run-image Demi Marie Obenour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2d728b7-b576-4197-a93b-98beabc53460@gmail.com \
    --to=demiobenour@gmail.com \
    --cc=devel@spectrum-os.org \
    --cc=hi@alyssa.is \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).