diff options
| author | Robert Günzler <r@gnzler.io> | 2026-02-10 12:32:48 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2026-02-10 12:41:25 +0100 |
| commit | 63feeb9f369fc6176e85c1c2d8fcc863caad1946 (patch) | |
| tree | 41cd5d2d1ec36e74e464caab722cc9b460153f04 /os/etc/s6-rc/src/mount | |
| parent | 5bd0a4aca65ecb9818ef1285982d160b6b6ff665 (diff) | |
start new
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '')
27 files changed, 0 insertions, 337 deletions
diff --git a/os/etc/s6-rc/src/mount-cgroups/cgroup-release-agent.sh b/os/etc/s6-rc/src/mount-cgroups/cgroup-release-agent.sh deleted file mode 100755 index 0a6ec17..0000000 --- a/os/etc/s6-rc/src/mount-cgroups/cgroup-release-agent.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# This is run by the kernel after the last task is removed from a -# control group in the openrc hierarchy. - -# Copyright (c) 2007-2015 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -cgroup=/sys/fs/cgroup/openrc -PATH=/bin:/usr/bin:/sbin:/usr/sbin -if [ -d ${cgroup}/"$1" ]; then - rmdir ${cgroup}/"$1" -fi diff --git a/os/etc/s6-rc/src/mount-cgroups/dependencies.d/mount-procfs b/os/etc/s6-rc/src/mount-cgroups/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount-cgroups/dependencies.d/mount-procfs +++ /dev/null diff --git a/os/etc/s6-rc/src/mount-cgroups/shell-up b/os/etc/s6-rc/src/mount-cgroups/shell-up deleted file mode 100755 index f26a99e..0000000 --- a/os/etc/s6-rc/src/mount-cgroups/shell-up +++ /dev/null @@ -1,178 +0,0 @@ -#!/bin/sh -# Copyright (c) 2017 The OpenRC Authors. -# See the Authors file at the top-level directory of this distribution and -# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS -# -# This file is part of OpenRC. It is subject to the license terms in -# the LICENSE file found in the top-level directory of this -# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE -# This file may not be copied, modified, propagated, or distributed -# except according to the terms contained in the LICENSE file. - -set -eux - -cgroup_opts=${cgroup_opts:-nodev,noexec,nosuid} -rc_cgroup_mode=${cgroup_mode:-hybrid} -rc_cgroup_controllers=${cgroup_controllers:-} -rc_cgroup_memory_use_hierarchy=${cgroup_memory_use_hierarchy:-no} -rc_cgroupsize=${cgroupsize:-10m} - -yesno() -{ - [ -z "$1" ] && return 1 - - case "$1" in - [Yy][Ee][Ss]|[Tt][Rr][Uu]|[Oo][Nn]|1) return 0 ;; - [Nn][Oo]|[Ff][Aa][Ll][Ss]|[Oo][Ff][Ff]|0) return 1 ;; - esac - - local value= - eval value=\"\$$1\" - case "$value" in - [Yy][Ee][Ss]|[Tt][Rr][Uu]|[Oo][Nn]|1) return 0 ;; - [Nn][Oo]|[Ff][Aa][Ll][Ss]|[Oo][Ff][Ff]|0) return 1 ;; - *) echo "\$$1 is not set properly" >&2; return 2 ;; - esac -} - -cgroup2_find_path() -{ - if grep -qw cgroup2 /proc/filesystems; then - case "${rc_cgroup_mode}" in - hybrid) printf "/sys/fs/cgroup/unified" ;; - unified) printf "/sys/fs/cgroup" ;; - esac - fi - return 0 -} - -cgroup1_base() -{ - grep -qw cgroup /proc/filesystems || return 0 - if ! mountpoint -q /sys/fs/cgroup; then - local opts="${cgroup_opts},mode=755,size=${rc_cgroupsize:-10m}" - mount -n -t tmpfs -o "${opts}" cgroup_root /sys/fs/cgroup - fi - - if ! mountpoint -q /sys/fs/cgroup/openrc; then - local agent="/etc/s6-rc/src/mount-cgroups/cgroup-release-agent.sh" - mkdir /sys/fs/cgroup/openrc - mount -n -t cgroup \ - -o none,${cgroup_opts},name=openrc,release_agent="$agent" \ - openrc /sys/fs/cgroup/openrc - printf 1 > /sys/fs/cgroup/openrc/notify_on_release - fi - return 0 -} - -cgroup1_controllers() -{ - yesno "${rc_controller_cgroups:-YES}" && [ -e /proc/cgroups ] && - grep -qw cgroup /proc/filesystems || return 0 - while read -r name _ _ enabled _; do - case "${enabled}" in - 1) mountpoint -q "/sys/fs/cgroup/${name}" && continue - local x - for x in $rc_cgroup_controllers; do - [ "${name}" = "blkio" ] && [ "${x}" = "io" ] && - continue 2 - [ "${name}" = "${x}" ] && - continue 2 - done - mkdir "/sys/fs/cgroup/${name}" - mount -n -t cgroup -o "${cgroup_opts},${name}" \ - "${name}" "/sys/fs/cgroup/${name}" - yesno "${rc_cgroup_memory_use_hierarchy:-no}" && - [ "${name}" = memory ] && - echo 1 > /sys/fs/cgroup/memory/memory.use_hierarchy - ;; - esac - done < /proc/cgroups - return 0 -} - -cgroup2_base() -{ - grep -qw cgroup2 /proc/filesystems || return 0 - local base - base="$(cgroup2_find_path)" - if ! mountpoint -q "${base}"; then - mkdir -p "${base}" - mount -t cgroup2 none -o "${cgroup_opts},nsdelegate" "${base}" 2> /dev/null || - mount -t cgroup2 none -o "${cgroup_opts}" "${base}" - fi - return 0 -} - -cgroup2_controllers() -{ - grep -qw cgroup2 /proc/filesystems || return 0 - local active cgroup_path x y - cgroup_path="$(cgroup2_find_path)" - [ -z "${cgroup_path}" ] && return 0 - [ ! -e "${cgroup_path}/cgroup.controllers" ] && return 0 - [ ! -e "${cgroup_path}/cgroup.subtree_control" ]&& return 0 - read -r active < "${cgroup_path}/cgroup.controllers" - for x in ${active}; do - case "${rc_cgroup_mode}" in - unified) - echo "+${x}" > "${cgroup_path}/cgroup.subtree_control" - ;; - hybrid) - for y in ${rc_cgroup_controllers}; do - if [ "$x" = "$y" ]; then - echo "+${x}" > "${cgroup_path}/cgroup.subtree_control" - fi - done - ;; - esac - done - return 0 -} - -cgroups_hybrid() -{ - cgroup1_base - cgroup2_base - cgroup2_controllers - cgroup1_controllers - return 0 -} - -cgroups_legacy() -{ - cgroup1_base - cgroup1_controllers - return 0 -} - -cgroups_unified() -{ - cgroup2_base - cgroup2_controllers - return 0 -} - -mount_cgroups() -{ - case "${rc_cgroup_mode}" in - hybrid) cgroups_hybrid ;; - unified) cgroups_unified ;; - legacy) cgroups_legacy ;; - esac - return 0 -} - -restorecon_cgroups() -{ - if [ -x /sbin/restorecon ]; then - restorecon -rF /sys/fs/cgroup >/dev/null 2>&1 - fi - return 0 -} - -# set up kernel support for cgroups -if [ -d /sys/fs/cgroup ]; then - mount_cgroups - restorecon_cgroups -fi diff --git a/os/etc/s6-rc/src/mount-cgroups/type b/os/etc/s6-rc/src/mount-cgroups/type deleted file mode 100644 index bdd22a1..0000000 --- a/os/etc/s6-rc/src/mount-cgroups/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/os/etc/s6-rc/src/mount-cgroups/up b/os/etc/s6-rc/src/mount-cgroups/up deleted file mode 100644 index 87c9a66..0000000 --- a/os/etc/s6-rc/src/mount-cgroups/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -envfile /etc/s6-rc/config/cgroups.conf -exec sh /etc/s6-rc/src/mount-cgroups/shell-up diff --git a/os/etc/s6-rc/src/mount-devfs/dependencies.d/mount-procfs b/os/etc/s6-rc/src/mount-devfs/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount-devfs/dependencies.d/mount-procfs +++ /dev/null diff --git a/os/etc/s6-rc/src/mount-devfs/type b/os/etc/s6-rc/src/mount-devfs/type deleted file mode 100644 index bdd22a1..0000000 --- a/os/etc/s6-rc/src/mount-devfs/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/os/etc/s6-rc/src/mount-devfs/up b/os/etc/s6-rc/src/mount-devfs/up deleted file mode 100644 index bbb8ec5..0000000 --- a/os/etc/s6-rc/src/mount-devfs/up +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/execlineb -P - -# mount /dev through fstab -foreground { - if -n { mountpoint -q /dev } - if -t { fstabinfo -q /dev } fstabinfo -q --mount /dev -} -# or manually -foreground { - if -n { mountpoint -q /dev } - ifelse -n { grep -q devtmpfs /proc/filesystems } { echo "This kernel doesn't have support for devtmpfs! This means /dev will not be mounted." } - mount -n -t devtmpfs dev /dev -o mode=0755,noexec,nosuid,size=10M -} - -# creating console, tty1 and tty to be able to write to console -# with/without bootsplash before udevd creates it -foreground { if -n { test -c /dev/console } mknod -m 600 /dev/console c 5 1 } -foreground { if -n { test -c /dev/tty1 } mknod -m 620 /dev/tty1 c 4 1 } -foreground { if -n { test -c /dev/tty } mknod -m 666 /dev/tty c 5 0 } - -# udevd will dup it's std{in,out,err} to /dev/null -# and we don't want a file which gets buffered in ram -foreground { if -n { test -c /dev/null } mknod -m 666 /dev/null c 1 3 } - -# so udev can add it's start message to dmesg -foreground { if -n { test -c /dev/kmesg } mknod -m 660 /dev/kmesg c 1 11 } - -# extra symlinks -foreground { ln -snf /proc/self/fd /dev/fd } -foreground { ln -snf /proc/self/fd/0 /dev/stdin } -foreground { ln -snf /proc/self/fd/1 /dev/stdout } -foreground { ln -snf /proc/self/fd/2 /dev/stderr } -foreground { ln -snf /proc/kcore /dev/core } - -# mount required dirs that may not be in /etc/fstab -foreground { mkdir -m 1777 -p /dev/mqueue } -foreground { - if -n { mountpoint -q /dev/mqueue } - mount -n -t mqueue mqueue /dev/mqueue -o nosuid,noexec,nodev -} - -foreground { mkdir -m 0755 -p /dev/pts } -foreground { - if -n { mountpoint -q /dev/pts } - mount -n -t devpts devpts /dev/pts -o gid=5,mode=0620,nosuid,noexec -} - -foreground { mkdir -m 1777 -p /dev/shm } -foreground { - if -n { mountpoint -q /dev/shm } - mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,noexec,nodev -} diff --git a/os/etc/s6-rc/src/mount-filesystems/dependencies.d/modules b/os/etc/s6-rc/src/mount-filesystems/dependencies.d/modules deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount-filesystems/dependencies.d/modules +++ /dev/null diff --git a/os/etc/s6-rc/src/mount-filesystems/type b/os/etc/s6-rc/src/mount-filesystems/type deleted file mode 100644 index bdd22a1..0000000 --- a/os/etc/s6-rc/src/mount-filesystems/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/os/etc/s6-rc/src/mount-filesystems/up b/os/etc/s6-rc/src/mount-filesystems/up deleted file mode 100644 index 25fcdf7..0000000 --- a/os/etc/s6-rc/src/mount-filesystems/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P - -foreground { mount -a -O no_netdev } diff --git a/os/etc/s6-rc/src/mount-procfs/type b/os/etc/s6-rc/src/mount-procfs/type deleted file mode 100644 index bdd22a1..0000000 --- a/os/etc/s6-rc/src/mount-procfs/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/os/etc/s6-rc/src/mount-procfs/up b/os/etc/s6-rc/src/mount-procfs/up deleted file mode 100644 index d950f34..0000000 --- a/os/etc/s6-rc/src/mount-procfs/up +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/execlineb -P - -foreground { - if -n { test -e /proc/mounts } - if -n { mountpoint -q /proc } - mount -t proc proc /proc -o nosuid,noexec,nodev -} diff --git a/os/etc/s6-rc/src/mount-sysfs/dependencies.d/mount-procfs b/os/etc/s6-rc/src/mount-sysfs/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount-sysfs/dependencies.d/mount-procfs +++ /dev/null diff --git a/os/etc/s6-rc/src/mount-sysfs/type b/os/etc/s6-rc/src/mount-sysfs/type deleted file mode 100644 index bdd22a1..0000000 --- a/os/etc/s6-rc/src/mount-sysfs/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/os/etc/s6-rc/src/mount-sysfs/up b/os/etc/s6-rc/src/mount-sysfs/up deleted file mode 100644 index d84627f..0000000 --- a/os/etc/s6-rc/src/mount-sysfs/up +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/execlineb -P - -# /sys -foreground { - if -n { test -d /sys } mkdir -m 0755 /sys - if -n { mountpoint -q /sys } - mount -t sysfs sys /sys -o nosuid,noexec,nodev - -} - -# securityfs -foreground { - if -t { test -d /sys/kernel/security } - if -t { grep -qs securityfs /proc/filesystems } - if -n { mountpoint -q /sys/kernel/security } - mount -t securityfs securityfs /sys/kernel/security -o nosuid,noexec,nodev -} - -# debugfs -foreground { - if -t { test -d /sys/kernel/debug } - if -t { grep -qs debugfs /proc/filesystems } - if -n { mountpoint -q /sys/kernel/debug } - mount -t debugfs debugfs /sys/kernel/debug -o nosuid,noexec,nodev -} - -# configfs -foreground { - if -t { test -d /sys/kernel/config } - if -t { grep -qs configfs /proc/filesystems } - if -n { mountpoint -q /sys/kernel/config } - mount -t configfs configfs /sys/kernel/config -o nosuid,noexec,nodev -} - -# fusectl -foreground { - if -t { test -d /sys/fs/fuse/connections } - if -t { grep -qs fusectl /proc/filesystems } - if -n { mountpoint -q /sys/fs/fuse/connections } - mount -t fusectl fusectl /sys/fs/fuse/connections -o nosuid,noexec,nodev -} - -# pstore -foreground { - if -t { test -d /sys/fs/pstore } - if -t { grep -qs 'pstore$' /proc/filesystems } - if -n { mountpoint -q /sys/fs/pstore } - mount -t pstore pstore /sys/fs/pstore -o nosuid,noexec,nodev -} - -# selinux -foreground { - if -t { test -d /sys/fs/selinux } - if -t { grep -qs selinuxfs /proc/filesystems } - if -n { mountpoint -q /sys/fs/selinux } - mount -t selinuxfs selinuxfs /sys/fs/selinux -o nosuid,noexec,nodev -} - -# efivarfs -foreground { - if -t { test -d /sys/firmware/efi } - if -t { grep -qs efivarfs /proc/filesystems } - if { test -d /sys/firmware/efi } - if -n { mountpoint -q /sys/firmware/efi/efivars } - mount -n -t efivarfs efivarfs /sys/firmware/efi/efivars -o ro,nosuid,noexec,nodev -} diff --git a/os/etc/s6-rc/src/mount-tmpfs/type b/os/etc/s6-rc/src/mount-tmpfs/type deleted file mode 100644 index bdd22a1..0000000 --- a/os/etc/s6-rc/src/mount-tmpfs/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/os/etc/s6-rc/src/mount-tmpfs/up b/os/etc/s6-rc/src/mount-tmpfs/up deleted file mode 100644 index f93bc72..0000000 --- a/os/etc/s6-rc/src/mount-tmpfs/up +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/execlineb -P -foreground { if -n { mountpoint -q /tmp } mount -t tmpfs tmpfs /tmp } diff --git a/os/etc/s6-rc/src/mount/contents.d/mount-cgroups b/os/etc/s6-rc/src/mount/contents.d/mount-cgroups deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount/contents.d/mount-cgroups +++ /dev/null diff --git a/os/etc/s6-rc/src/mount/contents.d/mount-devfs b/os/etc/s6-rc/src/mount/contents.d/mount-devfs deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount/contents.d/mount-devfs +++ /dev/null diff --git a/os/etc/s6-rc/src/mount/contents.d/mount-filesystems b/os/etc/s6-rc/src/mount/contents.d/mount-filesystems deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount/contents.d/mount-filesystems +++ /dev/null diff --git a/os/etc/s6-rc/src/mount/contents.d/mount-procfs b/os/etc/s6-rc/src/mount/contents.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount/contents.d/mount-procfs +++ /dev/null diff --git a/os/etc/s6-rc/src/mount/contents.d/mount-sysfs b/os/etc/s6-rc/src/mount/contents.d/mount-sysfs deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount/contents.d/mount-sysfs +++ /dev/null diff --git a/os/etc/s6-rc/src/mount/contents.d/mount-tmpfs b/os/etc/s6-rc/src/mount/contents.d/mount-tmpfs deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount/contents.d/mount-tmpfs +++ /dev/null diff --git a/os/etc/s6-rc/src/mount/contents.d/remount-root b/os/etc/s6-rc/src/mount/contents.d/remount-root deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount/contents.d/remount-root +++ /dev/null diff --git a/os/etc/s6-rc/src/mount/contents.d/swap b/os/etc/s6-rc/src/mount/contents.d/swap deleted file mode 100644 index e69de29..0000000 --- a/os/etc/s6-rc/src/mount/contents.d/swap +++ /dev/null diff --git a/os/etc/s6-rc/src/mount/type b/os/etc/s6-rc/src/mount/type deleted file mode 100644 index 757b422..0000000 --- a/os/etc/s6-rc/src/mount/type +++ /dev/null @@ -1 +0,0 @@ -bundle |