From b613789a7c6e59857ba43591cc43a18123dc3ff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Mon, 12 Oct 2020 21:23:30 +0900 Subject: [PATCH] sys-apps/baselayout: Ensure to create core home folder in the SDK Because the --root option restricts systemd-tmpfiles to the passwd database file in the package chroot it can't resolve the core user and fails to set up the home folder from the baselayout-home.conf directives. Create the folder manually because creating a /etc/passwd file in the package chroot would at installation overwrite the SDK user. --- .../sys-apps/baselayout/baselayout-9999.ebuild | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-9999.ebuild index bee39d7ea3..9bfdb4f502 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-9999.ebuild @@ -115,8 +115,14 @@ src_install() { done if use cros_host; then - # We assume that SDK already has the user and group database. - : + # Since later systemd-tmpfiles --root is used only users from + # /etc/passwd are considered but we don't want to add core there + # because it would make emerge overwrite the system's database on + # installation when the SDK user is already there. Instead, just + # create the folder manually and remove the tmpfile directive. + rm "${S}/tmpfiles.d/baselayout-home.conf" + mkdir -p "${D}"/home/core + chown 500:500 "${D}"/home/core else # Initialize /etc/passwd, group, and friends now, so # systemd-tmpfiles can resolve user information in ${D}