var/volatile: Mount it if doing ro-rfs
PATCH v2 1/1 var/volatile: Mount it if doing ro-rfs
- Do not mount /var/volatile to be tmpfs always only when generating readonly rootfs
- Generate var-volatile.mount unit when using system in readonly-rootfs to mount /var/volatile as tmpfs
- for sysvinit, mount /var/volatile to be tmpfs if its not already mounted so
- Use RequiresMountsFor instead of After=, so systemd figures out the needed dependencies for making /var/volatile accessible for journald and not us.
--- meta/classes/image.bbclass | 1 + meta/recipes-core/base-files/base-files/fstab | 1 - meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh | 2 +- meta/recipes-core/systemd/systemd/journald-volatile.conf | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-)
meta/classes/image.bbclass +1 -0
@@ -228,6 +228,7 @@ read_only_rootfs_hook () { fi if ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "true", "false", d)}; then + sed -e 's#/tmp#/var/volatile#g' ${IMAGE_ROOTFS}/lib/systemd/system/tmp.mount > ${IMAGE_ROOTFS}/lib/systemd/system/var-volatile.mount # Update user database files so that services don't fail for a read-only systemd system for conffile in ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd.conf ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd-remote.conf; do [ -e $conffile ] || continue
meta/recipes-core/base-files/base-files/fstab +0 -1
@@ -5,7 +5,6 @@ proc /proc proc defaults 0 0 devpts /dev/pts devpts mode=0620,gid=5 0 0 usbdevfs /proc/bus/usb usbdevfs noauto 0 0 tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 -tmpfs /var/volatile tmpfs defaults 0 0 # uncomment this if your device has a SD/MMC/Transflash slot #/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0
meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh +1 -1
@@ -29,7 +29,7 @@ is_on_read_only_partition () { if [ "$1" = "start" ] ; then if [ `is_on_read_only_partition /var/lib` = "yes" ]; then - grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile + grep -q "tmpfs /var/volatile" /proc/mounts || mount -t tmpfs -o strictatime tmpfs /var/volatile mkdir -p /var/volatile/lib cp -a /var/lib/* /var/volatile/lib mount --bind /var/volatile/lib /var/lib
meta/recipes-core/systemd/systemd/journald-volatile.conf +1 -1
@@ -3,4 +3,4 @@ # /var/log -> /var/volatile/log. And if the journal starts before the mount # happens, the journal will appear empty until restarted. [Unit] -After=var-volatile.mount +RequiresMountsFor=/var/volatile
Signature · 1 line
2.1.4
Hi Khem,
Yes this is a welcome change.
Ridish
Quoted 100 lines · Khem Raj
- Do not mount
/var/volatileto be tmpfs always only when generating readonly rootfs
- Generate var-volatile.mount unit when using system in readonly-rootfs to mount/var/volatileas tmpfs
- for sysvinit, mount/var/volatileto be tmpfs if its not already mounted so
- Use RequiresMountsFor instead of After=, so systemd figures out the needed dependencies for making/var/volatileaccessible for journald and not us.Change-Id I0b176b3e1c1e88e84d2c93154aac04cef565d8eaSigned-off-by Khem Raj <[email protected]>---
meta/classes/image.bbclass |
1 +
meta/recipes-core/base-files/base-files/fstab |
1 -
meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh|
2 +-
meta/recipes-core/systemd/systemd/journald-volatile.conf|
2 +-4 files changed, 3 insertions(+), 3 deletions(-)meta/classes/image.bbclass +0
-0@@ -228,6 +228,7 @@ read_only_rootfs_hook () { fi if ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "true","false", d)}; then
+ sed -e 's#/tmp#/var/volatile#g'
${IMAGE_ROOTFS}/lib/systemd/system/tmp.mount > ${IMAGE_ROOTFS}/lib/systemd/system/var-volatile.mount
# Update user database files so that services don't fail for a
read-only systemd system
for conffile in${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd.conf${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd-remote.conf; do[ -e $conffile ] || continuemeta/recipes-core/base-files/base-files/fstab +0
-0@@ -5,7 +5,6 @@ proc /proc proc defaults 0 0 devpts /dev/pts devpts mode=0620,gid=5 0 0 usbdevfs /proc/bus/usb usbdevfs noauto 0 0 tmpfs /run tmpfsmode=0755,nodev,nosuid,strictatime 0 0
-tmpfs/var/volatiletmpfs defaults
0 0# uncomment this if your device has a SD/MMC/Transflash slot #/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0 diff --git a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh index 1a0328d..3ff39f4 100644 --- a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh +++ b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.shmeta/recipes-core/base-files/base-files/fstab +0
-1@@ -29,7 +29,7 @@ is_on_read_only_partition () { if [ "$1" = "start" ] ; then if [ `is_on_read_only_partition /var/lib` = "yes" ]; then - grep -q "tmpfs /var/volatile" /proc/mounts || mount
/var/volatile
+ grep -q "tmpfs/var/volatile"/proc/mounts|| mount -t
tmpfs -o strictatime tmpfs/var/volatile
mkdir -p/var/volatile/lib
cp -a/var/lib/*/var/volatile/libmount --bind/var/volatile/lib/var/libmeta/recipes-core/systemd/systemd/journald-volatile.conf +0
-0@@ -3,4 +3,4 @@ # /var/log -> /var/volatile/log. And if the journal starts before themount
# happens, the journal will appear empty until restarted. [Unit]meta/recipes-core/systemd/systemd/journald-volatile.conf +1
-2-After=var-volatile.mount +RequiresMountsFor=/var/volatile --2.1.4
--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Quoted 9 lines · Khem Raj
- Do not mount
/var/volatileto be tmpfs always only when generating readonly rootfs
- Generate var-volatile.mount unit when using system in readonly-rootfs to mount/var/volatileas tmpfs
- for sysvinit, mount/var/volatileto be tmpfs if its not already mounted so
- Use RequiresMountsFor instead of After=, so systemd figures out the needed dependencies for making/var/volatileaccessible for journald and not us.
Wrong ML :)
Quoted 65 lines
Change-Id I0b176b3e1c1e88e84d2c93154aac04cef565d8eaSigned-off-by Khem Raj <[email protected]>--- meta/classes/image.bbclass | 1 + meta/recipes-core/base-files/base-files/fstab | 1 - meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh | 2 +- meta/recipes-core/systemd/systemd/journald-volatile.conf | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-)meta/classes/image.bbclass +1
-0@@ -228,6 +228,7 @@ read_only_rootfs_hook () { fi if ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "true", "false", d)}; then + sed -e 's#/tmp#/var/volatile#g' ${IMAGE_ROOTFS}/lib/systemd/system/tmp.mount > ${IMAGE_ROOTFS}/lib/systemd/system/var-volatile.mount # Update user database files so that services don't fail for a read-only systemd system for conffile in ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd.conf ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd-remote.conf; do [ -e $conffile ] || continuemeta/recipes-core/base-files/base-files/fstab +0
-1@@ -5,7 +5,6 @@ proc /proc proc defaults 0 0 devpts /dev/pts devpts mode=0620,gid=5 0 0 usbdevfs /proc/bus/usb usbdevfs noauto 0 0 tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 -tmpfs /var/volatile tmpfs defaults 0 0 # uncomment this if your device has a SD/MMC/Transflash slot #/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh +1
-1@@ -29,7 +29,7 @@ is_on_read_only_partition () { if [ "$1" = "start" ] ; then if [ `is_on_read_only_partition /var/lib` = "yes" ]; then - grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile + grep -q "tmpfs /var/volatile" /proc/mounts || mount -t tmpfs -o strictatime tmpfs /var/volatile mkdir -p /var/volatile/lib cp -a /var/lib/* /var/volatile/lib mount --bind /var/volatile/lib /var/libmeta/recipes-core/systemd/systemd/journald-volatile.conf +1
-1@@ -3,4 +3,4 @@ # /var/log -> /var/volatile/log. And if the journal starts before the mount # happens, the journal will appear empty until restarted. [Unit] -After=var-volatile.mount +RequiresMountsFor=/var/volatileSignature · 7 lines
2.1.4 -- _______________________________________________ Openembedded-devel mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]