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>, devel@spectrum-os.org
Subject: Re: [PATCH 1/5] host/rootfs: make passwd and group links into /run
Date: Tue, 9 Dec 2025 06:03:38 -0500	[thread overview]
Message-ID: <42381a54-0c2b-47a1-bf38-a4da16e2c6bb@gmail.com> (raw)
In-Reply-To: <87wm2vkjmz.fsf@alyssa.is>


[-- 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 --]

  reply	other threads:[~2025-12-09 11:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09  8:56 [PATCH 1/5] host/rootfs: make passwd and group links into /run Alyssa Ross
2025-12-09  8:56 ` [PATCH 2/5] host/rootfs: install shadow Alyssa Ross
2025-12-09  8:56 ` [PATCH 3/5] host/rootfs: move Wayland out of XDG_RUNTIME_DIR Alyssa Ross
2025-12-09  8:56 ` [PATCH 4/5] host/rootfs: weston: add XDG_RUNTIME_DIR note Alyssa Ross
2025-12-09  8:56 ` [PATCH 5/5] host/rootfs: add wayland group Alyssa Ross
2025-12-09 10:55   ` Demi Marie Obenour
2025-12-09 10:59     ` Alyssa Ross
2025-12-09 11:02       ` Demi Marie Obenour
2025-12-09 11:09         ` Alyssa Ross
2025-12-09 10:42 ` [PATCH 6/6] host/rootfs: run crosvm device gpu as non-root Alyssa Ross
2025-12-09 10:52 ` [PATCH 1/5] host/rootfs: make passwd and group links into /run Demi Marie Obenour
2025-12-09 10:57   ` Alyssa Ross
2025-12-09 11:03     ` Demi Marie Obenour [this message]
2025-12-09 11:11       ` Alyssa Ross
2025-12-09 11:15         ` 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=42381a54-0c2b-47a1-bf38-a4da16e2c6bb@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).