From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 5B84521A28; Fri, 19 Sep 2025 17:53:52 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 085E421A89; Fri, 19 Sep 2025 17:53:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) by atuin.qyliss.net (Postfix) with ESMTPS id C984821A88 for ; Fri, 19 Sep 2025 17:53:48 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id B5BA21D000EE; Fri, 19 Sep 2025 13:53:47 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Fri, 19 Sep 2025 13:53:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1758304427; x=1758390827; bh=815bwfTP6z YmWyTC/NODZ7weMiaHmwd2EtzB8ivTunQ=; b=SaPyOg+yC9JbU0FKkDXXVwHDzI RVq+BC6o5l47s4zgq2QhM8zwjCUlzEsSFtJW6rPn7Mt6hm0upoYMDgGf+dvDQwIC hxgGrOGuikbunzirD5DwpvQLMzSW6ozfVyXwKYBoahQrI8qJ45p+xWs7fTBxWTwr +MW0KRI45FZKRSqXWaviZuB35N1Vu9tSEKQAeuFyqYcGE0d8eweFYV9u18aOhb7N ruM0Uy2YqdJjbCvUdZVsbEF0WIAbbYBc2/J57d33FFTBIs0fR+whcFa44dSwa0JU ryghkyDV43fbZ8zn6PbpWHqiS3aRpC7HaQDdao2/ly4a52Um7RgtRtYqxxLg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1758304427; x=1758390827; bh=815bwfTP6zYmWyTC/NODZ7weMiaHmwd2Etz B8ivTunQ=; b=eKf5V7rngaxSaIMogqNaNrzQDh2hlpMWxA/X69PbSQ8k0/km1YX cfWPym00vf3HDphGaKXuD4k+TlhlPQklmznMKvwpfROFe9XHx/tVGpGOF8qN8l1J /TyPbL2katMQamM4Uk23zGTgDjWfTMOXj8nlANoXrhrCY7TbY4I6WXa/B1h2i3vX J/lHOuNdK5buBieRXMg0SsFrEataccp7aAr4PsBGeb+/0mF3Szcz6UmyFajO5DDV a6AoVTk4WuHqc9K+c92lpUbsg+Vru4ZHIdQNT5kI/Kz317piTaS0BVCp9WtDszCx 01eBlEQmY2WvKrKuIefLD7+7YarIrFahhDg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdegleekiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufgjfhffkfggtgesghdtreertddttdenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepieduffeuie elgfetgfdttddtkeekheekgfehkedufeevteegfeeiffetvdetueevnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrih hspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegu vghmihhosggvnhhouhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvvhgvlhessh hpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 19 Sep 2025 13:53:47 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 232781FD4F9D; Fri, 19 Sep 2025 19:53:46 +0200 (CEST) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 08/20] Standardize directories and symlinks in images In-Reply-To: References: <20250904-systemd-v1-0-2a63b790a913@gmail.com> <20250904-systemd-v1-8-2a63b790a913@gmail.com> <87plc1jp5f.fsf@alyssa.is> Date: Fri, 19 Sep 2025 19:53:45 +0200 Message-ID: <87zfaqqqfq.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: OACAKJZGMSI4VAQP6KALWOQRVPQPMJUO X-Message-ID-Hash: OACAKJZGMSI4VAQP6KALWOQRVPQPMJUO X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Spectrum OS Development X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Demi Marie Obenour writes: > On 9/8/25 04:59, Alyssa Ross wrote: >> Demi Marie Obenour writes: >>=20 >>> DIRS =3D \ >>> - dev \ >>> etc/s6-linux-init/env \ >>> etc/s6-linux-init/run-image/configs \ >>> etc/s6-linux-init/run-image/service/dbus/instance \ >>> @@ -90,14 +89,11 @@ DIRS =3D \ >>> etc/s6-linux-init/run-image/service/xdg-desktop-portal-spectrum-host/= instances \ >>> etc/s6-linux-init/run-image/service/xdg-desktop-portal-spectrum-host/= template/data \ >>> etc/s6-linux-init/run-image/service/xdg-desktop-portal-spectrum-host/= template/env \ >>> - etc/s6-linux-init/run-image/user \ >>> etc/s6-linux-init/run-image/vm/by-id \ >>> etc/s6-linux-init/run-image/vm/by-name \ >>> etc/s6-linux-init/run-image/wait \ >>> ext \ >>> - run \ >>> - proc \ >>> - sys \ >>> + root \ >>=20 >> I'm not sure what we'd want /root for? Root's home directory is /. > > It is certainly /root on my systems. > On Spectrum it is not, because there's no need for an extraneous, empty, read-only directory: root:x:0:0:System administrator:/:/bin/sh >>> diff --git a/scripts/make-erofs.sh b/scripts/make-erofs.sh >>> index d566a4ac7b30f55338fe9b8b6a94702686f6ddd1..5196394d405310971659b0d= bc0c91cfcaaaf9118 100755 >>> --- a/scripts/make-erofs.sh >>> +++ b/scripts/make-erofs.sh >>> @@ -115,5 +115,39 @@ find "$root" \ >>> find "$root/etc" "$root/var" ! -type l -execdir chmod u+w,go-w,ugo+rX = -- '{}' + >>> chmod 0755 "$root" >>>=20=20 >>> +# Fix permissions on / so that the subsequent commands work >>> +chmod 0755 "$root" >>> + >>> +# Create the basic mount points for pseudo-filesystems and tmpfs files= ystems. >>> +# These should always be mounted over, so use 0400 permissions for the= m. >>> +# 0000 would be better, but it breaks mkfs.erofs as it tries to open t= he >>> +# directories for reading. >>> +mkdir -m 0400 "$root/dev" "$root/proc" "$root/run" "$root/sys" "$root/= tmp" >>> + >>> +# Cause s6-linux-init to create /run/lock and /run/user >>> +# with the correct mode (0755) and create /home, >>> +# /var/cache, /var/log, and /var/spool directly. >>> +mkdir -m 0755 \ >>> + "$root/etc/s6-linux-init/run-image/lock" \ >>> + "$root/etc/s6-linux-init/run-image/user" \ >>> + "$root/home" \ >>> + "$root/var/cache" \ >>> + "$root/var/log" \ >>> + "$root/var/spool" >>> + >>> +# Create symbolic links that are always expected to exist. >>> +chmod 0755 "$root/usr" >>> +ln -s ../proc/self/mounts "$root/etc/mtab" >>> +ln -s ../run "$root/var/run" >>> +ln -s ../run/lock "$root/var/lock" >>> +ln -s ../tmp "$root/var/tmp" >>> +ln -s bin "$root/usr/sbin" >>> +ln -s lib "$root/usr/lib64" >>=20 >> This doesn't seem right as a generic thing. Nix-built binaries won't >> ever need this. It's only in img/app for AppImage etc. compatibility. >> Not relevant to other images. > > I decided it was better to add all of these now to avoid any sort of > problems later on. The size impact is tiny and the cost of debugging > a problem later on would not be. In particular, contributors not so > used to NixOS might assume these exist. I think they'll very quickly figure it out. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaM2YqQAKCRBbRZGEIw/w ophbAP42eA9eP2Sk02baEmUwRUMT1uQDui7LiSYBsXMLH4DneQD/cHiN6Pp8dJOE bKNnbkvSEGm37wpcRqSBFbPJvYT8EQQ= =HTCV -----END PGP SIGNATURE----- --=-=-=--