mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 09:49:33 +02:00
bitbake.conf: drop VOLATILE_TMP_DIR, use FILESYSTEM_PERMS_TABLES instead
* Drop VOLATILE_TMP_DIR, use FILESYSTEM_PERMS_TABLES instead. By default,
FILESYSTEM_PERMS_TABLES ?= "files/fs-perms.txt \
files/fs-perms-volatile-log.txt \
files/fs-perms-volatile-tmp.txt"
it contains 'files/fs-perms-volatile-tmp.txt', which means volatile tmp
is enabled. User can disable volatile tmp by remove
'files/fs-perms-volatile-tmp.txt' from FILESYSTEM_PERMS_TABLES.
* If volatile tmp is disabled, both /tmp and /var/tmp are persistent
(From OE-Core rev: 8d1ae67b89c45f78162e070228086c7ef88c3264)
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
2f8806deb7
commit
2f46b6f27d
@@ -86,10 +86,6 @@ USRBINPATH:class-nativesdk = "/usr/bin"
|
|||||||
# Root home directory
|
# Root home directory
|
||||||
ROOT_HOME ??= "/home/root"
|
ROOT_HOME ??= "/home/root"
|
||||||
|
|
||||||
# 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[PNBLACKLIST] = "SKIP_RECIPE"
|
||||||
BB_RENAMED_VARIABLES[CVE_CHECK_PN_WHITELIST] = "CVE_CHECK_SKIP_RECIPE"
|
BB_RENAMED_VARIABLES[CVE_CHECK_PN_WHITELIST] = "CVE_CHECK_SKIP_RECIPE"
|
||||||
BB_RENAMED_VARIABLES[CVE_CHECK_WHITELIST] = "CVE_CHECK_IGNORE"
|
BB_RENAMED_VARIABLES[CVE_CHECK_WHITELIST] = "CVE_CHECK_IGNORE"
|
||||||
@@ -381,7 +377,8 @@ FILESEXTRAPATHS ?= "__default:"
|
|||||||
# datadir, sysconfdir, servicedir, sharedstatedir, localstatedir, infodir,
|
# datadir, sysconfdir, servicedir, sharedstatedir, localstatedir, infodir,
|
||||||
# mandir, docdir, bindir, sbindir, libexecdir, libdir and includedir
|
# mandir, docdir, bindir, sbindir, libexecdir, libdir and includedir
|
||||||
FILESYSTEM_PERMS_TABLES ?= "files/fs-perms.txt \
|
FILESYSTEM_PERMS_TABLES ?= "files/fs-perms.txt \
|
||||||
files/fs-perms-volatile-log.txt"
|
files/fs-perms-volatile-log.txt \
|
||||||
|
files/fs-perms-volatile-tmp.txt"
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
# General work and output directories for the build system.
|
# General work and output directories for the build system.
|
||||||
|
|||||||
38
meta/files/fs-perms-volatile-tmp.txt
Normal file
38
meta/files/fs-perms-volatile-tmp.txt
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# This file contains a list of files and directories with known permissions.
|
||||||
|
# It is used by the packaging class to ensure that the permissions, owners and
|
||||||
|
# group of listed files and directories are in sync across the system.
|
||||||
|
#
|
||||||
|
# The format of this file
|
||||||
|
#
|
||||||
|
#<path> <mode> <uid> <gid> <walk> <fmode> <fuid> <fgid>
|
||||||
|
#
|
||||||
|
# or
|
||||||
|
#
|
||||||
|
#<path> link <target>
|
||||||
|
#
|
||||||
|
# <path>: directory path
|
||||||
|
# <mode>: mode for directory
|
||||||
|
# <uid>: uid for directory
|
||||||
|
# <gid>: gid for directory
|
||||||
|
# <walk>: recursively walk the directory? true or false
|
||||||
|
# <fmode>: if walking, new mode for files
|
||||||
|
# <fuid>: if walking, new uid for files
|
||||||
|
# <fgid>: if walking, new gid for files
|
||||||
|
# <target>: turn the directory into a symlink point to target
|
||||||
|
#
|
||||||
|
# in mode, uid or gid, a "-" means don't change any existing values
|
||||||
|
#
|
||||||
|
# /usr/src 0755 root root false - - -
|
||||||
|
# /usr/share/man 0755 root root true 0644 root root
|
||||||
|
|
||||||
|
# Note: all standard config directories are automatically assigned "0755 root root false - - -"
|
||||||
|
|
||||||
|
# Documentation should always be corrected
|
||||||
|
|
||||||
|
# Items from base-files
|
||||||
|
# Links
|
||||||
|
${localstatedir}/tmp link volatile/tmp
|
||||||
|
|
||||||
|
# Special permissions from base-files
|
||||||
|
# Set 1777
|
||||||
|
${localstatedir}/volatile/tmp 01777 root root false - - -
|
||||||
@@ -46,7 +46,6 @@ ${includedir} 0755 root root true 0644 root root
|
|||||||
# Links
|
# Links
|
||||||
${localstatedir}/run link /run
|
${localstatedir}/run link /run
|
||||||
${localstatedir}/lock link /run/lock
|
${localstatedir}/lock link /run/lock
|
||||||
${localstatedir}/tmp link volatile/tmp
|
|
||||||
|
|
||||||
/home 0755 root root false - - -
|
/home 0755 root root false - - -
|
||||||
/srv 0755 root root false - - -
|
/srv 0755 root root false - - -
|
||||||
@@ -56,7 +55,6 @@ ${localstatedir}/local 0755 root root false - - -
|
|||||||
# Special permissions from base-files
|
# Special permissions from base-files
|
||||||
# Set 1777
|
# Set 1777
|
||||||
/tmp 01777 root root false - - -
|
/tmp 01777 root root false - - -
|
||||||
${localstatedir}/volatile/tmp 01777 root root false - - -
|
|
||||||
|
|
||||||
# Set 0700
|
# Set 0700
|
||||||
${ROOT_HOME} 0700 root root false - - -
|
${ROOT_HOME} 0700 root root false - - -
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ UNPACKDIR = "${S}"
|
|||||||
INHIBIT_DEFAULT_DEPS = "1"
|
INHIBIT_DEFAULT_DEPS = "1"
|
||||||
|
|
||||||
docdir:append = "/${P}"
|
docdir:append = "/${P}"
|
||||||
dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
|
dirs1777 = "/tmp ${localstatedir}/${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-tmp.txt', 'volatile/', '', d)}tmp"
|
||||||
dirs2775 = ""
|
dirs2775 = ""
|
||||||
dirs555 = "/sys /proc"
|
dirs555 = "/sys /proc"
|
||||||
dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \
|
dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \
|
||||||
@@ -55,7 +55,8 @@ dirs755-lsb = "/srv \
|
|||||||
${prefix}/lib/locale"
|
${prefix}/lib/locale"
|
||||||
dirs2775-lsb = "/var/mail"
|
dirs2775-lsb = "/var/mail"
|
||||||
|
|
||||||
volatiles = "${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-log.txt', 'log', '', d)} tmp"
|
volatiles = "${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-log.txt', 'log', '', d)} \
|
||||||
|
${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-tmp.txt', 'tmp', '', d)}"
|
||||||
conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
|
conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
|
||||||
${sysconfdir}/issue /${sysconfdir}/issue.net \
|
${sysconfdir}/issue /${sysconfdir}/issue.net \
|
||||||
${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
|
${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ do_install () {
|
|||||||
sed -i -e '\@^d root root 0755 /var/volatile/log none$@ a\l root root 0755 /var/log /var/volatile/log' \
|
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
|
${D}${sysconfdir}/default/volatiles/00_core
|
||||||
fi
|
fi
|
||||||
if [ "${VOLATILE_TMP_DIR}" != "yes" ]; then
|
if ! ${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-tmp.txt', 'true', 'false', d)}; then
|
||||||
sed -i -e "/\<tmp\>/d" ${D}${sysconfdir}/default/volatiles/00_core
|
sed -i -e "/\<tmp\>/d" ${D}${sysconfdir}/default/volatiles/00_core
|
||||||
fi
|
fi
|
||||||
install -m 0755 ${S}/dmesg.sh ${D}${sysconfdir}/init.d
|
install -m 0755 ${S}/dmesg.sh ${D}${sysconfdir}/init.d
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ do_install() {
|
|||||||
|
|
||||||
# if the user requests /tmp be on persistent storage (i.e. not volatile)
|
# if the user requests /tmp be on persistent storage (i.e. not volatile)
|
||||||
# then don't use a tmpfs for /tmp
|
# then don't use a tmpfs for /tmp
|
||||||
if [ "${VOLATILE_TMP_DIR}" != "yes" ]; then
|
if ! ${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-tmp.txt', 'true', 'false', d)}; then
|
||||||
rm -f ${D}${rootlibexecdir}/systemd/system/tmp.mount
|
rm -f ${D}${rootlibexecdir}/systemd/system/tmp.mount
|
||||||
rm -f ${D}${rootlibexecdir}/systemd/system/local-fs.target.wants/tmp.mount
|
rm -f ${D}${rootlibexecdir}/systemd/system/local-fs.target.wants/tmp.mount
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user