Re: [PATCH 1/5] host/rootfs: make passwd and group links into /run

Demi Marie Obenour
2025-12-09T11:03:49Z

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

On 12/9/25 05:57, Alyssa Ross wrote:
> Demi Marie Obenour <demiobenour@gmail.com> writes:
>
>> On 12/9/25 03:56, Alyssa Ross wrote:
>>> This will allow us to give shadow's useradd /run as a prefix, and have
>>> it be able to add users at runtime.
>>>
>>> Signed-off-by: Alyssa Ross <hi@alyssa.is>
>>> ---
>>> host/rootfs/file-list.mk | 6 ++++--
>>> host/rootfs/image/etc/group | 16 +---------------
>>> host/rootfs/image/etc/passwd | 2 +-
>>> .../etc/{ => s6-linux-init/run-image/etc}/group | 0
>>> .../run-image/etc}/group.license | 0
>>> .../etc/{ => s6-linux-init/run-image/etc}/passwd | 0
>>> .../run-image/etc}/passwd.license | 0
>>
>> Is git somehow generating wrong diffstats?
>
> It just generates extremely confusing output when you replace a file
> with a symlink.
>
>>> 7 files changed, 6 insertions(+), 18 deletions(-)
>>> mode change 100644 => 120000 host/rootfs/image/etc/group
>>> mode change 100644 => 120000 host/rootfs/image/etc/passwd
>>> copy host/rootfs/image/etc/{ => s6-linux-init/run-image/etc}/group (100%)
>>> rename host/rootfs/image/etc/{ => s6-linux-init/run-image/etc}/group.license (100%)
>>> copy host/rootfs/image/etc/{ => s6-linux-init/run-image/etc}/passwd (100%)
>>> rename host/rootfs/image/etc/{ => s6-linux-init/run-image/etc}/passwd.license (100%)
>>>
>>> diff --git a/host/rootfs/file-list.mk b/host/rootfs/file-list.mk
>>> index df22bce..6ab78e6 100644
>>> --- a/host/rootfs/file-list.mk
>>> +++ b/host/rootfs/file-list.mk
>>> @@ -4,13 +4,13 @@
>>> FILES = \
>>> image/etc/fonts/fonts.conf \
>>> image/etc/fstab \
>>> - image/etc/group \
>>> image/etc/init \
>>> image/etc/login \
>>> image/etc/parse-devname \
>>> - image/etc/passwd \
>>> image/etc/s6-linux-init/env/WAYLAND_DISPLAY \
>>> image/etc/s6-linux-init/env/XDG_RUNTIME_DIR \
>>> + image/etc/s6-linux-init/run-image/etc/group \
>>> + image/etc/s6-linux-init/run-image/etc/passwd \
>>> image/etc/s6-linux-init/run-image/service/getty-tty1/run \
>>> image/etc/s6-linux-init/run-image/service/getty-tty2/run \
>>> image/etc/s6-linux-init/run-image/service/getty-tty3/run \
>>> @@ -68,6 +68,8 @@ FILES = \
>>>
>>> LINKS = \
>>> image/bin \
>>> + image/etc/group \
>>> + image/etc/passwd \
>>> image/etc/s6-linux-init/run-image/opengl-driver \
>>> image/etc/s6-linux-init/run-image/service/vmm/template/run \
>>> image/lib \
>>> diff --git a/host/rootfs/image/etc/group b/host/rootfs/image/etc/group
>>> deleted file mode 100644
>>> index e3ade46..0000000
>>> --- a/host/rootfs/image/etc/group
>>> +++ /dev/null
>>> @@ -1,15 +0,0 @@
>>> -root:x:0:root
>>> -clock:x:1:
>>> -dialout:x:2:
>>> -kmem:x:3:
>>> -input:x:4:
>>> -tty:x:5:
>>> -video:x:6:
>>> -render:x:7:
>>> -sgx:x:8:
>>> -audio:x:9:
>>> -lp:x:10:
>>> -disk:x:11:
>>> -cdrom:x:12:
>>> -tape:x:13:
>>> -kvm:x:14:
>>
>> Why is this file deleted and not renamed?
>
> git considers it a copy (see below) followed by a deletion and
> replacement with symlink. It is, effectively, renamed.
>
>>> diff --git a/host/rootfs/image/etc/group b/host/rootfs/image/etc/group
>>> new file mode 120000
>>> index 0000000..a9b248e
>>> --- /dev/null
>>> +++ b/host/rootfs/image/etc/group
>>> @@ -0,0 +1 @@
>>> +/run/etc/group
>>
>> ../run/etc/group?
>
> Okay, makes sense.
>
>>> \ No newline at end of file
>>> diff --git a/host/rootfs/image/etc/passwd b/host/rootfs/image/etc/passwd
>>> deleted file mode 100644
>>> index 29f3b25..0000000
>>> --- a/host/rootfs/image/etc/passwd
>>> +++ /dev/null
>>> @@ -1 +0,0 @@
>>> -root:x:0:0:System administrator:/:/bin/sh
>>> diff --git a/host/rootfs/image/etc/passwd b/host/rootfs/image/etc/passwd
>>> new file mode 120000
>>> index 0000000..889bb76
>>> --- /dev/null
>>> +++ b/host/rootfs/image/etc/passwd
>>> @@ -0,0 +1 @@
>>> +/run/etc/passwd
>>
>> ../run/etc/passwd?
>>
>>> \ No newline at end of file
>>> diff --git a/host/rootfs/image/etc/group b/host/rootfs/image/etc/s6-linux-init/run-image/etc/group
>>> similarity index 100%
>>> copy from host/rootfs/image/etc/group
>>> copy to host/rootfs/image/etc/s6-linux-init/run-image/etc/group
>>> diff --git a/host/rootfs/image/etc/group.license b/host/rootfs/image/etc/s6-linux-init/run-image/etc/group.license
>>> similarity index 100%
>>> rename from host/rootfs/image/etc/group.license
>>> rename to host/rootfs/image/etc/s6-linux-init/run-image/etc/group.license
>>> diff --git a/host/rootfs/image/etc/passwd b/host/rootfs/image/etc/s6-linux-init/run-image/etc/passwd
>>> similarity index 100%
>>> copy from host/rootfs/image/etc/passwd
>>> copy to host/rootfs/image/etc/s6-linux-init/run-image/etc/passwd
>>> diff --git a/host/rootfs/image/etc/passwd.license b/host/rootfs/image/etc/s6-linux-init/run-image/etc/passwd.license
>>> similarity index 100%
>>> rename from host/rootfs/image/etc/passwd.license
>>> rename to host/rootfs/image/etc/s6-linux-init/run-image/etc/passwd.license
>>>
>>> base-commit: d0efa283216ebc503b4b715c051518ae7dbd8409
>>
>>
>> --
>> Sincerely,
>> Demi Marie Obenour (she/her/hers)

Assuming I understood the diff correctly, and with relative symlinks:

Reviewed-by: Demi Marie Obenour <demiobenour@gmail.com>
--
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 --]