Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2026 The Flatcar Maintainers.
# Distributed under the terms of the GNU General Public License v2

EAPI=9

inherit acct-group

ACCT_GROUP_ID=500
Comment on lines +4 to +8
ACCT_GROUP_ENFORCE_ID=yes
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 2026 Flatcar Maintainers
# Distributed under the terms of the GNU General Public License v2

# Can't be 9 - tmpfiles eclass does not support it yet.
EAPI=8

TMPFILES_OPTIONAL=yes
inherit acct-user tmpfiles

Comment on lines +5 to +9
ACCT_USER_ID=500
ACCT_USER_ENFORCE_ID=yes
ACCT_USER_COMMENT="Flatcar Admin"
ACCT_USER_HOME="/home/core"
ACCT_USER_SHELL="/bin/bash"
ACCT_USER_GROUPS=( core docker wheel systemd-journal portage )

acct-user_add_deps

# coreutils for realpath
BDEPEND+="
sys-apps/coreutils
"

declare -A CORE_BASH_SYMLINKS
CORE_BASH_SYMLINKS=(
['.bash_logout']='/usr/share/flatcar/etc/skel/.bash_logout'
['.bash_profile']='/usr/share/flatcar/etc/skel/.bash_profile'
['.bashrc']='/usr/share/flatcar/etc/skel/.bashrc'
)

src_compile() {
# Generate the tmpfiles config file for bash symlinks in
# core's home directory.
local config config_tmp name target
config="${T}/home-core-bash-symlinks.conf"
config_tmp="${config}.tmp"
truncate --size 0 "${config_tmp}"
for name in "${!CORE_BASH_SYMLINKS[@]}"; do
target=${CORE_BASH_SYMLINKS["${name}"]}
target=$(realpath --relative-to="${ACCT_USER_HOME}" --canonicalize-missing --no-symlinks "${target}")
echo "L ${ACCT_USER_HOME}/${name} - core core - ${target}" >>"${config_tmp}"
done
LC_ALL=C sort "${config_tmp}" >"${config}"
}

src_install() {
acct-user_src_install
dotmpfiles "${T}/home-core-bash-symlinks.conf"
}

pkg_postinst() {
acct-user_pkg_postinst
local t n i name
read t n i <"${EROOT}/usr/lib/sysusers.d/acct-group-core.conf" || die
for name in "${!CORE_BASH_SYMLINKS[@]}"; do
target=${CORE_BASH_SYMLINKS["${name}"]}
link="${ACCT_USER_HOME}/${name}"
ln -sfT "${target}" "${EROOT}${link}" || die
chown --no-dereference ${ACCT_USER_ID}:${i} "${EROOT}${link}" || die
done
# we are putting things into the home directory, drop the
# keepdir artifact
rm -f "${EROOT}${ACCT_USER_HOME}/.keep_acct-user_core-"* || die
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
</pkgmetadata>
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ RDEPEND="${RDEPEND}
coreos-base/afterburn
coreos-base/coreos-cloudinit
coreos-base/coreos-init
coreos-base/misc-files
coreos-base/old-oem-files
coreos-base/update-ssh-keys
coreos-base/update_engine
coreos-base/ue-rs
Expand Down Expand Up @@ -219,9 +219,11 @@ RDEPEND+="

# Group and user packages to eventually replace passwd in baselayout.
RDEPEND="${RDEPEND}
acct-group/core
acct-group/floppy
acct-group/man
acct-group/uucp

acct-user/core
acct-user/man
"

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading