Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,6 @@
#!/bin/sh
mount dev dev -tdevtmpfs
mount sys sys -tsysfs
mount proc proc -tproc
mount tmpfs run -t tmpfs -o mode=755,nodev
@@ -0,0 +1,9 @@
#!/bin/sh
# We need to run udevd in order to get the /dev/mtd volumes to show up.
if udevd --daemon; then
udevadm trigger --type=devices --action=add && \
udevadm settle --timeout=10
udevadm control --exit
fi
@@ -0,0 +1,13 @@
#!/bin/sh
if [ ! -x /sbin/fw_printenv ]; then
exit 1
fi
# Need to create /run/lock so fw_printenv can create lockfile.
mkdir /run/lock
# Check uboot keys for 'factory-reset'
if /sbin/fw_printenv openbmcinit openbmconce | grep -q factory-reset ; then
echo "factory-reset" >> /run/format-persist
fi
@@ -0,0 +1,37 @@
#!/bin/sh
if [ ! -e /dev/mtd/rwfs ]; then
exit 1
fi
if [ ! -e /run/format-persist ]; then
if ! ubiattach -p /dev/mtd/rwfs > /dev/null ; then
echo "unformatted-ubi" >> /run/format-persist
fi
if ! ubinfo /dev/ubi0 -N rwfs > /dev/null ; then
# ubi device attached, but volume not exist
ubidetach -p /dev/mtd/rwfs
echo "missing-ubi-volume" >> /run/format-persist
fi
fi
if [ -e /run/format-persist ]; then
echo "Formatting persistent volume: "
cat /run/format-persist
if ! ubiformat --yes /dev/mtd/rwfs ; then
exit 1
fi
if ! ubiattach -p /dev/mtd/rwfs ; then
exit 1
fi
if ! ubimkvol /dev/ubi0 -N rwfs -m ; then
exit 1
fi
fi
mkdir -p /run/mnt-persist
mount -t ubifs ubi0:rwfs /run/mnt-persist -o sync,compr=zstd
@@ -0,0 +1,20 @@
#!/bin/sh
PERSIST=/run/mnt-persist
if [ ! -d $PERSIST ]; then
exit 0
fi
for m in var etc home/root; do
if [ ! -d $PERSIST/$m-data ]; then
mkdir -p $PERSIST/$m-data
fi
if [ ! -d $PERSIST/$m-work ]; then
mkdir -p $PERSIST/$m-work
fi
mount overlay /$m -t overlay -o \
lowerdir=/$m,upperdir=$PERSIST/$m-data,workdir=$PERSIST/$m-work
done
@@ -0,0 +1,13 @@
#!/bin/sh
cd /
for f in /usr/libexec/phosphor-static-norootfs-init/*; do
if [ "$(basename "$f")" = "init" ]; then
continue
fi
$f
done
exec /lib/systemd/systemd