mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
initscripts: Add custom mount args for /var/lib
Adds bitbake variable to set additional mount flags for the /var/lib overlayfs or bind mount when using a read-only root filesystem. This can be used to set additional options like "-o nodev". (From OE-Core rev: c3109e40e2c2c881996dd3fcc95fca74f098646d) Signed-off-by: Colin McAllister <colin.mcallister@garmin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
04eac1f2b6
commit
3bb286730b
@@ -37,9 +37,9 @@ if [ "$1" = "start" ] ; then
|
||||
mkdir -p /var/volatile/.lib-work
|
||||
# Try to mount using overlay, which is much faster than copying
|
||||
# files. If that fails, fallback to the slower copy
|
||||
if ! mount -t overlay overlay -olowerdir=/var/lib,upperdir=/var/volatile/lib,workdir=/var/volatile/.lib-work /var/lib > /dev/null 2>&1; then
|
||||
if ! mount -t overlay overlay SED_VARLIBMOUNTARGS -olowerdir=/var/lib,upperdir=/var/volatile/lib,workdir=/var/volatile/.lib-work /var/lib > /dev/null 2>&1; then
|
||||
cp -a /var/lib/* /var/volatile/lib
|
||||
mount --bind /var/volatile/lib /var/lib
|
||||
mount SED_VARLIBMOUNTARGS --bind /var/volatile/lib /var/lib
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -58,10 +58,12 @@ FILES:${PN}-functions = "${sysconfdir}/init.d/functions*"
|
||||
FILES:${PN}-sushell = "${base_sbindir}/sushell"
|
||||
|
||||
HALTARGS ?= "-d -f"
|
||||
VARLIBMOUNTARGS ?= ""
|
||||
|
||||
do_configure() {
|
||||
sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/halt
|
||||
sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/reboot
|
||||
sed -i -e "s:SED_VARLIBMOUNTARGS:${VARLIBMOUNTARGS}:g" ${WORKDIR}/read-only-rootfs-hook.sh
|
||||
}
|
||||
|
||||
do_install () {
|
||||
|
||||
Reference in New Issue
Block a user