mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
ea4c56e2e8
commit
d5d40479d7
@@ -90,6 +90,10 @@ ROOT_HOME ??= "/home/root"
|
||||
# If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log is on persistent storage.
|
||||
VOLATILE_LOG_DIR ?= "yes"
|
||||
|
||||
# if set to 'yes': /tmp links to /var/tmp which links to /var/volatile/tmp
|
||||
# otherwise: /tmp is on persistent storage
|
||||
VOLATILE_TMP_DIR ?= "yes"
|
||||
|
||||
BB_RENAMED_VARIABLES[PNBLACKLIST] = "SKIP_RECIPE"
|
||||
BB_RENAMED_VARIABLES[CVE_CHECK_PN_WHITELIST] = "CVE_CHECK_SKIP_RECIPE"
|
||||
BB_RENAMED_VARIABLES[CVE_CHECK_WHITELIST] = "CVE_CHECK_IGNORE"
|
||||
|
||||
@@ -108,6 +108,9 @@ do_install () {
|
||||
sed -i -e '\@^d root root 0755 /var/volatile/log none$@ a\l root root 0755 /var/log /var/volatile/log' \
|
||||
${D}${sysconfdir}/default/volatiles/00_core
|
||||
fi
|
||||
if [ "${VOLATILE_TMP_DIR}" != "yes" ]; then
|
||||
sed -i -e "/\<tmp\>/d" ${D}${sysconfdir}/default/volatiles/00_core
|
||||
fi
|
||||
install -m 0755 ${WORKDIR}/dmesg.sh ${D}${sysconfdir}/init.d
|
||||
install -m 0644 ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/
|
||||
|
||||
|
||||
@@ -288,6 +288,13 @@ do_install() {
|
||||
rm -rf ${D}${localstatedir}/log/journal/remote
|
||||
fi
|
||||
|
||||
# if the user requests /tmp be on persistent storage (i.e. not volatile)
|
||||
# then don't use a tmpfs for /tmp
|
||||
if [ "${VOLATILE_TMP_DIR}" != "yes" ]; then
|
||||
rm -f ${D}${rootlibdir}/systemd/system/tmp.mount
|
||||
rm -f ${D}${rootlibdir}/systemd/system/local-fs.target.wants/tmp.mount
|
||||
fi
|
||||
|
||||
install -d ${D}${systemd_system_unitdir}/graphical.target.wants
|
||||
install -d ${D}${systemd_system_unitdir}/multi-user.target.wants
|
||||
install -d ${D}${systemd_system_unitdir}/poweroff.target.wants
|
||||
|
||||
Reference in New Issue
Block a user