mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
overlayfs-etc: add option to skip creation of mount dirs
The 'preinit' script can't create mount directories when rootfs is read-only. Add an option to skip this step. The user must make sure that all required directories are already in the rootfs directory layout. Cc: Vyacheslav Yurkov <uvv.mail@gmail.com> (From OE-Core rev: 3d433d8559467d255bd19af2d0999c65ea24a48d) Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
d25f6b970f
commit
6f32769afb
@@ -41,6 +41,7 @@ OVERLAYFS_ETC_USE_ORIG_INIT_NAME ??= "1"
|
||||
OVERLAYFS_ETC_MOUNT_OPTIONS ??= "defaults"
|
||||
OVERLAYFS_ETC_INIT_TEMPLATE ??= "${COREBASE}/meta/files/overlayfs-etc-preinit.sh.in"
|
||||
OVERLAYFS_ETC_EXPOSE_LOWER ??= "0"
|
||||
OVERLAYFS_ETC_CREATE_MOUNT_DIRS ??= "1"
|
||||
|
||||
python create_overlayfs_etc_preinit() {
|
||||
overlayEtcMountPoint = d.getVar("OVERLAYFS_ETC_MOUNT_POINT")
|
||||
@@ -62,6 +63,7 @@ python create_overlayfs_etc_preinit() {
|
||||
initBaseName = oe.path.join(d.getVar("base_sbindir"), "init")
|
||||
origInitNameSuffix = ".orig"
|
||||
exposeLower = oe.types.boolean(d.getVar('OVERLAYFS_ETC_EXPOSE_LOWER'))
|
||||
createMoundDirs = oe.types.boolean(d.getVar('OVERLAYFS_ETC_CREATE_MOUNT_DIRS'))
|
||||
|
||||
args = {
|
||||
'OVERLAYFS_ETC_MOUNT_POINT': overlayEtcMountPoint,
|
||||
@@ -69,7 +71,8 @@ python create_overlayfs_etc_preinit() {
|
||||
'OVERLAYFS_ETC_FSTYPE': overlayEtcFsType,
|
||||
'OVERLAYFS_ETC_DEVICE': overlayEtcDevice,
|
||||
'SBIN_INIT_NAME': initBaseName + origInitNameSuffix if useOrigInit else initBaseName,
|
||||
'OVERLAYFS_ETC_EXPOSE_LOWER': "true" if exposeLower else "false"
|
||||
'OVERLAYFS_ETC_EXPOSE_LOWER': "true" if exposeLower else "false",
|
||||
'CREATE_MOUNT_DIRS': "true" if createMoundDirs else "false"
|
||||
}
|
||||
|
||||
if useOrigInit:
|
||||
|
||||
@@ -3,12 +3,15 @@
|
||||
echo "PREINIT: Start"
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
mount -o remount,rw /
|
||||
if {CREATE_MOUNT_DIRS}; then
|
||||
mount -o remount,rw /
|
||||
|
||||
mkdir -p /proc
|
||||
mkdir -p /sys
|
||||
mkdir -p /run
|
||||
mkdir -p /var/run
|
||||
mkdir -p /proc
|
||||
mkdir -p /sys
|
||||
mkdir -p /run
|
||||
mkdir -p /var/run
|
||||
mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}
|
||||
fi
|
||||
|
||||
mount -t proc proc /proc
|
||||
mount -t sysfs sysfs /sys
|
||||
@@ -20,7 +23,6 @@ UPPER_DIR=$BASE_OVERLAY_ETC_DIR/upper
|
||||
WORK_DIR=$BASE_OVERLAY_ETC_DIR/work
|
||||
LOWER_DIR=$BASE_OVERLAY_ETC_DIR/lower
|
||||
|
||||
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}
|
||||
|
||||
Reference in New Issue
Block a user