All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] support persistent /var/tmp
@ 2020-05-13  9:48 Changqing Li
  2020-05-13  9:48 ` [PATCH 1/6] bitbake.conf: rename VOLATILE_LOG_DIR to VOLATILE_DIR Changqing Li
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Changqing Li @ 2020-05-13  9:48 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

Changqing Li (6):
  bitbake.conf: rename VOLATILE_LOG_DIR to VOLATILE_DIR
  fs-perms-persistent.txt: renamed from fs-perms-persistent-log.txt
  base-files: respect VOLATILE_DIR
  initscripts: respect VOLATILE_DIR
  systemd: respect VOLATILE_DIR
  eudev: respect VOLATILE_DIR

 meta/conf/bitbake.conf                                 | 10 ++++++----
 ...erms-persistent-log.txt => fs-perms-persistent.txt} |  2 --
 meta/recipes-core/base-files/base-files_3.0.14.bb      |  7 ++++---
 .../recipes-core/initscripts/initscripts-1.0/volatiles |  3 ---
 meta/recipes-core/initscripts/initscripts_1.0.bb       |  8 +++++++-
 meta/recipes-core/systemd/systemd_245.5.bb             |  4 +++-
 meta/recipes-core/udev/eudev_3.2.9.bb                  |  3 +++
 7 files changed, 23 insertions(+), 14 deletions(-)
 rename meta/files/{fs-perms-persistent-log.txt => fs-perms-persistent.txt} (95%)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/6] bitbake.conf: rename VOLATILE_LOG_DIR to VOLATILE_DIR
  2020-05-13  9:48 [PATCH 0/6] support persistent /var/tmp Changqing Li
@ 2020-05-13  9:48 ` Changqing Li
  2020-05-13  9:48 ` [PATCH 2/6] fs-perms-persistent.txt: renamed from fs-perms-persistent-log.txt Changqing Li
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Changqing Li @ 2020-05-13  9:48 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

To support persistent /var/tmp, rename VOLATILE_LOG_DIR
to VOLATILE_DIR

Don't use VOLATILE_LOG_DIR/VOLATILE_TMP_DIR
to control it separately since it will make things complicated,
we need to make kinds of fs-perms*.txt for kinds of combination
of the two variables.

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/conf/bitbake.conf | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index bdade79abe..8fd688c793 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -86,9 +86,11 @@ USRBINPATH_class-nativesdk = "/usr/bin"
 # Root home directory
 ROOT_HOME ??= "/home/root"
 
-# If set to boolean true ('yes', 'y', 'true', 't', '1'), /var/log links to /var/volatile/log.
-# If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log is on persistent storage.
-VOLATILE_LOG_DIR ?= "yes"
+# If set to boolean true ('yes', 'y', 'true', 't', '1'), /var/log links to
+# /var/volatile/log, /var/tmp links to /var/volatile/tmp
+# If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log and /var/tmp
+# is on persistent storage.
+VOLATILE_DIR ?= "yes"
 
 ##################################################################
 # Architecture-dependent build variables.
@@ -350,7 +352,7 @@ FILESEXTRAPATHS ?= "__default:"
 #  datadir, sysconfdir, servicedir, sharedstatedir, localstatedir, infodir,
 #  mandir, docdir, bindir, sbindir, libexecdir, libdir, includedir and
 #  oldincludedir
-FILESYSTEM_PERMS_TABLES ?= "${@'files/fs-perms.txt' if oe.types.boolean(d.getVar('VOLATILE_LOG_DIR')) else 'files/fs-perms-persistent-log.txt'}"
+FILESYSTEM_PERMS_TABLES ?= "${@'files/fs-perms.txt' if oe.types.boolean(d.getVar('VOLATILE_DIR')) else 'files/fs-perms-persistent.txt'}"
 
 ##################################################################
 # General work and output directories for the build system.
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/6] fs-perms-persistent.txt: renamed from fs-perms-persistent-log.txt
  2020-05-13  9:48 [PATCH 0/6] support persistent /var/tmp Changqing Li
  2020-05-13  9:48 ` [PATCH 1/6] bitbake.conf: rename VOLATILE_LOG_DIR to VOLATILE_DIR Changqing Li
@ 2020-05-13  9:48 ` Changqing Li
  2020-05-13  9:48 ` [PATCH 3/6] base-files: respect VOLATILE_DIR Changqing Li
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Changqing Li @ 2020-05-13  9:48 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

since we use one variable VOLATILE_DIR to control the volatile,
rename the filename to make it common

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 .../{fs-perms-persistent-log.txt => fs-perms-persistent.txt}    | 2 --
 1 file changed, 2 deletions(-)
 rename meta/files/{fs-perms-persistent-log.txt => fs-perms-persistent.txt} (95%)

diff --git a/meta/files/fs-perms-persistent-log.txt b/meta/files/fs-perms-persistent.txt
similarity index 95%
rename from meta/files/fs-perms-persistent-log.txt
rename to meta/files/fs-perms-persistent.txt
index 3a7cf3ab94..9ca9571e6e 100644
--- a/meta/files/fs-perms-persistent-log.txt
+++ b/meta/files/fs-perms-persistent.txt
@@ -47,7 +47,6 @@ ${oldincludedir}	0755	root	root	true	0644	root	root
 # Links
 ${localstatedir}/run	link	/run
 ${localstatedir}/lock	link	/run/lock
-${localstatedir}/tmp	link	volatile/tmp
 
 /home				0755	root	root	false - - -
 /srv				0755	root	root	false - - -
@@ -57,7 +56,6 @@ ${localstatedir}/local		0755	root	root	false - - -
 # Special permissions from base-files
 # Set 1777
 /tmp				01777	root	root	false - - -
-${localstatedir}/volatile/tmp	01777	root	root	false - - -
 
 # Set 0700
 ${ROOT_HOME}			0700	root	root	false - - -
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/6] base-files: respect VOLATILE_DIR
  2020-05-13  9:48 [PATCH 0/6] support persistent /var/tmp Changqing Li
  2020-05-13  9:48 ` [PATCH 1/6] bitbake.conf: rename VOLATILE_LOG_DIR to VOLATILE_DIR Changqing Li
  2020-05-13  9:48 ` [PATCH 2/6] fs-perms-persistent.txt: renamed from fs-perms-persistent-log.txt Changqing Li
@ 2020-05-13  9:48 ` Changqing Li
  2020-05-13  9:48 ` [PATCH 4/6] initscripts: " Changqing Li
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Changqing Li @ 2020-05-13  9:48 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

respect VOLATILE_DIR to support persistent /var/tmp too

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index 94299431f6..0e06629bbd 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -29,7 +29,7 @@ S = "${WORKDIR}"
 INHIBIT_DEFAULT_DEPS = "1"
 
 docdir_append = "/${P}"
-dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
+dirs1777 = "/tmp ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_DIR}') else ''}tmp"
 dirs2775 = ""
 dirs555 = "/sys /proc"
 dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \
@@ -42,7 +42,7 @@ dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \
            ${localstatedir}/backups ${localstatedir}/lib \
            ${localstatedir}/lib/misc ${localstatedir}/spool \
            ${localstatedir}/volatile \
-           ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \
+           ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_DIR}') else ''}log \
            /home ${prefix}/src ${localstatedir}/local \
            /media"
 
@@ -53,7 +53,8 @@ dirs755-lsb = "/srv  \
                ${prefix}/lib/locale"
 dirs2775-lsb = "/var/mail"
 
-volatiles = "${@'log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''} tmp"
+volatiles = "${@'log' if oe.types.boolean('${VOLATILE_DIR}') else ''} \
+             ${@'tmp' if oe.types.boolean('${VOLATILE_DIR}') else ''}"
 conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
              ${sysconfdir}/issue /${sysconfdir}/issue.net \
              ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/6] initscripts: respect VOLATILE_DIR
  2020-05-13  9:48 [PATCH 0/6] support persistent /var/tmp Changqing Li
                   ` (2 preceding siblings ...)
  2020-05-13  9:48 ` [PATCH 3/6] base-files: respect VOLATILE_DIR Changqing Li
@ 2020-05-13  9:48 ` Changqing Li
  2020-05-13  9:48 ` [PATCH 5/6] systemd: " Changqing Li
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Changqing Li @ 2020-05-13  9:48 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

respect VOLATILE_DIR to support persistent /var/tmp too

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/recipes-core/initscripts/initscripts-1.0/volatiles | 3 ---
 meta/recipes-core/initscripts/initscripts_1.0.bb        | 8 +++++++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
index cd8a4be05f..eeeb8905da 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/volatiles
+++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
@@ -24,11 +24,8 @@
 # a link will be created at /var/test pointing to /tmp/testfile and due to this
 # link the file defined as /var/test will actually be created as /tmp/testfile.
 d root root 1777 /run/lock none
-d root root 0755 /var/volatile/log none
-d root root 1777 /var/volatile/tmp none
 l root root 1777 /var/lock /run/lock
 l root root 0755 /var/run /run
-l root root 1777 /var/tmp /var/volatile/tmp
 l root root 1777 /tmp /var/tmp
 d root root 0755 /var/lock/subsys none
 f root root 0664 /var/log/wtmp none
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index 1a59b82fbf..ba6dc068c9 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -104,8 +104,14 @@ do_install () {
 	install -m 0755    ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d
 	install -m 0755    ${WORKDIR}/save-rtc.sh	${D}${sysconfdir}/init.d
 	install -m 0644    ${WORKDIR}/volatiles		${D}${sysconfdir}/default/volatiles/00_core
-	if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = True ]; then
+	if [ ${@ oe.types.boolean('${VOLATILE_DIR}') } = True ]; then
+		echo "d root root 0755 /var/volatile/log none" >> ${D}${sysconfdir}/default/volatiles/00_core
+		echo "d root root 1777 /var/volatile/tmp none" >> ${D}${sysconfdir}/default/volatiles/00_core
 		echo "l root root 0755 /var/log /var/volatile/log" >> ${D}${sysconfdir}/default/volatiles/00_core
+		echo "l root root 0755 /var/tmp /var/volatile/tmp" >> ${D}${sysconfdir}/default/volatiles/00_core
+	else
+		sed -i -e 's;TMPROOT="${ROOT_DIR}/var/volatile/tmp";TMPROOT="${ROOT_DIR}/var/tmp";g' \
+                    ${D}${sysconfdir}/init.d/populate-volatile.sh
 	fi
 	install -m 0755    ${WORKDIR}/dmesg.sh		${D}${sysconfdir}/init.d
 	install -m 0644    ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5/6] systemd: respect VOLATILE_DIR
  2020-05-13  9:48 [PATCH 0/6] support persistent /var/tmp Changqing Li
                   ` (3 preceding siblings ...)
  2020-05-13  9:48 ` [PATCH 4/6] initscripts: " Changqing Li
@ 2020-05-13  9:48 ` Changqing Li
  2020-05-13  9:48 ` [PATCH 6/6] eudev: " Changqing Li
  2020-05-14 13:25 ` [OE-core] [PATCH 0/6] support persistent /var/tmp Richard Purdie
  6 siblings, 0 replies; 8+ messages in thread
From: Changqing Li @ 2020-05-13  9:48 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

respect VOLATILE_DIR to support persistent /var/tmp too

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/recipes-core/systemd/systemd_245.5.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/systemd/systemd_245.5.bb b/meta/recipes-core/systemd/systemd_245.5.bb
index ece4220987..a2aed13f4a 100644
--- a/meta/recipes-core/systemd/systemd_245.5.bb
+++ b/meta/recipes-core/systemd/systemd_245.5.bb
@@ -230,7 +230,9 @@ do_install() {
 	install -d ${D}${sysconfdir}/tmpfiles.d
 	install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
 
-	install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
+	if [ ${@ oe.types.boolean('${VOLATILE_DIR}') } = True ]; then
+		install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
+	fi
 
 	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
 		install -d ${D}${sysconfdir}/init.d
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 6/6] eudev: respect VOLATILE_DIR
  2020-05-13  9:48 [PATCH 0/6] support persistent /var/tmp Changqing Li
                   ` (4 preceding siblings ...)
  2020-05-13  9:48 ` [PATCH 5/6] systemd: " Changqing Li
@ 2020-05-13  9:48 ` Changqing Li
  2020-05-14 13:25 ` [OE-core] [PATCH 0/6] support persistent /var/tmp Richard Purdie
  6 siblings, 0 replies; 8+ messages in thread
From: Changqing Li @ 2020-05-13  9:48 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

respect VOLATILE_DIR to support persistent /var/tmp too

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/recipes-core/udev/eudev_3.2.9.bb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-core/udev/eudev_3.2.9.bb b/meta/recipes-core/udev/eudev_3.2.9.bb
index f96f8cbe78..fc9a73cf8f 100644
--- a/meta/recipes-core/udev/eudev_3.2.9.bb
+++ b/meta/recipes-core/udev/eudev_3.2.9.bb
@@ -41,6 +41,9 @@ do_install_append() {
 	install -d ${D}${sysconfdir}/init.d
 	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
 	sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev
+        if [ ${@ oe.types.boolean('${VOLATILE_DIR}') } = False ]; then
+            sed -i -e 's%mkdir -m 1777 -p /var/volatile/tmp%mkdir -m 1777 -p /var/tmp%g' ${D}${sysconfdir}/init.d/udev
+        fi
 
 	install -d ${D}${sysconfdir}/udev/rules.d
 	install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [OE-core] [PATCH 0/6] support persistent /var/tmp
  2020-05-13  9:48 [PATCH 0/6] support persistent /var/tmp Changqing Li
                   ` (5 preceding siblings ...)
  2020-05-13  9:48 ` [PATCH 6/6] eudev: " Changqing Li
@ 2020-05-14 13:25 ` Richard Purdie
  6 siblings, 0 replies; 8+ messages in thread
From: Richard Purdie @ 2020-05-14 13:25 UTC (permalink / raw)
  To: Changqing Li, openembedded-core

On Wed, 2020-05-13 at 17:48 +0800, Changqing Li wrote:
> From: Changqing Li <changqing.li@windriver.com>
> 
> Changqing Li (6):
>   bitbake.conf: rename VOLATILE_LOG_DIR to VOLATILE_DIR
>   fs-perms-persistent.txt: renamed from fs-perms-persistent-log.txt
>   base-files: respect VOLATILE_DIR
>   initscripts: respect VOLATILE_DIR
>   systemd: respect VOLATILE_DIR
>   eudev: respect VOLATILE_DIR

This patch series doesn't explain what the problem is that its trying
to solve.

It also doesn't appear to be bisectable, you have to apply all the
patches or none. That implies some of the patches would need to be
merged together.

Please can you rework it with an explanation of what the problem is
that its trying to solve.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-14 13:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13  9:48 [PATCH 0/6] support persistent /var/tmp Changqing Li
2020-05-13  9:48 ` [PATCH 1/6] bitbake.conf: rename VOLATILE_LOG_DIR to VOLATILE_DIR Changqing Li
2020-05-13  9:48 ` [PATCH 2/6] fs-perms-persistent.txt: renamed from fs-perms-persistent-log.txt Changqing Li
2020-05-13  9:48 ` [PATCH 3/6] base-files: respect VOLATILE_DIR Changqing Li
2020-05-13  9:48 ` [PATCH 4/6] initscripts: " Changqing Li
2020-05-13  9:48 ` [PATCH 5/6] systemd: " Changqing Li
2020-05-13  9:48 ` [PATCH 6/6] eudev: " Changqing Li
2020-05-14 13:25 ` [OE-core] [PATCH 0/6] support persistent /var/tmp Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.