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 BD2F9138A8; Wed, 17 Sep 2025 11:44:31 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 63E381387B; Wed, 17 Sep 2025 11:44:29 +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-a7-smtp.messagingengine.com (fout-a7-smtp.messagingengine.com [103.168.172.150]) by atuin.qyliss.net (Postfix) with ESMTPS id 82A161388C for ; Wed, 17 Sep 2025 11:44:28 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id B7442EC02D7; Wed, 17 Sep 2025 07:44:27 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Wed, 17 Sep 2025 07:44:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=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=1758109467; x=1758195867; bh=AvKa3t+SK5 i8dOIBUnM4Q09/9DTpYoex3F/azfd5V3g=; b=S099waQvq/+4p8xE6y8o+Hue5O p9XLEDAw8z7xF9p+nVudZaKqcG9SIg17Fi6RnZZYvuq3fz4c8H3A5tsmXOOQALap WQ3vii9FhZnKQrSmWFWi/bvWLRx6qHZ+BDvfIQktsPxzs02dmiJnCZaTmu4zaR23 xJRMeEjNpEl0Y/TFGmvsnyVP/u5LSFVro4NIGC1hJAN+OlVqyYyOGomthNupYfEu GlnL18h3UaxahK6mbKdggBn+cRzR1dH3bdQKd12y9VCW8n7X7Vxm/dtvP1z//Fyv Dh70S5JpjJGJZtohbqG/Sa65m4arNXOzpq+iYRw6Wh0TcKOcgaGbWZ09vE9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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= 1758109467; x=1758195867; bh=AvKa3t+SK5i8dOIBUnM4Q09/9DTpYoex3F/ azfd5V3g=; b=mrMTHrXbzc9TzjGg3EfpvN78n31Lv+lId37W1baKMlxjpNEmFhX YoFL/PWzA2qmQzsFnGx3OELQB30NzlzRHtItuCKDc5hIzHHIVpUzJyLPL78c9QbD VfOTMkvrigmzBoNSu5vKijk1sEoQy+O9Rz1uj30rY+VwGyEkwoHtzq/V2WUz3RbL Htw6Ehr3TvrukCcfvtwiSGvp/wn2iJZmTqKodQom+hvmxGJK0Iuld6OUx3ENeBcE fJ+qOAQvvakZAuK6vHQ1W5woa6aSiFclyEBhXGbvpX+LtAKO5lDFoaQzGlRc6wIp OigkpqN99oB04rgBxSziap83KzM7NbN/SUA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdegfeefiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvffujghffffkgggtsehgtderredttddtnecuhfhrohhmpeetlhihshhsrgcutfho shhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpeelgeduieejie evvdfguddugffgtddvffdtteehgfeiveegudekvefhgfekkedvffenucffohhmrghinhep khgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhephhhisegrlhihshhsrgdrihhspdhnsggprhgtphhtthhopedvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopeguvghmihhosggvnhhouhhrsehgmhgrihhlrd gtohhmpdhrtghpthhtohepuggvvhgvlhesshhpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 Sep 2025 07:44:27 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 2A67E1F50F8A; Wed, 17 Sep 2025 13:44:16 +0200 (CEST) From: Alyssa Ross To: Demi Marie Obenour , Spectrum OS Development Subject: Re: [PATCH 1/3] host/initramfs: Use util-linux switch_root In-Reply-To: <20250914-util-linux-switch-root-v1-1-9cf9349cbca3@gmail.com> References: <20250914-util-linux-switch-root-v1-0-9cf9349cbca3@gmail.com> <20250914-util-linux-switch-root-v1-1-9cf9349cbca3@gmail.com> Date: Wed, 17 Sep 2025 13:44:15 +0200 Message-ID: <87seglxq0g.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: HO2ZCDNQS3JZA3SMNVBFE2NUQTG76O34 X-Message-ID-Hash: HO2ZCDNQS3JZA3SMNVBFE2NUQTG76O34 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 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: > Busybox switch_root doesn't move /proc, /dev, and /sys mounts, whereas > the switch_root from util-linux does. > > Signed-off-by: Demi Marie Obenour > --- > host/initramfs/default.nix | 3 ++- > host/initramfs/etc/init | 4 ---- > 2 files changed, 2 insertions(+), 5 deletions(-) So on the whole, I'm in favour of getting rid of Busybox wherever possible, because its implementations tend to be bad. In the case of initramfs though, the potential for unexpected circumstances is very constrained, and we need something to implement mkfifo, head, kill, and rm. So given we're using Busybox for that anyway, we might as well use Busybox's smaller implementation of switch_root, right? > diff --git a/host/initramfs/default.nix b/host/initramfs/default.nix > index 1123feacc7533abaf079d84b04a269f784eb43b5..28378da220bb61a51e58b8b25= 846097f08746f5f 100644 > --- a/host/initramfs/default.nix > +++ b/host/initramfs/default.nix > @@ -43,6 +43,7 @@ let > CONFIG_MODINFO n > CONFIG_MODPROBE n > CONFIG_RMMOD n > + CONFIG_SWITCH_ROOT n > ''; > }) > ]; > @@ -56,7 +57,7 @@ let > # TODO: this is a hack and we should just build the util-linux > # programs we want. > # https://lore.kernel.org/util-linux/87zgrl6ufb.fsf@alyssa.is/ > - cp ${util-linuxMinimal}/bin/{findfs,lsblk} $out/bin > + cp ${util-linuxMinimal}/bin/{findfs,lsblk,switch_root} $out/bin > ''; >=20=20 > microcode =3D runCommand "microcode.cpio" { > diff --git a/host/initramfs/etc/init b/host/initramfs/etc/init > index 719488741b6d31564c2c17c0e41f15d16b1c0a08..b3c5b7fbcf45e9646cf0404bc= 44dac58aa2dfe24 100755 > --- a/host/initramfs/etc/init > +++ b/host/initramfs/etc/init > @@ -45,9 +45,5 @@ background { rm /dev/rootfs /dev/verity } > if { mount /dev/mapper/root-verity /mnt/root } > wait { $mdevd_pid } >=20=20 > -if { mount --move /proc /mnt/root/proc } > -if { mount --move /sys /mnt/root/sys } > -if { mount --move /dev /mnt/root/dev } > - > switch_root /mnt/root > /etc/init > > --=20 > 2.51.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaMqfDwAKCRBbRZGEIw/w oiWVAQCjxf8JbmdeAhTkIH0U7Vh2Sc7iy/8JBLE9a1epYdstiwEAu4vR5kL1YfD7 zpEK+xcoV0usK4Pdy1ZFq4FBDuYNWAo= =MXM/ -----END PGP SIGNATURE----- --=-=-=--