From 3699011969d7ba28f3c49159fa1ea6b772283ff1 Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Thu, 6 Apr 2023 16:26:05 +0300 Subject: [PATCH] base: base-files: drop /home/root folder with systemd Instead, create this folder at runtime via systemd tmpfiles.d. Signed-off-by: Oleksandr Suvorov --- .../recipes-core/base-files/base-files/tmpfiles.conf | 1 + meta-lmp-base/recipes-core/base-files/base-files_%.bbappend | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/meta-lmp-base/recipes-core/base-files/base-files/tmpfiles.conf b/meta-lmp-base/recipes-core/base-files/base-files/tmpfiles.conf index 518745b7df..04311aa1bc 100644 --- a/meta-lmp-base/recipes-core/base-files/base-files/tmpfiles.conf +++ b/meta-lmp-base/recipes-core/base-files/base-files/tmpfiles.conf @@ -1,3 +1,4 @@ d /var/backups 0755 - - - d /var/lib/misc 0755 - - - d /var/local 0755 - - - +d ROOTHOME 0700 root root - diff --git a/meta-lmp-base/recipes-core/base-files/base-files_%.bbappend b/meta-lmp-base/recipes-core/base-files/base-files_%.bbappend index 1f8587be1e..2307a72d69 100644 --- a/meta-lmp-base/recipes-core/base-files/base-files_%.bbappend +++ b/meta-lmp-base/recipes-core/base-files/base-files_%.bbappend @@ -5,6 +5,7 @@ SRC_URI += "file://tmpfiles.conf" do_install:append () { if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then install -D -m 0644 ${WORKDIR}/tmpfiles.conf ${D}${nonarch_libdir}/tmpfiles.d/${PN}.conf + sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${nonarch_libdir}/tmpfiles.d/${PN}.conf ( # Remove /var stuff cd ${D}${localstatedir}; @@ -16,6 +17,10 @@ do_install:append () { rmdir -v ${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log; # symlinks rm -v run lock; + # Remove /home stuff + cd ${D} + roothomedir=$(echo ${ROOT_HOME} | sed 's#^/##') + rmdir -v --parents ${roothomedir}; ) fi }