Initial commit
This commit is contained in:
+6
@@ -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
|
||||
+13
@@ -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
|
||||
+37
@@ -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
|
||||
+20
@@ -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
|
||||
Reference in New Issue
Block a user