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 0D6B9A1D9; Sun, 30 Aug 2026 06:45:06 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id EE689A245; Sun, 30 Aug 2026 06:45:04 +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.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mail-yx1-xb12a.google.com (mail-yx1-xb12a.google.com [IPv6:2607:f8b0:4864:20::b12a]) by atuin.qyliss.net (Postfix) with ESMTPS id 63DC4A243 for ; Sun, 30 Aug 2026 06:45:04 +0000 (UTC) Received: by mail-yx1-xb12a.google.com with SMTP id 956f58d0204a3-66d23c88af0so898888d50.1 for ; Sat, 29 Aug 2026 23:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788072303; x=1788677103; darn=spectrum-os.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=AlsWchy1ww9vJmQAMAaHAwnFkel/E7/G5BKAuAGHdUA=; b=VPrs468sIA1vHXJolBu2iKvWkupdWiSE5AEeN6A67FK5ggFgyfOoIdyfoNujWMK4yc 1FbWgKTBL1vd4FbFeXXHzrS94aWIM/5ryYNNeXAwQBIGhwTZ9hzx/D8qqlSEh+3xQ4Z/ DVbemC7QjpdRC8mEqzs9UNECSI1biRy64c0HAFUliDSRPsl+AJ/b7rJVnCiPN0ONuwE7 rmUdTh6Z8l7yxDLtuBxKvuwzRBLasq/hP1QhIYZ0nVqhWpl2y9B1kPxDgqi3dn141Bd6 W15prAeTvet7akovzc0qnkw3331b6r1wD4/+UO1OXfV3X8n5DNhEuKcpQxCI9uweJuLX VJnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788072303; x=1788677103; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=AlsWchy1ww9vJmQAMAaHAwnFkel/E7/G5BKAuAGHdUA=; b=DwzgU/xu6FfgPX3BDelAA7VNheJot67jba6NS7w6xoQWnFyL9QhGi7GNMSQCV+p5Vu B9NW7l5raWP8IKwjsTVDdfcmkBc9sN+5yqlsLODk63yUvj9McIKH2j50ul7Xc8mTF47d NbMXdNa1670/fYAlyHQLktBhAaoxD1bFbdeNJ0+v8jhemxxb6xcaLVG3mYROO7yjL4Oi UwuYXTeLAombK4GrZTNcZDZ8DWC1p4+FRkEQtiwKzyRTiGTAHKdcZWFhqEAHfHG2bcA6 sNB+q26mviLFw8+ptRCBh6+X2XH3qNc1B4AQuww9QCt4TvPh9hXaJfCNBDa2kocILGBR VxNQ== X-Gm-Message-State: AFuF++lbaIwBytB66Zu8jAbi3nvc41jbOZyi7cgZFt0D7sm3NbU7c35h rfU3pXDa0P8e3meJfU1wsYkX9Y0Ye62KygDczdzhlPan8aIH1dU3lpipsTdNWQ== X-Gm-Gg: AYBFou215FHQYUWv0xAly9m6OMkeMoWtbQY0Z3jqUi8Y7EgR3pkfRXxOacn7o+/sqpb bbpfQwGUFhGhhq9Epm1bgs5QZ1caFI/npSOSzPx5/0v2SS3DlwXv0gJvDgXICVAYamez0u5+L5/ MNJuOoikdeK7JDOOo+LP4MpZXAd/NoDEuMc9wnX/2XVokrUchtQb8k+gquVLO1aX8WuOgiB/57e nK+ey3MNa6BF+sURgqeu2DQRCDeQ1dUTz+RvOZ+px4cEvv7/SwpPX2kQymJXmqAsHfIc+cRTKdj A4X25HhzbS3RwSTGoULSEk6Z964kVWHneRkZUMaYGtQ81j/P3TQUjnle1tjH0glK/9KyWeU2gKt NneBHSH0LkIIZOsvgtut9T22KhKuDSWbEqMAfMnSnwGoNJTn0VyWbntxE66TKeKFUw9SR+xSCnE rv6KwI91fEGfmuPrbkuNX+klKIGDqTfDbrLejKEUUF6n6nSAe32S1i/h9CQcB8fVGYPCgMJIi/7 g== X-Received: by 2002:a05:690e:44da:b0:668:17c4:1636 with SMTP id 956f58d0204a3-66e4c6ce6c9mr4186070d50.31.1788072303147; Sat, 29 Aug 2026 23:45:03 -0700 (PDT) Received: from localhost.localdomain ([185.98.168.14]) by smtp.gmail.com with UTF8SMTPSA id 956f58d0204a3-66e4eb56b6dsm3618761d50.7.2026.08.29.23.45.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2026 23:45:01 -0700 (PDT) From: Demi Marie Obenour Date: Sun, 30 Aug 2026 02:06:35 -0400 Subject: [PATCH v8 01/18] host/rootfs: Mount filesystems before s6-rc-init MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260830-cgroups-v8-1-239b09ba7013@gmail.com> References: <20260830-cgroups-v8-0-239b09ba7013@gmail.com> In-Reply-To: <20260830-cgroups-v8-0-239b09ba7013@gmail.com> To: Spectrum OS Development X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788069995; l=2434; i=demiobenour@gmail.com; s=20250729; h=from:subject:message-id; bh=jmfORfexXZaFkOAhN/ymO1GFsl+nYbqIaE6Q7oh6rYo=; b=6UyY60zErXiaM+D1ES3d4cIuSAbW9Y5zHdm4yjnpJ55nhW5vvPTo6HdlUhZQANRL0nedxkjTc iCQw0TYkUiQAlhaT/9pklUrCZThbzdWeg0CSI2ZiOnAt6n+tF04ooAB X-Developer-Key: i=demiobenour@gmail.com; a=ed25519; pk=X57Q4/YQDj9t4SBeKaDwvXYKB6quZJVx/DE2Ly2out0= Message-ID-Hash: 6XCJXZDGAEUOU5BEJQX2C2MLTE5IP34Y X-Message-ID-Hash: 6XCJXZDGAEUOU5BEJQX2C2MLTE5IP34Y X-MailFrom: demiobenour@gmail.com X-Mailman-Rule-Hits: member-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; 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; emergency CC: Demi Marie Obenour , Alyssa Ross X-Mailman-Version: 3.3.10 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: cgroup-setup, a tool which will be introduced in a later patch, is written in Rust and uses the Rust standard library. It also relies on cgroupfs being mounted at /sys/fs/cgroup. Furthermore, it runs very, *very* early on, since it sets up the cgroups in which s6-svscan and s6-supervise processes run. This allows setting up sub-cgroups without having to worry about name collisions. While it would be possible to only mount the bare minimum necessary, it's simpler to just mount everything before starting any services. These mounts are all pseudo-filesystems or tmpfs instances, and none have any dependencies. Signed-off-by: Demi Marie Obenour Reviewed-by: Alyssa Ross --- host/rootfs/image/etc/init | 11 ++++++++++- host/rootfs/image/etc/s6-linux-init/scripts/rc.init | 7 ------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/host/rootfs/image/etc/init b/host/rootfs/image/etc/init index db8a6d9c747e3d212c21b6c983c8f7e299822abe..8ec7859ab00e24007a93d4000c8f34e353de50ae 100755 --- a/host/rootfs/image/etc/init +++ b/host/rootfs/image/etc/init @@ -1,6 +1,15 @@ #!/bin/execlineb -Ws0 # SPDX-License-Identifier: EUPL-1.2+ -# SPDX-FileCopyrightText: 2022 Alyssa Ross +# SPDX-FileCopyrightText: 2020-2022, 2024 Alyssa Ross /bin/setpriv --no-new-privs -- + +if { /bin/ln -s /proc/self/fd /dev } +if { /bin/ln -s /proc/self/fd/0 /dev/stdin } +if { /bin/ln -s /proc/self/fd/1 /dev/stdout } +if { /bin/ln -s /proc/self/fd/2 /dev/stderr } + +if { /bin/mount --make-shared / } +if { /bin/mount -a --mkdir } + /bin/s6-linux-init -c /etc/s6-linux-init -s /run/param -- $@ diff --git a/host/rootfs/image/etc/s6-linux-init/scripts/rc.init b/host/rootfs/image/etc/s6-linux-init/scripts/rc.init index f638e373589884acb959c868462fdf532380a851..db766ba0ca0a11982f5b55497c17eaf5e95afb2c 100755 --- a/host/rootfs/image/etc/s6-linux-init/scripts/rc.init +++ b/host/rootfs/image/etc/s6-linux-init/scripts/rc.init @@ -4,13 +4,6 @@ if { s6-rc-init -c /etc/s6-rc /run/service } -if { ln -s /proc/self/fd /dev } -if { ln -s /proc/self/fd/0 /dev/stdin } -if { ln -s /proc/self/fd/1 /dev/stdout } -if { ln -s /proc/self/fd/2 /dev/stderr } - -if { mount --make-shared / } if { mount --make-shared /run } -if { mount -a --mkdir } s6-rc change ok-all -- 2.55.0