Skip to content

Commit 21bcf1a

Browse files
committed
overlay sys-apps/baselayout: Don't create empty /etc configs
There is a bug in coreos baselayout which wipes /etc/{group,gshadow,passwd,shadow} when reinstalling/removing/upgrading the baselayout package. The deleted files are touched in staging area, so the package ships empty configuration files, overwriting the original configs on the system. Instead we move the touch to postinst, which only touches the existing files (or creates them when they're nonexistent).
1 parent 24d8122 commit 21bcf1a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-3.6.8-r16.ebuild renamed to sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-3.6.8-r17.ebuild

File renamed without changes.

sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-9999.ebuild

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ pkg_preinst() {
101101
emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" LIBDIRS="${libdirs}" layout
102102
SYSTEMD_JOURNAL_GID=${ACCT_GROUP_SYSTEMD_JOURNAL_ID:-190} ROOT_UID=0 ROOT_GID=0 CORE_UID=500 CORE_GID=500 DESTDIR=${D} "${ED}/usr/share/${PN}/dumb-tmpfiles-proc.sh" "${ED}/usr/lib/tmpfiles.d" || die
103103
rm -f "${ED}/usr/share/${PN}/Makefile" "${ED}/usr/share/${PN}/dumb-tmpfiles-proc.sh" || die
104-
105-
# The default passwd/group files must exist for some ebuilds
106-
touch "${ED}/etc/"{group,gshadow,passwd,shadow}
107-
chmod 640 "${ED}/etc/"{gshadow,shadow}
108104
}
109105

110106
pkg_postinst() {
@@ -131,4 +127,8 @@ pkg_postinst() {
131127
# symlinks.
132128
mkdir -p "${ROOT}/oem"
133129
fi
130+
131+
# The default passwd/group files must exist for some ebuilds
132+
touch "${EROOT}/etc/"{group,gshadow,passwd,shadow}
133+
chmod 640 "${EROOT}/etc/"{gshadow,shadow}
134134
}

0 commit comments

Comments
 (0)