From 2f8806deb7655b37d6f8d12ff54680d6acf7a298 Mon Sep 17 00:00:00 2001 From: Changqing Li Date: Tue, 27 Aug 2024 18:40:40 +0800 Subject: bitbake.conf: drop VOLATILE_LOG_DIR, use FILESYSTEM_PERMS_TABLES instead Drop VOLATILE_LOG_DIR, use FILESYSTEM_PERMS_TABLES instead. By default, it contains 'files/fs-perms-volatile-log.txt', which means volatile log is enabled. User can disable volatile log by remove 'files/fs-perms-volatile-log.txt' from FILESYSTEM_PERMS_TABLES. (From OE-Core rev: 91128c6517066715f2afe6b46aa3206c7cf3653e) Signed-off-by: Changqing Li Signed-off-by: Richard Purdie --- meta/conf/bitbake.conf | 7 +-- meta/files/fs-perms-persistent-log.txt | 65 ----------------------- meta/files/fs-perms-volatile-log.txt | 34 ++++++++++++ meta/files/fs-perms.txt | 1 - meta/recipes-core/base-files/base-files_3.0.14.bb | 4 +- meta/recipes-core/initscripts/initscripts_1.0.bb | 2 +- meta/recipes-core/systemd/systemd_256.5.bb | 2 +- 7 files changed, 40 insertions(+), 75 deletions(-) delete mode 100644 meta/files/fs-perms-persistent-log.txt create mode 100644 meta/files/fs-perms-volatile-log.txt diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 1acb56433c..76ae17e644 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -86,10 +86,6 @@ 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 'yes': /tmp links to /var/tmp which links to /var/volatile/tmp # otherwise: /tmp is on persistent storage VOLATILE_TMP_DIR ?= "yes" @@ -384,7 +380,8 @@ FILESEXTRAPATHS ?= "__default:" # base_prefix, prefix, exec_prefix, base_bindir, base_sbindir, base_libdir, # datadir, sysconfdir, servicedir, sharedstatedir, localstatedir, infodir, # mandir, docdir, bindir, sbindir, libexecdir, libdir and includedir -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 \ + files/fs-perms-volatile-log.txt" ################################################################## # General work and output directories for the build system. diff --git a/meta/files/fs-perms-persistent-log.txt b/meta/files/fs-perms-persistent-log.txt deleted file mode 100644 index 61f0a6e26a..0000000000 --- a/meta/files/fs-perms-persistent-log.txt +++ /dev/null @@ -1,65 +0,0 @@ -# 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 -# -# -# -# or -# -# link -# -# : directory path -# : mode for directory -# : uid for directory -# : gid for directory -# : recursively walk the directory? true or false -# : if walking, new mode for files -# : if walking, new uid for files -# : if walking, new gid for files -# : 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 -${mandir} 0755 root root true 0644 root root -${infodir} 0755 root root true 0644 root root -${docdir} 0755 root root true 0644 root root -${datadir}/gtk-doc 0755 root root true 0644 root root - -# Fixup locales -${datadir}/locale 0755 root root true 0644 root root - -# Cleanup headers -${includedir} 0755 root root true 0644 root root - -# Cleanup debug src -/usr/src/debug 0755 root root true 0644 root root - -# Items from base-files -# 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 - - - -${prefix}/src 0755 root root false - - - -${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 - - - - -# Set 2775-lsb -${localstatedir}/mail 02775 root mail false - - - diff --git a/meta/files/fs-perms-volatile-log.txt b/meta/files/fs-perms-volatile-log.txt new file mode 100644 index 0000000000..fc846bbdc5 --- /dev/null +++ b/meta/files/fs-perms-volatile-log.txt @@ -0,0 +1,34 @@ +# 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 +# +# +# +# or +# +# link +# +# : directory path +# : mode for directory +# : uid for directory +# : gid for directory +# : recursively walk the directory? true or false +# : if walking, new mode for files +# : if walking, new uid for files +# : if walking, new gid for files +# : 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}/log link volatile/log diff --git a/meta/files/fs-perms.txt b/meta/files/fs-perms.txt index 48191f504c..61f0a6e26a 100644 --- a/meta/files/fs-perms.txt +++ b/meta/files/fs-perms.txt @@ -45,7 +45,6 @@ ${includedir} 0755 root root true 0644 root root # Items from base-files # Links ${localstatedir}/run link /run -${localstatedir}/log link volatile/log ${localstatedir}/lock link /run/lock ${localstatedir}/tmp link volatile/tmp 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 1b6e9671e4..dc1292ae55 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 @@ -44,7 +44,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}/${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-log.txt', 'volatile/', '', d)}log \ /home ${prefix}/src ${localstatedir}/local \ /media" @@ -55,7 +55,7 @@ dirs755-lsb = "/srv \ ${prefix}/lib/locale" dirs2775-lsb = "/var/mail" -volatiles = "${@'log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''} tmp" +volatiles = "${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-log.txt', 'log', '', d)} tmp" conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \ ${sysconfdir}/issue /${sysconfdir}/issue.net \ ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \ diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb index 65f97a0af2..0879b30623 100644 --- a/meta/recipes-core/initscripts/initscripts_1.0.bb +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb @@ -106,7 +106,7 @@ do_install () { install -m 0755 ${S}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d install -m 0755 ${S}/save-rtc.sh ${D}${sysconfdir}/init.d install -m 0644 ${S}/volatiles ${D}${sysconfdir}/default/volatiles/00_core - if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = True ]; then + if ${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-log.txt', 'true', 'false', d)}; then 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 diff --git a/meta/recipes-core/systemd/systemd_256.5.bb b/meta/recipes-core/systemd/systemd_256.5.bb index ee656c81e5..7f66c921ab 100644 --- a/meta/recipes-core/systemd/systemd_256.5.bb +++ b/meta/recipes-core/systemd/systemd_256.5.bb @@ -313,7 +313,7 @@ do_install() { install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install fi - if "${@'true' if oe.types.boolean(d.getVar('VOLATILE_LOG_DIR')) else 'false'}"; then + if ${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-log.txt', 'true', 'false', d)}; then # base-files recipe provides /var/log which is a symlink to /var/volatile/log rm -rf ${D}${localstatedir}/log printf 'L\t\t%s/log\t\t-\t-\t-\t-\t%s/volatile/log\n' "${localstatedir}" \ -- cgit v1.2.3-54-g00ecf