From cd007ef90d46339aaeaa5a2624e8e3298c5e1255 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 18 Mar 2014 20:39:15 -0700 Subject: [PATCH 1/3] Revert "remove(cros-tmpfiles.eclass): Replaced by new systemd-tmpfiles" This reverts commit b4d0088622884704dda44711fb8f8b7b65dc8a0f. --- .../eclass/cros-tmpfiles.eclass | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/eclass/cros-tmpfiles.eclass diff --git a/sdk_container/src/third_party/coreos-overlay/eclass/cros-tmpfiles.eclass b/sdk_container/src/third_party/coreos-overlay/eclass/cros-tmpfiles.eclass new file mode 100644 index 0000000000..3f180e1f29 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/eclass/cros-tmpfiles.eclass @@ -0,0 +1,93 @@ +# Copyright 2014 The CoreOS Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: cros-tmpfiles +# @AUTHOR: marineam +# @BLURB: A basic systemd-tmpfiles --create implementation for ebuilds. +# @DESCRIPTION: +# Any location that is outside of /usr must be initialized during the build +# and (re)created during boot if it is missing. To avoid duplicating +# definitions of these directories/symlinks in ebuilds and tmpfiles configs +# packages can instead only install a tmpfiles config and use this eclass to +# create teh paths in an ebuild friendly way. +# +# Note: in the future if we add a --root option to systemd-tmpfiles we can +# switch to calling that instead of using this simplified implementation. + +# Enforce use of recent EAPIs for the sake of consistancy/sanity +case "${EAPI:-0}" in + 0|1|2|3) + die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" + ;; + 4|5) + ;; + *) + die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" + ;; +esac + +# Since bash doesn't have a slick syntax for subsituting default values +# for anything other than blank vs. non-blank variables this helps. +# Usage: _tmpfiles_set_defaults mode uid gid age arg +_tmpfiles_do_file() { + [[ ${tmode} == - ]] && tmode=0644 + if [[ "${ttype}" == F ]]; then + rm -rf "${ED}/${tpath}" + elif [[ -e "${ED}/${tpath}" ]]; then + return 0 + fi + if [[ "${targ}" != - ]]; then + echo "${targ}" > "${ED}/${tpath}" || return 1 + else + echo -n > "${ED}/${tpath}" || return 1 + fi + chmod "${tmode}" "${ED}/${tpath}" || return 1 + chown "${tuid}:${tgid}" "${ED}/${tpath}" || return 1 +} + +_tmpfiles_do_dir() { + [[ ${tmode} == - ]] && tmode=0755 + if [[ "${ttype}" == d && -e "${ED}/${tpath}" ]]; then + return 0 + else + rm -rf "${ED}/${tpath}" + fi + mkdir -m "${tmode}" "${ED}/${tpath}" || return 1 + chown "${tuid}:${tgid}" "${ED}/${tpath}" || return 1 +} + +_tmpfiles_do_link() { + if [[ -e "${ED}/${tpath}" || -h "${ED}/${tpath}" ]]; then + return 0 + fi + ln -s "${targ}" "${ED}/${tpath}" || return 1 +} + +_tmpfiles_do_create() { + local ttype tpath tmode tuid tgid tage targ trule + while read ttype tpath tmode tuid tgid tage targ; do + trule="$ttype $tpath $tmode $tuid $tgid $tage $targ" + [[ "${tuid}" == - ]] && tuid=root + [[ "${tgid}" == - ]] && tgid=root + case "${ttype}" in + f|F) _tmpfiles_do_file;; + d|D) _tmpfiles_do_dir;; + L) _tmpfiles_do_link;; + *) ewarn "Skipping tmpfiles rule: ${trule}";; + esac + if [[ $? -ne 0 ]]; then + eerror "Bad tmpfiles rule: ${trule}" + return 1 + fi + done +} + +tmpfiles_create() { + if [[ $# -eq 0 ]]; then + set -- "${ED}"/usr/lib*/tmpfiles.d/*.conf + fi + local conf + for conf in "$@"; do + _tmpfiles_do_create < "${conf}" || die "Bad tmpfiles config: ${conf}" + done +} From 33636c026c46b91992e6ced44ece4a2c6041aa23 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 18 Mar 2014 20:39:17 -0700 Subject: [PATCH 2/3] Revert "fix(app-misc/ca-certificates): Replace cros-tmpfiles with systemd-tmpfiles" This reverts commit 93ec181e26540e65f8b7636a6d63be87affb49a4. --- .../app-misc/ca-certificates/ca-certificates-3.15.5.ebuild | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/app-misc/ca-certificates/ca-certificates-3.15.5.ebuild b/sdk_container/src/third_party/coreos-overlay/app-misc/ca-certificates/ca-certificates-3.15.5.ebuild index a8bc9357c9..3b78ac4b7a 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-misc/ca-certificates/ca-certificates-3.15.5.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-misc/ca-certificates/ca-certificates-3.15.5.ebuild @@ -3,7 +3,7 @@ EAPI=5 PYTHON_COMPAT=( python2_7 ) -inherit python-any-r1 systemd +inherit cros-tmpfiles python-any-r1 systemd RTM_NAME="NSS_${PV//./_}_RTM" MY_PN="nss" @@ -21,8 +21,7 @@ KEYWORDS="amd64" IUSE="" RDEPEND="dev-libs/openssl - sys-apps/findutils - sys-apps/systemd" + sys-apps/findutils" DEPEND="${RDEPEND} ${PYTHON_DEPS}" @@ -54,6 +53,6 @@ src_install() { # Setup initial links in /etc dodir /etc/ssl/certs - systemd-tmpfiles --root="${D}" --create + tmpfiles_create bash "${FILESDIR}/update-ca-certificates" "${D}/etc/ssl/certs" || die } From b70545fadd6180645b36207aed8b926f89e1661d Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 18 Mar 2014 20:39:19 -0700 Subject: [PATCH 3/3] Revert "fix(sys-apps/baselayout): Replace cros-tmpfiles with systemd-tmpfiles" This reverts commit 7bc566630cb05d509371fa09435a08900057b308. --- .../baselayout/baselayout-3.0.0-r8.ebuild | 1 + .../sys-apps/baselayout/baselayout-9999.ebuild | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 120000 sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-3.0.0-r8.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-3.0.0-r8.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-3.0.0-r8.ebuild new file mode 120000 index 0000000000..512b17810f --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/baselayout/baselayout-3.0.0-r8.ebuild @@ -0,0 +1 @@ +baselayout-9999.ebuild \ No newline at end of file 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 bfff362158..338b9364c4 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 @@ -13,7 +13,7 @@ else KEYWORDS="amd64 arm x86" fi -inherit cros-workon eutils multilib systemd +inherit cros-workon cros-tmpfiles eutils multilib systemd DESCRIPTION="Filesystem baselayout for CoreOS" HOMEPAGE="http://www.coreos.com/" @@ -24,8 +24,7 @@ SLOT="0" IUSE="cros_host symlink-usr" # This version of baselayout replaces coreos-base -DEPEND="sys-apps/systemd - !coreos-base/coreos-base +DEPEND="!coreos-base/coreos-base !