feat: fix mount-basic-filesystems bugs

Signed-off-by: sisungo <[email protected]>
This commit is contained in:
sisungo committed 2026-11-21 04:57:07 +00:00
1 parent 2212875018
commit dc93bd7c2c
7 files changed
+52 -11

No files matched your search

+1
View File
@@ -0,0 +1 @@
/target
+4 -1
View File
@@ -2,6 +2,7 @@
usage() { usage() {
echo "usage: airup-select-default-milestone [NAME]" echo "usage: airup-select-default-milestone [NAME]"
echo "Select default milestone for Airup, which is entered on system boot."
exit 1 exit 1
} }
@@ -10,7 +11,9 @@ if [ "$1" = "--help" ] || [ "$1" = "-h" ] || [ -z "$1" ]; then
fi fi
if [ -e "/share/milestones/$1.airm" ]; then if [ -e "/share/milestones/$1.airm" ]; then
ln -sf "/share/milestones/$1.airm" "/share/milestones/default.airm" unlink "/share/milestones/default.airm" 2> /dev/null
ln -sf "$1.airm" "/share/milestones/default.airm"
exit 0
else else
echo "error: milestone '$1' not found" echo "error: milestone '$1' not found"
exit 1 exit 1
+4
View File
@@ -1,5 +1,9 @@
#!/bin/sh #!/bin/sh
for ent in "$@"; do
export "$ent"
done
cd $(dirname $0) cd $(dirname $0)
if [ -z "${PREFIX}" ]; then if [ -z "${PREFIX}" ]; then
@@ -1,4 +1,5 @@
run $PREFIX/mount-basic-filesystems.sh # Mount basic filesystems.
run $PREFIX/share/mount-basic-filesystems.sh
# Start `lxdeviced`. # Start `lxdeviced`.
start lxdeviced start lxdeviced
@@ -0,0 +1,9 @@
# Start `accountd`.
#
# Running services as an user other than root depends on this, so it is run early.
start accountd
# Run the logger.
#
# Ensuring the logger to run before other services can help us capture more system logs during system boot.
start airup-fallback-logger
@@ -0,0 +1,5 @@
[milestone]
display-name = "Container"
description = "The milestone that is usually entered on a with-init container boot."
dependencies = []
kind = "serial"
+27 -9
View File
@@ -1,15 +1,33 @@
#!/bin/sh #!/bin/sh
# NOTE:
# Avoid using `/dev/null` in this script, even after `/dev` is mounted.
mount_dev() {
if grep -q devtmpfs /proc/filesystems; then
mount -t devtmpfs dev /dev
else
mount -t tmpfs dev /dev
fi
}
mount -o remount,rw / mount -o remount,rw /
umount -q /dev /sys /proc /run mountpoint -q /dev || mount_dev
mountpoint -q /sys || mount -t sysfs sys /sys
mountpoint -q /proc || mount -t proc proc /proc
mount -t tmpfs run /run mountpoint -q /tmp || mount -t tmpfs tmp /tmp
mount -t sysfs sys /sys
mount -t proc proc /proc
if grep -q devtmpfs /proc/filesystems; then # /run: required by Airup, and is mounted before this script run
mount -t devtmpfs dev /dev
else mountpoint -q /dev/pts || mount --mkdir -t devpts devpts /dev/pts
mount -t tmpfs dev /dev mountpoint -q /dev/shm || mount --mkdir -t tmpfs shm /dev/shm
fi mountpoint -q /dev/mqueue || mount --mkdir -t mqueue mqueue /dev/mqueue
mountpoint -q /sys/kernel/security || mount --mkdir -t securityfs securityfs /sys/kernel/security
mountpoint -q /sys/kernel/debug || mount --mkdir -t debugfs debugfs /sys/kernel/debug
mountpoint -q /sys/kernel/tracing || mount --mkdir -t tracefs tracefs /sys/kernel/tracing
mountpoint -q /sys/fs/pstore || mount --mkdir -t pstore pstore /sys/fs/pstore
mountpoint -q /sys/fs/bpf || mount --mkdir -t bpf bpf /sys/fs/bpf
mountpoint -q /sys/fs/cgroup || mount --mkdir -t cgroup2 -o nsdelegate cgroup2 /sys/fs/cgroup