summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrevor Woerner <twoerner@gmail.com>2023-02-27 00:00:40 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-28 07:53:54 +0000
commitd5d40479d706cbb382850b9479c5dd9bfb801c99 (patch)
tree1443017d0817af40b30b19c02981ecc10a3af2e3
parentea4c56e2e883b904380bc34e9202436322f41bf1 (diff)
downloadpoky-d5d40479d706cbb382850b9479c5dd9bfb801c99.tar.gz
VOLATILE_TMP_DIR: add
Provide a mechanism to allow users to choose whether the /tmp directory is on persistent storage (non-volatile) or a RAM-based tmpfs (volatile). The default is volatile. Works for both sysvinit-based and systemd-based systems. (From OE-Core rev: 8b76c0637eaeaf5bd5e696680cd74b7a642f4157) Signed-off-by: Trevor Woerner <twoerner@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/conf/bitbake.conf4
-rw-r--r--meta/recipes-core/initscripts/initscripts_1.0.bb3
-rw-r--r--meta/recipes-core/systemd/systemd_252.5.bb7
3 files changed, 14 insertions, 0 deletions
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index dcf6ce99d1..afd9e2f552 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -90,6 +90,10 @@ ROOT_HOME ??= "/home/root"
90# If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log is on persistent storage. 90# If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log is on persistent storage.
91VOLATILE_LOG_DIR ?= "yes" 91VOLATILE_LOG_DIR ?= "yes"
92 92
93# if set to 'yes': /tmp links to /var/tmp which links to /var/volatile/tmp
94# otherwise: /tmp is on persistent storage
95VOLATILE_TMP_DIR ?= "yes"
96
93BB_RENAMED_VARIABLES[PNBLACKLIST] = "SKIP_RECIPE" 97BB_RENAMED_VARIABLES[PNBLACKLIST] = "SKIP_RECIPE"
94BB_RENAMED_VARIABLES[CVE_CHECK_PN_WHITELIST] = "CVE_CHECK_SKIP_RECIPE" 98BB_RENAMED_VARIABLES[CVE_CHECK_PN_WHITELIST] = "CVE_CHECK_SKIP_RECIPE"
95BB_RENAMED_VARIABLES[CVE_CHECK_WHITELIST] = "CVE_CHECK_IGNORE" 99BB_RENAMED_VARIABLES[CVE_CHECK_WHITELIST] = "CVE_CHECK_IGNORE"
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index 7c9d9ca4f1..4dc477bb8d 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -108,6 +108,9 @@ do_install () {
108 sed -i -e '\@^d root root 0755 /var/volatile/log none$@ a\l root root 0755 /var/log /var/volatile/log' \ 108 sed -i -e '\@^d root root 0755 /var/volatile/log none$@ a\l root root 0755 /var/log /var/volatile/log' \
109 ${D}${sysconfdir}/default/volatiles/00_core 109 ${D}${sysconfdir}/default/volatiles/00_core
110 fi 110 fi
111 if [ "${VOLATILE_TMP_DIR}" != "yes" ]; then
112 sed -i -e "/\<tmp\>/d" ${D}${sysconfdir}/default/volatiles/00_core
113 fi
111 install -m 0755 ${WORKDIR}/dmesg.sh ${D}${sysconfdir}/init.d 114 install -m 0755 ${WORKDIR}/dmesg.sh ${D}${sysconfdir}/init.d
112 install -m 0644 ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/ 115 install -m 0644 ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/
113 116
diff --git a/meta/recipes-core/systemd/systemd_252.5.bb b/meta/recipes-core/systemd/systemd_252.5.bb
index ea468da150..8b92b2cf42 100644
--- a/meta/recipes-core/systemd/systemd_252.5.bb
+++ b/meta/recipes-core/systemd/systemd_252.5.bb
@@ -288,6 +288,13 @@ do_install() {
288 rm -rf ${D}${localstatedir}/log/journal/remote 288 rm -rf ${D}${localstatedir}/log/journal/remote
289 fi 289 fi
290 290
291 # if the user requests /tmp be on persistent storage (i.e. not volatile)
292 # then don't use a tmpfs for /tmp
293 if [ "${VOLATILE_TMP_DIR}" != "yes" ]; then
294 rm -f ${D}${rootlibdir}/systemd/system/tmp.mount
295 rm -f ${D}${rootlibdir}/systemd/system/local-fs.target.wants/tmp.mount
296 fi
297
291 install -d ${D}${systemd_system_unitdir}/graphical.target.wants 298 install -d ${D}${systemd_system_unitdir}/graphical.target.wants
292 install -d ${D}${systemd_system_unitdir}/multi-user.target.wants 299 install -d ${D}${systemd_system_unitdir}/multi-user.target.wants
293 install -d ${D}${systemd_system_unitdir}/poweroff.target.wants 300 install -d ${D}${systemd_system_unitdir}/poweroff.target.wants