From patchwork Mon Dec 11 00:58:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changqing Li X-Patchwork-Id: 36009 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 503D4C10F07 for ; Mon, 11 Dec 2023 00:58:21 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.97617.1702256299302335973 for ; Sun, 10 Dec 2023 16:58:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=suOGnNcg; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=0709ce2531=changqing.li@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BB0jw7a002081 for ; Sun, 10 Dec 2023 16:58:19 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PPS06212021; bh=iyVtMYaGjCL6AiTy5VcAS+zb7ourZjMIVijhhK6u9ao=; b= suOGnNcgcpftw+QWvFq4CmU2PYSEBLbCMZtWHzRzflYfe6FeUffTPb1JpwWyaDJL LnE4sKu+06nMgKyKt8iwfBxumkysx5tlmb9hPiW+NGdBxsQmU3KRFaWxYeJZnwHy nJillFVbqvrH2VaR2NvWWZv25iQn09XsAMERencGPxLwwEPxLq5LXIuT8g+Rna7v vowYGZpn4qnebs77kxZwNMEuc/3FTWXSp/IZSX2d7gWAE3lHeyHlSEeW/RRRXaZG szDCn1f7RuXrt5o80x9iTa0XExjKmkf1xHD8wPDgx8nOjEbTLrfznE6c295xqwnn 4P8oaoE32ocEDnVerASp6g== Received: from ala-exchng02.corp.ad.wrs.com (ala-exchng02.wrs.com [147.11.82.254]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3uvrmkrvw6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 10 Dec 2023 16:58:18 -0800 (PST) Received: from ala-exchng01.corp.ad.wrs.com (147.11.82.252) by ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 10 Dec 2023 16:58:22 -0800 Received: from pek-lpg-core2.wrs.com (128.224.153.41) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Sun, 10 Dec 2023 16:58:22 -0800 From: To: Subject: [PATCH 1/5] bitbake.conf: set correct FILESYSTEM_PERMS_TABLES Date: Mon, 11 Dec 2023 08:58:11 +0800 Message-ID: <20231211005815.1119314-2-changqing.li@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211005815.1119314-1-changqing.li@windriver.com> References: <20231211005815.1119314-1-changqing.li@windriver.com> MIME-Version: 1.0 X-Proofpoint-GUID: yrnpdsLD2Mr3aBe3ZVbgs0S0HTaIH_iL X-Proofpoint-ORIG-GUID: yrnpdsLD2Mr3aBe3ZVbgs0S0HTaIH_iL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-16_25,2023-11-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=958 spamscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 adultscore=0 clxscore=1015 phishscore=0 malwarescore=0 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312110006 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 11 Dec 2023 00:58:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192131 From: Changqing Li * Update fs-perms.txt as an common fs-perms file * Remove fs-perms-persistent-log.txt * Add fs-perms-volatile-log.txt and fs-perms-volatile-tmp.txt to be used when VOLATILE_LOG_DIR/VOLATILE_TMP_DIR set to yes Signed-off-by: Changqing Li --- meta/conf/bitbake.conf | 5 ++- ...fs-perms.txt => fs-perms-volatile-log.txt} | 32 ------------------- ...tent-log.txt => fs-perms-volatile-tmp.txt} | 27 ---------------- meta/files/fs-perms.txt | 3 -- 4 files changed, 4 insertions(+), 63 deletions(-) copy meta/files/{fs-perms.txt => fs-perms-volatile-log.txt} (53%) rename meta/files/{fs-perms-persistent-log.txt => fs-perms-volatile-tmp.txt} (59%) diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index e7826e7af9..2a8dd2f972 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -384,7 +384,10 @@ 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 \ + ${@'files/fs-perms-volatile-log.txt' if oe.types.boolean(d.getVar('VOLATILE_LOG_DIR')) else ''} \ + ${@'files/fs-perms-volatile-tmp.txt' if oe.types.boolean(d.getVar('VOLATILE_TMP_DIR')) else ''} \ + " ################################################################## # General work and output directories for the build system. diff --git a/meta/files/fs-perms.txt b/meta/files/fs-perms-volatile-log.txt similarity index 53% copy from meta/files/fs-perms.txt copy to meta/files/fs-perms-volatile-log.txt index 48191f504c..fc846bbdc5 100644 --- a/meta/files/fs-perms.txt +++ b/meta/files/fs-perms-volatile-log.txt @@ -28,39 +28,7 @@ # 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}/log link volatile/log -${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-persistent-log.txt b/meta/files/fs-perms-volatile-tmp.txt similarity index 59% rename from meta/files/fs-perms-persistent-log.txt rename to meta/files/fs-perms-volatile-tmp.txt index 61f0a6e26a..26247acda8 100644 --- a/meta/files/fs-perms-persistent-log.txt +++ b/meta/files/fs-perms-volatile-tmp.txt @@ -28,38 +28,11 @@ # 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.txt b/meta/files/fs-perms.txt index 48191f504c..d2266c1b26 100644 --- a/meta/files/fs-perms.txt +++ b/meta/files/fs-perms.txt @@ -45,9 +45,7 @@ ${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 /home 0755 root root false - - - /srv 0755 root root false - - - @@ -57,7 +55,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 - - - From patchwork Mon Dec 11 00:58:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changqing Li X-Patchwork-Id: 36008 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D511C4167B for ; Mon, 11 Dec 2023 00:58:21 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.97618.1702256300294653363 for ; Sun, 10 Dec 2023 16:58:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=AWRs2CKG; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=0709ce2531=changqing.li@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BB0tEVj003279 for ; Sun, 10 Dec 2023 16:58:20 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PPS06212021; bh=0XwBF/u+18B6wjg0+Xn6nynz/NR/iuWUnUoq0wBPSBo=; b= AWRs2CKGn2XleogPzncXHilhPBnqT1PZWEL/9ZZhjoF+KEVsi9yk2ojo7OJ2B7os Bd4ijS1r8lzSKoiBHqt6b4nGgBDgX2DP46+nnZAftUmhptnRdPxSMEHoMWctxLrF YzPHvbbAGAe04U9r1vh9UryqewIHYKtyQPah2310dDZIRdpgjrdMeFi5iycrOLUR uqYKkzUAOR86c00Q+1OqUuB6WejTRx8e7nKzO6F6Y2t9JZsXUJF/JUgTRlPYhzDu esJ89FDrA+aIzQb93bhclaoxXpY7ul4VNJO1l+c+O080Mti0LBPjisNU3CHHGONg CD1w3SzQRVJ2QIR4O2ZFvQ== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [147.11.82.252]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3uvmd490v3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 10 Dec 2023 16:58:19 -0800 (PST) Received: from ala-exchng01.corp.ad.wrs.com (147.11.82.252) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 10 Dec 2023 16:58:23 -0800 Received: from pek-lpg-core2.wrs.com (128.224.153.41) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Sun, 10 Dec 2023 16:58:23 -0800 From: To: Subject: [PATCH 2/5] base-files: update dirs1777 and volatiles according to VOLATILE_TMP_DIR Date: Mon, 11 Dec 2023 08:58:12 +0800 Message-ID: <20231211005815.1119314-3-changqing.li@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211005815.1119314-1-changqing.li@windriver.com> References: <20231211005815.1119314-1-changqing.li@windriver.com> MIME-Version: 1.0 X-Proofpoint-GUID: 2C0oo5ar0I0SoXPSI6HmOkU2ik9DNlVh X-Proofpoint-ORIG-GUID: 2C0oo5ar0I0SoXPSI6HmOkU2ik9DNlVh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-16_25,2023-11-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 bulkscore=0 phishscore=0 spamscore=0 adultscore=0 malwarescore=0 clxscore=1015 mlxscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312110006 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 11 Dec 2023 00:58:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192132 From: Changqing Li * update dirs1777 so that only create /var/volatiles/tmp when VOLATILE_TMP_DIR set to yes, create /var/tmp when VOLATILE_TMP_DIR set to no * update volatiles so that only symlink /var/tmp to /var/volatiles/tmp when VOLATILE_TMP_DIR set to yes * mount /tmp as tmpfs fs when VOLATILE_TMP_DIR set to no and init manager is sysvinit Signed-off-by: Changqing Li --- meta/recipes-core/base-files/base-files_3.0.14.bb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 9fab53ce63..b523c4aa62 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 @@ -30,7 +30,7 @@ S = "${WORKDIR}" INHIBIT_DEFAULT_DEPS = "1" docdir:append = "/${P}" -dirs1777 = "/tmp ${localstatedir}/volatile/tmp" +dirs1777 = "/tmp ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_TMP_DIR}') else ''}tmp" dirs2775 = "" dirs555 = "/sys /proc" dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \ @@ -54,7 +54,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_LOG_DIR}') else ''} \ + ${@'tmp' if oe.types.boolean('${VOLATILE_TMP_DIR}') else ''}" conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \ ${sysconfdir}/issue /${sysconfdir}/issue.net \ ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \ @@ -122,6 +123,9 @@ do_install () { fi install -m 0644 ${WORKDIR}/fstab ${D}${sysconfdir}/fstab + if [ ${@ oe.types.boolean('${VOLATILE_TMP_DIR}') } = False ] && ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'false', 'true', d)} ;then + echo "tmpfs /tmp tmpfs mode=1777,strictatime,nosuid,nodev,size=50%,nr_inodes=1m 0 0" >> ${D}${sysconfdir}/fstab + fi install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile sed -i 's#@BINDIR@#${bindir}#g' ${D}${sysconfdir}/profile From patchwork Mon Dec 11 00:58:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changqing Li X-Patchwork-Id: 36011 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2251AC10F07 for ; Mon, 11 Dec 2023 00:58:31 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.97619.1702256301184140761 for ; Sun, 10 Dec 2023 16:58:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=aH1srFMC; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=0709ce2531=changqing.li@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BB0tEVl003279 for ; Sun, 10 Dec 2023 16:58:21 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PPS06212021; bh=IBOOYR8Gr8dp2E4woF7U9LzjAPdPSUgELdYvZIrRTUg=; b= aH1srFMC7TE4Cx0Br53ijHBbfnt1ZxTuQQljRqVb+GYLBtnoQwI8stY8AG+Yegw/ PyTtLzrIsIMHLrUrDXgRxP7cyxyFifNUPgF3m5MCVI3Dz3Sg395Jrjzjs6nn4uFn 9gwrPLMajXz/qkCpXpwSNTNUZOK/Zy58d4KpP6+BuGDdxearpelCAAIBLY+bmQLL MzsYdTzo9ah2J2rxa5DojblIc7pHrIAotmqBHYOui9pcWD4dgLibzrMtFNbHQO9R /98NZphog5kmHltUY3Wr/RGYv/txsj3CmU1nmXz0vR8uDWaSFyYKT7dlsVYeAcvD m1gcJs5SuBHeQ3iAhCO4gQ== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [147.11.82.252]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3uvmd490v5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 10 Dec 2023 16:58:20 -0800 (PST) Received: from ala-exchng01.corp.ad.wrs.com (147.11.82.252) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 10 Dec 2023 16:58:24 -0800 Received: from pek-lpg-core2.wrs.com (128.224.153.41) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Sun, 10 Dec 2023 16:58:24 -0800 From: To: Subject: [PATCH 3/5] initscripts: support persistent tmp Date: Mon, 11 Dec 2023 08:58:13 +0800 Message-ID: <20231211005815.1119314-4-changqing.li@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211005815.1119314-1-changqing.li@windriver.com> References: <20231211005815.1119314-1-changqing.li@windriver.com> MIME-Version: 1.0 X-Proofpoint-GUID: Jh3Ah2eZEMx1vt91OdybRMepaM6nS7gu X-Proofpoint-ORIG-GUID: Jh3Ah2eZEMx1vt91OdybRMepaM6nS7gu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-16_25,2023-11-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 bulkscore=0 phishscore=0 spamscore=0 adultscore=0 malwarescore=0 clxscore=1015 mlxscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312110006 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 11 Dec 2023 00:58:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192133 From: Changqing Li * default volatiles file is for VOLATILE_TMP_DIR=yes, and VOLATILE_LOG_DIR=yes, if they set to no, remove volatile related config * replace /var/volatile/tmp with /var/tmp for populate-volatile.sh Signed-off-by: Changqing Li --- .../initscripts/initscripts-1.0/volatiles | 1 + meta/recipes-core/initscripts/initscripts_1.0.bb | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/meta/recipes-core/initscripts/initscripts-1.0/volatiles index cd8a4be05f..a280c47dda 100644 --- a/meta/recipes-core/initscripts/initscripts-1.0/volatiles +++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles @@ -28,6 +28,7 @@ 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 0755 /var/log /var/volatile/log l root root 1777 /var/tmp /var/volatile/tmp l root root 1777 /tmp /var/tmp d root root 0755 /var/lock/subsys none diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb index 4b34c6a67f..c6a0d35dbf 100644 --- a/meta/recipes-core/initscripts/initscripts_1.0.bb +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb @@ -103,12 +103,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 - 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 + if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = False ]; then + sed -i -e '/^[d|l].*\/var\/volatile\/log/d' ${D}${sysconfdir}/default/volatiles/00_core fi - if [ "${VOLATILE_TMP_DIR}" != "yes" ]; then - sed -i -e "/\/d" ${D}${sysconfdir}/default/volatiles/00_core + if [ ${@ oe.types.boolean('${VOLATILE_TMP_DIR}') } = False ]; then + sed -i -e "/^[d|l].*\/var\/volatile\/tmp/d" ${D}${sysconfdir}/default/volatiles/00_core + sed -i -e "/^l.*\/tmp/d" ${D}${sysconfdir}/default/volatiles/00_core + 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}/ From patchwork Mon Dec 11 00:58:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changqing Li X-Patchwork-Id: 36012 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2810CC10F04 for ; Mon, 11 Dec 2023 00:58:31 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web10.97075.1702256302131560028 for ; Sun, 10 Dec 2023 16:58:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=LfI7DXoL; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=0709ce2531=changqing.li@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BB0ssHk002836 for ; Sun, 10 Dec 2023 16:58:22 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PPS06212021; bh=Goux2k0vGLR0myg26ro8us7PAwdQgGaSZGx+wj4q+tU=; b= LfI7DXoLDZKisxqWbk8+UbTS5/xkxm6Mqqu2/2+Zo9poWm9FWKfMYkBlkU6xA0EG uP0FtWq4seui96Ya0P9kab2ahEPQvj4Y+BI/sgl+UqJZYxQFnzPNAH4KAXExbip5 jT0ubP7Z263hn6iXPPZd9RCZrbrn5lOUqGcrEZDGBw6ifSqZ0K7O92iDGiJycWhF 3GPKdmtD0UDFEDtHTR/3w77zsPudhokrjs2GyAPEByDKQrvAK/DwH19RSW/zFQEW q7+3cBGTLP7oro/UjfgHQDPmzYvS4LOPHYPpg1MKCTrkHfjp2aHZoJfhuQGJJoWC o0swub+FNaQVQyL0KmLYmw== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [147.11.82.252]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3uvmd490v7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 10 Dec 2023 16:58:21 -0800 (PST) Received: from ala-exchng01.corp.ad.wrs.com (147.11.82.252) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 10 Dec 2023 16:58:25 -0800 Received: from pek-lpg-core2.wrs.com (128.224.153.41) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Sun, 10 Dec 2023 16:58:25 -0800 From: To: Subject: [PATCH 4/5] systemd: support persistent tmp Date: Mon, 11 Dec 2023 08:58:14 +0800 Message-ID: <20231211005815.1119314-5-changqing.li@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211005815.1119314-1-changqing.li@windriver.com> References: <20231211005815.1119314-1-changqing.li@windriver.com> MIME-Version: 1.0 X-Proofpoint-GUID: EbRSlmF8gX6LtWyLEFYw6NratNHsi_NH X-Proofpoint-ORIG-GUID: EbRSlmF8gX6LtWyLEFYw6NratNHsi_NH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-16_25,2023-11-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=845 bulkscore=0 phishscore=0 spamscore=0 adultscore=0 malwarescore=0 clxscore=1015 mlxscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312110006 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 11 Dec 2023 00:58:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192134 From: Changqing Li * update 00-create-volatile.conf, for volatile tmp, make /tmp -> /var/tmp, /var/tmp -> /var/volatile/tmp and set age of /var/volatile/tmp to 10d * if VOLATILE_TMP_DIR/VOLATILE_LOG_DIR set to no, remove volatile related configs from 00-create-volatile.conf Signed-off-by: Changqing Li --- .../systemd/systemd/00-create-volatile.conf | 3 ++- meta/recipes-core/systemd/systemd_254.4.bb | 22 +++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/meta/recipes-core/systemd/systemd/00-create-volatile.conf b/meta/recipes-core/systemd/systemd/00-create-volatile.conf index c4277221a2..860f2783ef 100644 --- a/meta/recipes-core/systemd/systemd/00-create-volatile.conf +++ b/meta/recipes-core/systemd/systemd/00-create-volatile.conf @@ -5,4 +5,5 @@ d /run/lock 1777 - - - d /var/volatile/log - - - - -d /var/volatile/tmp 1777 - - +d /var/volatile/tmp 1777 - - 10d +L+ /tmp 1777 root root - /var/tmp diff --git a/meta/recipes-core/systemd/systemd_254.4.bb b/meta/recipes-core/systemd/systemd_254.4.bb index 0c12926bef..01ef5cfd7b 100644 --- a/meta/recipes-core/systemd/systemd_254.4.bb +++ b/meta/recipes-core/systemd/systemd_254.4.bb @@ -289,6 +289,21 @@ do_install() { done install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${nonarch_libdir}/tmpfiles.d/ + if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = False ]; then + sed -i -e "/^d.*\/var\/volatile\/log/d" ${D}${nonarch_libdir}/tmpfiles.d/00-create-volatile.conf + fi + + if [ ${@ oe.types.boolean('${VOLATILE_TMP_DIR}') } = False ]; then + sed -i -e "/^d.*\/var\/volatile\/tmp/d" ${D}${nonarch_libdir}/tmpfiles.d/00-create-volatile.conf + sed -i -e "/^L+.*\/tmp/d" ${D}${nonarch_libdir}/tmpfiles.d/00-create-volatile.conf + else + # For volatile tmp, /tmp link to /var/tmp, /var/tmp links to /var/volatile/tmp, so don't need + # mount /tmp again + rm -f ${D}${systemd_unitdir}/system/tmp.mount + rm -f ${D}${systemd_unitdir}/system/local-fs.target.wants/tmp.mount + # The age are set in 00-create-volatile.conf + rm -rf ${D}${nonarch_libdir}/tmpfiles.d/tmp.conf + fi if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then install -d ${D}${sysconfdir}/init.d @@ -308,13 +323,6 @@ 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 From patchwork Mon Dec 11 00:58:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changqing Li X-Patchwork-Id: 36010 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D030C4167B for ; Mon, 11 Dec 2023 00:58:31 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web10.97077.1702256303133320729 for ; Sun, 10 Dec 2023 16:58:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=SlUUQMnT; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=0709ce2531=changqing.li@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BB0jShr001854 for ; Sun, 10 Dec 2023 16:58:23 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PPS06212021; bh=HGQJmV5MYdR7cP3kwAHgwVy5d3q2SwJPXqzIKchuq3A=; b= SlUUQMnT5nDKCuc69LKxIeh5cE9WZxX2Z782JRtK4OLV42Abuwr6HU+7mH30i3+Y D1HhqT4D1iEkqLac921wnj4tnuRMr2ve75wbeaxDcEguj+3kz+W2XFEcr5KwzZXl dwI+GYLEavsZ6KmKRwmDdDxXFa7AzhCruOE5eTBR8FYha5gRwQfeypetlDTM1it3 xhkTF/pjtOcDdjJo0BFlgt05IdEd5vBLLj8wrS5cTJ0lLvbgGwz1VMtuEfQk2LcH WRDxYE4iRIamISVwElFHPe6CVJEkCEA0MTCtEkxJonzUlmIjsj6K0huERsmoH2mT 2gRvJeMJf2A/rp3peBJOcQ== Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.wrs.com [147.11.82.252]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3uvrmkrvwf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 10 Dec 2023 16:58:22 -0800 (PST) Received: from ala-exchng01.corp.ad.wrs.com (147.11.82.252) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 10 Dec 2023 16:58:26 -0800 Received: from pek-lpg-core2.wrs.com (128.224.153.41) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Sun, 10 Dec 2023 16:58:26 -0800 From: To: Subject: [PATCH 5/5] eudev: create dir /tmp if persistent tmp is used Date: Mon, 11 Dec 2023 08:58:15 +0800 Message-ID: <20231211005815.1119314-6-changqing.li@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211005815.1119314-1-changqing.li@windriver.com> References: <20231211005815.1119314-1-changqing.li@windriver.com> MIME-Version: 1.0 X-Proofpoint-GUID: RJI5cv8sOUL_xJKAYpoijc5D3nqHO5Di X-Proofpoint-ORIG-GUID: RJI5cv8sOUL_xJKAYpoijc5D3nqHO5Di X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-16_25,2023-11-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=660 spamscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 adultscore=0 clxscore=1015 phishscore=0 malwarescore=0 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312110006 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 11 Dec 2023 00:58:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192135 From: Changqing Li the automount rule for udev needs /tmp directory available, if VOLATILE_TMP_DIR = yes, to make sure /var/volatile/tmp exist, if VOLATILE_TMP_DIR = no, to make sure /tmp exist. Signed-off-by: Changqing Li --- meta/recipes-core/udev/eudev_3.2.14.bb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/recipes-core/udev/eudev_3.2.14.bb b/meta/recipes-core/udev/eudev_3.2.14.bb index d0758691bd..56c2e453b7 100644 --- a/meta/recipes-core/udev/eudev_3.2.14.bb +++ b/meta/recipes-core/udev/eudev_3.2.14.bb @@ -50,6 +50,10 @@ do_install:append() { # Use classic network interface naming scheme touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules + + if [ ${@ oe.types.boolean('${VOLATILE_TMP_DIR}') } = False ]; then + sed -i -e 's%mkdir -m 1777 -p /var/volatile/tmp%mkdir -m 1777 -p /tmp%g' ${D}${sysconfdir}/init.d/udev + fi } do_install:prepend:class-target () {