mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
files: add overlayfs-etc-preinit.sh.in
A template init script for overlayfs-etc class (From OE-Core rev: c0173002f3f2118f72307b7e60515287a1b56bda) Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
74b3628d07
commit
167bc05b7f
29
meta/files/overlayfs-etc-preinit.sh.in
Normal file
29
meta/files/overlayfs-etc-preinit.sh.in
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "PREINIT: Start"
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
mount -o remount,rw /
|
||||
|
||||
mkdir -p /proc
|
||||
mkdir -p /sys
|
||||
mkdir -p /run
|
||||
mkdir -p /var/run
|
||||
|
||||
mount -t proc proc /proc
|
||||
mount -t sysfs sysfs /sys
|
||||
|
||||
[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
|
||||
|
||||
mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}
|
||||
if mount -n -t {OVERLAYFS_ETC_FSTYPE} -o {OVERLAYFS_ETC_MOUNT_OPTIONS} {OVERLAYFS_ETC_DEVICE} {OVERLAYFS_ETC_MOUNT_POINT}
|
||||
then
|
||||
mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper
|
||||
mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work
|
||||
mount -n -t overlay -o upperdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper,lowerdir=/etc,workdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper /etc || echo "PREINIT: Mounting etc-overlay failed!"
|
||||
else
|
||||
echo "PREINIT: Mounting </data> failed!"
|
||||
fi
|
||||
|
||||
echo "PREINIT: done; starting </sbin/init>"
|
||||
exec {SBIN_INIT_NAME}
|
||||
Reference in New Issue
Block a user