From a1a8d5786854e168585aa22312ac3688a45e6e45 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 14 Sep 2021 12:33:29 +0200 Subject: [PATCH 01/11] profiles: Drop dev-util/pkgconfig from package.use The package is about to be replaced with dev-util/pkgconf. --- .../coreos-overlay/profiles/coreos/targets/generic/package.use | 3 --- 1 file changed, 3 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/targets/generic/package.use b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/targets/generic/package.use index e59b90b6a9..5c63349b15 100644 --- a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/targets/generic/package.use +++ b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/targets/generic/package.use @@ -28,9 +28,6 @@ net-libs/libmicrohttpd epoll sys-boot/syslinux -custom-cflags -# break dependency loop between pkg-config and glib -dev-util/pkgconfig internal-glib - # minimize risk removing unneeded patches and networking support app-shells/bash -net vanilla From 21720048033e9e7bbe1e7ac8420698db25331518 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 17 Sep 2021 17:35:30 +0200 Subject: [PATCH 02/11] sys-apps/systemd: Reimplement builddir_ functions This is to avoid querying pkg-config for this information and overriding the SYSROOT variable. These hacks seem to be broken with the change of the pkgconfig implementation. We know what will the path for the directory of the system units - it's based on rootprefix that we pass to configure script. So use this knowledge directly instead of getting it in a roundabout way from pkg-config file. --- .../sys-apps/systemd/systemd-9999.ebuild | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-9999.ebuild index e2fb46fa05..659aa6409b 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-9999.ebuild @@ -247,6 +247,10 @@ src_configure() { multilib-minimal_src_configure } +get_rootprefix() { + usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr" +} + multilib_src_configure() { local myconf=( --localstatedir="${EPREFIX}/var" @@ -258,7 +262,7 @@ multilib_src_configure() { # make sure we get /bin:/sbin in PATH $(meson_use split-usr) -Dsplit-bin=true - -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")" + -Drootprefix="$(get_rootprefix)" -Drootlibdir="${EPREFIX}/usr/$(get_libdir)" # Avoid infinite exec recursion, bug 642724 -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit" @@ -500,18 +504,18 @@ multilib_src_install_all() { # dropped it. } -builddir_systemd_enable_service() { - ( - export SYSROOT="${ED}" - systemd_enable_service "$@" - ) +builddir_systemd_get_systemunitdir() { + echo "$(get_rootprefix)/lib/systemd/system" } -builddir_systemd_get_systemunitdir() { - ( - export SYSROOT="${ED}" - systemd_get_systemunitdir - ) +builddir_systemd_enable_service() { + local target=${1} + local service=${2} + local ud=$(builddir_systemd_get_systemunitdir) + local destname=${service##*/} + + dodir "${ud}"/"${target}".wants && \ + dosym ../"${service}" "${ud}"/"${target}".wants/"${destname}" } migrate_locale() { From f942b28dca9e0d7f1acd314c55085e6693814c44 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Thu, 30 Sep 2021 20:48:04 +0200 Subject: [PATCH 03/11] dev-libs/dbus-glib: Sync with gentoo --- .../dev-libs/dbus-glib/Manifest | 2 +- ...0.110-r1.ebuild => dbus-glib-0.112.ebuild} | 45 ++++++++++++------- .../dev-libs/dbus-glib/metadata.xml | 2 +- 3 files changed, 32 insertions(+), 17 deletions(-) rename sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/{dbus-glib-0.110-r1.ebuild => dbus-glib-0.112.ebuild} (59%) diff --git a/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/Manifest b/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/Manifest index 92177545e8..1c633be509 100644 --- a/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/Manifest +++ b/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/Manifest @@ -1 +1 @@ -DIST dbus-glib-0.110.tar.gz 836497 BLAKE2B d936402bbaa5c354b2730cbace273974ec0133db052503fea2780d70b128e50e4fdf54f6ebfeed024eb5602fa3725a40627e27320a4727647299f74b2eb75c85 SHA512 c40ccf7118d4951f0e09082216ccd26f21ee906bdf96d912611d3cd29badd7ef446bea74e19f26c28ebceb9e19bb659d11c643c3e712dac499df12907be88a54 +DIST dbus-glib-0.112.tar.gz 715340 BLAKE2B 24e1c222f0116b32c109682816f6c35771647f4c63cab93a6621bd68b71ea4dca62fbf9e6bb360386b8658146dbf34b0d7dc471db7525585412d120340c4c969 SHA512 7c9f393f065dfb3d698f35e6554caf15fe539f5dd52d2b2bb6ed1770e130f5dab8e45379232520301455bae9bb77e25a109faf175153fcd4b9dd11d7de4a546e diff --git a/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/dbus-glib-0.110-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/dbus-glib-0.112.ebuild similarity index 59% rename from sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/dbus-glib-0.110-r1.ebuild rename to sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/dbus-glib-0.112.ebuild index 2540e494ef..1dac549aef 100644 --- a/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/dbus-glib-0.110-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/dbus-glib-0.112.ebuild @@ -1,8 +1,9 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 -inherit bash-completion-r1 eutils ltprune multilib-minimal +EAPI=7 + +inherit autotools bash-completion-r1 multilib-minimal toolchain-funcs DESCRIPTION="D-Bus bindings for glib" HOMEPAGE="https://dbus.freedesktop.org/" @@ -10,29 +11,37 @@ SRC_URI="https://dbus.freedesktop.org/releases/${PN}/${P}.tar.gz" LICENSE="|| ( GPL-2 AFL-2.1 )" SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x86-solaris" -IUSE="debug static-libs test cros_host" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" +IUSE="debug static-libs test" RESTRICT="!test? ( test )" -CDEPEND=" +DEPEND=" >=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}] >=dev-libs/glib-2.40:2[${MULTILIB_USEDEP}] >=sys-apps/dbus-1.8[${MULTILIB_USEDEP}] " -DEPEND="${CDEPEND} +RDEPEND="${DEPEND}" +BDEPEND=" + >=dev-libs/expat-2.1.0-r3 + >=dev-libs/glib-2.40:2 + >=sys-apps/dbus-1.8 >=dev-util/glib-utils-2.40 >=dev-util/gtk-doc-am-1.14 virtual/pkgconfig -" -RDEPEND="${CDEPEND}" +" # CBUILD dependencies are needed to make a native tool while cross-compiling. -DOCS=( AUTHORS ChangeLog HACKING NEWS README ) +DOCS=( AUTHORS CONTRIBUTING.md NEWS README ) set_TBD() { # out of sources build dir for make check export TBD="${BUILD_DIR}-tests" } +src_prepare() { + default + eautoreconf +} + multilib_src_configure() { local myconf=( --localstatedir="${EPREFIX}"/var @@ -42,9 +51,13 @@ multilib_src_configure() { $(use_enable static-libs static) ) - # Use host tool when building cross. - if ! use cros_host; then - myconf+=("--with-dbus-binding-tool=/usr/bin/dbus-binding-tool") + # Configure a CBUILD directory to make a native build tool. + if tc-is-cross-compiler; then + mkdir "${BUILD_DIR}-build" || die + cd "${BUILD_DIR}-build" || die + ECONF_SOURCE="${S}" econf_build + myconf+=( --with-dbus-binding-tool="$PWD/dbus/dbus-binding-tool" ) + cd - || die fi ECONF_SOURCE="${S}" econf "${myconf[@]}" @@ -65,6 +78,8 @@ multilib_src_configure() { } multilib_src_compile() { + tc-is-cross-compiler && emake -C "${BUILD_DIR}-build" + emake if use test; then @@ -85,7 +100,7 @@ multilib_src_install_all() { einstalldocs newbashcomp "${ED}"/etc/bash_completion.d/dbus-bash-completion.sh dbus-send - rm -rf "${ED}"/etc/bash_completion.d || die + rm -r "${ED}"/etc/bash_completion.d || die - prune_libtool_files + find "${ED}" -type f -name '*.la' -delete || die } diff --git a/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/metadata.xml b/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/metadata.xml index 63e7905d8e..d73e5f1efb 100644 --- a/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/metadata.xml +++ b/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/metadata.xml @@ -1,5 +1,5 @@ - + freedesktop-bugs@gentoo.org From 6c5f93d3baf7db1a649987f1a78b954e826d5b6b Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 1 Oct 2021 10:06:41 +0200 Subject: [PATCH 04/11] dev-libs/dbus-glib: Apply Flatcar modifications --- .../coreos-overlay/dev-libs/dbus-glib/dbus-glib-0.112.ebuild | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/dbus-glib-0.112.ebuild b/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/dbus-glib-0.112.ebuild index 1dac549aef..248dee046e 100644 --- a/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/dbus-glib-0.112.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/dev-libs/dbus-glib/dbus-glib-0.112.ebuild @@ -58,6 +58,9 @@ multilib_src_configure() { ECONF_SOURCE="${S}" econf_build myconf+=( --with-dbus-binding-tool="$PWD/dbus/dbus-binding-tool" ) cd - || die + # Flatcar: override glib-genmarshal path + local build_pkg_config="$(tc-getBUILD_PROG PKG_CONFIG pkg-config)" + myconf+=(GLIB_GENMARSHAL="$("${build_pkg_config}" --variable=glib_genmarshal glib-2.0)") fi ECONF_SOURCE="${S}" econf "${myconf[@]}" From a4373a7c1b4b0653c8def8939b36df3874b7b2fb Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 1 Oct 2021 15:35:19 +0200 Subject: [PATCH 05/11] coreos-base/update_engine: Override path to glib-genmarshal Normally we use pkg-config to query flags and libraries that are needed to build things. These are specific to CHOST, and the build system usually uses pkg-config on CHOST to get those flags and libraries. But pkg-config is also used to query for the location of the tools used during the build, and for those we need to use pkg-config on CBUILD. But the build system is usually using the same pkg-config for both flags and libs, and for build tools. Which works fine for typical builds, but breaks for cross builds. One of such build tools is glib-genmarshal. Fortunately the build system allows us to override the detection results by passing GLIB_GENMARSHAL="${some_path}" to the configure script. So do that. --- .../coreos-base/update_engine/update_engine-9999.ebuild | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/update_engine/update_engine-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/update_engine/update_engine-9999.ebuild index d3b980b708..04d26683b6 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/update_engine/update_engine-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/update_engine/update_engine-9999.ebuild @@ -68,6 +68,12 @@ src_configure() { $(use_enable delta_generator) ) + if tc-is-cross-compiler; then + # Override glib-genmarshal path + local build_pkg_config="$(tc-getBUILD_PROG PKG_CONFIG pkg-config)" + myconf+=(GLIB_GENMARSHAL="$("${build_pkg_config}" --variable=glib_genmarshal glib-2.0)") + fi + econf "${myconf[@]}" } From 4cf37b61523dc9f2c29564efb95690cc73e49422 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 9 Nov 2021 12:32:34 +0100 Subject: [PATCH 06/11] sys-auth/sssd: Set the conf dir path explicitly Without passing the --with-systemdconfdir flag, the configure script will query pkg-config for the directory itself. In the cross-compilation setup that we have, this will result in a path sysroot prepended to the path twice. systemd.eclass has a workaround for this issue, but it does not provide an elegant getter of the system configuration directory, thus we call `_systemd_get_dir` ourselves. --- .../coreos-overlay/sys-auth/sssd/sssd-2.3.1-r3.ebuild | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-auth/sssd/sssd-2.3.1-r3.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-auth/sssd/sssd-2.3.1-r3.ebuild index cff3ef1eaa..b7edbb9742 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-auth/sssd/sssd-2.3.1-r3.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-auth/sssd/sssd-2.3.1-r3.ebuild @@ -195,6 +195,11 @@ multilib_src_configure() { myconf+=( --with-initscript="systemd" --with-systemdunitdir=$(systemd_get_systemunitdir) + # Flatcar: Set the systemd system + # configuration directory explicitly through + # _systemd_get_dir, as it will do the right + # thing in cross-compilation environment. + --with-systemdconfdir=$(_systemd_get_dir systemdsystemconfdir /etc/systemd/system) ) else myconf+=(--with-initscript="sysv") From ce7cc55536418c1265403bc32ad75263a3e4f1aa Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 9 Nov 2021 13:07:21 +0100 Subject: [PATCH 07/11] app-crypt/p11-kit: Add from gentoo It's from gentoo commit 38b155fa1bf907617067c98eb4ba3a5d0790eb1a. --- .../coreos-overlay/app-crypt/p11-kit/Manifest | 1 + .../app-crypt/p11-kit/metadata.xml | 15 +++++ .../app-crypt/p11-kit/p11-kit-0.23.22.ebuild | 62 +++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/Manifest create mode 100644 sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/metadata.xml create mode 100644 sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/p11-kit-0.23.22.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/Manifest b/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/Manifest new file mode 100644 index 0000000000..8b75e07bb5 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/Manifest @@ -0,0 +1 @@ +DIST p11-kit-0.23.22.tar.xz 830016 BLAKE2B 4e1edfd9e2441d237c07a16c003aee5ffde38f1cf545c26e435645429f2cfa4fe7ca61cdc3c3940390aa040ba991f2ee3995b14cc31bb886d5eeffa8ed5e1721 SHA512 098819e6ca4ad9cc2a0bc2e478aea67354d051a4f03e6c7d75d13d2469b6dc7654f26b15530052f6ed51acb35531c2539e0f971b31e29e6673e857c903afb080 diff --git a/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/metadata.xml b/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/metadata.xml new file mode 100644 index 0000000000..ff17590b69 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/metadata.xml @@ -0,0 +1,15 @@ + + + + + zlogene@gentoo.org + Mikle Kolyada + + + Enable ASN.1 certificate support + Build the trust policy module + + + p11-glue/p11-kit + + diff --git a/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/p11-kit-0.23.22.ebuild b/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/p11-kit-0.23.22.ebuild new file mode 100644 index 0000000000..d8fecbda23 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/p11-kit-0.23.22.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit multilib-minimal + +DESCRIPTION="Provides a standard configuration setup for installing PKCS#11" +HOMEPAGE="https://p11-glue.github.io/p11-glue/p11-kit.html" +SRC_URI="https://github.com/p11-glue/p11-kit/releases/download/${PV}/${P}.tar.xz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="+asn1 debug +libffi systemd +trust" +REQUIRED_USE="trust? ( asn1 )" + +RDEPEND="asn1? ( >=dev-libs/libtasn1-3.4:=[${MULTILIB_USEDEP}] ) + libffi? ( dev-libs/libffi:=[${MULTILIB_USEDEP}] ) + systemd? ( sys-apps/systemd:= ) + trust? ( app-misc/ca-certificates )" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +pkg_setup() { + # disable unsafe tests, bug#502088 + export FAKED_MODE=1 +} + +src_prepare() { + if [[ ${CHOST} == *-solaris2.* && ${CHOST##*-solaris2.} -lt 11 ]] ; then + # Solaris 10 and before doesn't know about XPG7 (XOPEN_SOURCE=700) + # drop to XPG6 to make feature_tests.h happy + sed -i -e '/define _XOPEN_SOURCE/s/700/600/' common/compat.c || die + # paths.h isn't available, oddly enough also not used albeit included + sed -i -e '/#include /d' trust/test-trust.c || die + # we don't have SUN_LEN here + sed -i -e 's/SUN_LEN \(([^)]\+)\)/strlen (\1->sun_path)/' \ + p11-kit/server.c || die + fi + default +} + +multilib_src_configure() { + ECONF_SOURCE="${S}" econf \ + $(use_enable trust trust-module) \ + $(use_with trust trust-paths ${EPREFIX}/etc/ssl/certs/ca-certificates.crt) \ + $(use_enable debug) \ + $(use_with libffi) \ + $(use_with asn1 libtasn1) \ + $(multilib_native_use_with systemd) + + if multilib_is_native_abi; then + # re-use provided documentation + ln -s "${S}"/doc/manual/html doc/manual/html || die + fi +} + +multilib_src_install_all() { + einstalldocs + find "${D}" -name '*.la' -delete || die +} From 2cc885be591d03bf02baf369e76532703fec7f98 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 9 Nov 2021 13:14:23 +0100 Subject: [PATCH 08/11] app-crypt/p11-kit: Apply Flatcar modifications --- .../coreos-overlay/app-crypt/p11-kit/README.md | 4 ++++ .../app-crypt/p11-kit/p11-kit-0.23.22.ebuild | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/README.md diff --git a/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/README.md b/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/README.md new file mode 100644 index 0000000000..92a3038272 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/README.md @@ -0,0 +1,4 @@ +We forked this package to fix the systemd user unit directory and bash +completion directory detection in the cross-compilation scenario. + +These fixes could be upstreamed to gentoo. diff --git a/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/p11-kit-0.23.22.ebuild b/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/p11-kit-0.23.22.ebuild index d8fecbda23..b36df3db26 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/p11-kit-0.23.22.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-crypt/p11-kit/p11-kit-0.23.22.ebuild @@ -3,7 +3,9 @@ EAPI=7 -inherit multilib-minimal +# Flatcar: inherit systemd eclass for the systemd user unit directory +# getter, and bash-completion-r1 for bash completion directory getter. +inherit multilib-minimal systemd bash-completion-r1 DESCRIPTION="Provides a standard configuration setup for installing PKCS#11" HOMEPAGE="https://p11-glue.github.io/p11-glue/p11-kit.html" @@ -42,6 +44,11 @@ src_prepare() { } multilib_src_configure() { + # Flatcar: Override the detection of the systemd user unit + # directory and bash completion directory with these + # environment variables. + local -x systemduserunitdir=$(systemd_get_userunitdir) + local -x bashcompdir=$(get_bashcompdir) ECONF_SOURCE="${S}" econf \ $(use_enable trust trust-module) \ $(use_with trust trust-paths ${EPREFIX}/etc/ssl/certs/ca-certificates.crt) \ From f6b8a1ab88f62052a6a222a501d2a9f38cec4fe4 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 9 Nov 2021 13:44:16 +0100 Subject: [PATCH 09/11] sys-fs/lvm2: Fix detection of systemd util directory There usually exists a way to tell the configure script to use certain path, so the script won't try to autodetect things. This is a case for the systemd system unit directory, but apparently not for systemd util directory. So for the system unit directory, we can forward the path we received from systemd.eclass' `systemd_get_systemunitdir`, but for the util directory, we need to hack the script with `sed`. The reason for this is that autodetected directory will have the sysroot path prepended twice. The systemd eclass has a workaround for this issue. --- .../src/third_party/coreos-overlay/sys-fs/lvm2/README.md | 5 +++++ .../coreos-overlay/sys-fs/lvm2/lvm2-2.02.188-r2.ebuild | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-fs/lvm2/README.md b/sdk_container/src/third_party/coreos-overlay/sys-fs/lvm2/README.md index cfb0a6ca81..379916ebf0 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-fs/lvm2/README.md +++ b/sdk_container/src/third_party/coreos-overlay/sys-fs/lvm2/README.md @@ -13,3 +13,8 @@ systemd[1]: lvm2-activation-early.service: Failed with result 'start-limit-hit'. Set RemainAfterExit=yes as done for the other oneshot services to prevent the unit from running multiple times in a row and hitting the restart limit. + + + +We also patch the configure script to use the correct path for systemd +util directory. diff --git a/sdk_container/src/third_party/coreos-overlay/sys-fs/lvm2/lvm2-2.02.188-r2.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-fs/lvm2/lvm2-2.02.188-r2.ebuild index fde27a9249..4a646e65df 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-fs/lvm2/lvm2-2.02.188-r2.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-fs/lvm2/lvm2-2.02.188-r2.ebuild @@ -123,6 +123,13 @@ src_prepare() { sed -i -e 's/^\(MAN7+=.*\) $(LVMTHINMAN) \(.*\)$/\1 \2/' man/Makefile.in || die fi + # Flatcar: The configure script tries to detect the systemd + # util dir without providing a way for us to override it, so + # modify the script. + sed -i \ + -e "s#^\(systemdutildir=\).*#\1$(systemd_get_utildir)#" \ + configure{.ac,} || die + eautoreconf } From ed3e805682cd19644b3187790a651f9f9424dc3f Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 10 Nov 2021 09:19:20 +0100 Subject: [PATCH 10/11] sys-fs/btrfs-progs: Add from gentoo It's from gentoo commit 638e02f491a1e37f2af31523490f00f8a118419d. --- .../sys-fs/btrfs-progs/Manifest | 1 + .../btrfs-progs/btrfs-progs-5.10.1-r1.ebuild | 127 ++++++++++++++++++ .../sys-fs/btrfs-progs/metadata.xml | 13 ++ 3 files changed, 141 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/Manifest create mode 100644 sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/btrfs-progs-5.10.1-r1.ebuild create mode 100644 sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/metadata.xml diff --git a/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/Manifest b/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/Manifest new file mode 100644 index 0000000000..cd25843c27 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/Manifest @@ -0,0 +1 @@ +DIST btrfs-progs-v5.10.1.tar.xz 2204164 BLAKE2B ed83729754f9abd22d4d2e7ae9a7e90e80be9b63d49a4a9692e20e5939467dbd864834b71495661e1c7a1fca89e253a62fbda37f1d01d2eadecb13f5904f0dd0 SHA512 32e5b8bda1863e34613802db91946f240b2cde21288ff8f95c1807e7afd0a67c5a704aa4d2bc0d7b1ca094de6831adbfec83fe61f74e1caf6d1975be7d972f2d diff --git a/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/btrfs-progs-5.10.1-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/btrfs-progs-5.10.1-r1.ebuild new file mode 100644 index 0000000000..ec36b2152a --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/btrfs-progs-5.10.1-r1.ebuild @@ -0,0 +1,127 @@ +# Copyright 2008-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{8..9} ) + +inherit bash-completion-r1 python-single-r1 + +libbtrfs_soname=0 + +if [[ ${PV} != 9999 ]]; then + MY_PV="v${PV/_/-}" + [[ "${PV}" = *_rc* ]] || \ + KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~mips ppc ppc64 ~riscv ~sparc x86" + SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz" + S="${WORKDIR}/${PN}-${MY_PV}" +else + WANT_LIBTOOL=none + inherit autotools git-r3 + EGIT_REPO_URI="https://github.com/kdave/btrfs-progs.git" + EGIT_BRANCH="devel" +fi + +DESCRIPTION="Btrfs filesystem utilities" +HOMEPAGE="https://btrfs.wiki.kernel.org" + +LICENSE="GPL-2" +SLOT="0/${libbtrfs_soname}" +IUSE="+convert doc python reiserfs static static-libs +zstd" + +RESTRICT=test # tries to mount repared filesystems + +RDEPEND=" + dev-libs/lzo:2= + sys-apps/util-linux:0=[static-libs(+)?] + sys-libs/zlib:0= + convert? ( + sys-fs/e2fsprogs:= + reiserfs? ( + >=sys-fs/reiserfsprogs-3.6.27 + ) + ) + python? ( ${PYTHON_DEPS} ) + zstd? ( app-arch/zstd:0= ) +" +DEPEND="${RDEPEND} + convert? ( sys-apps/acl ) + python? ( + $(python_gen_cond_dep ' + dev-python/setuptools[${PYTHON_USEDEP}] + ') + ) + static? ( + dev-libs/lzo:2[static-libs(+)] + sys-apps/util-linux:0[static-libs(+)] + sys-libs/zlib:0[static-libs(+)] + convert? ( + sys-fs/e2fsprogs[static-libs(+)] + reiserfs? ( + >=sys-fs/reiserfsprogs-3.6.27[static-libs(+)] + ) + ) + zstd? ( app-arch/zstd:0[static-libs(+)] ) + ) +" +BDEPEND=" + doc? ( + || ( >=app-text/asciidoc-8.6.0 dev-ruby/asciidoctor ) + app-text/docbook-xml-dtd:4.5 + app-text/xmlto + ) +" + +if [[ ${PV} == 9999 ]]; then + DEPEND+=" sys-devel/gnuconfig" +fi + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +src_prepare() { + default + if [[ ${PV} == 9999 ]]; then + AT_M4DIR=m4 eautoreconf + mkdir config || die + local automakedir="$(autotools_run_tool --at-output automake --print-libdir)" + [[ -e ${automakedir} ]] || die "Could not locate automake directory" + ln -s "${automakedir}"/install-sh config/install-sh || die + ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die + ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die + fi +} + +src_configure() { + local myeconfargs=( + --bindir="${EPREFIX}"/sbin + $(use_enable convert) + $(use_enable doc documentation) + $(use_enable elibc_glibc backtrace) + $(use_enable python) + $(use_enable static-libs static) + $(use_enable zstd) + --with-convert=ext2$(usex reiserfs ',reiserfs' '') + ) + econf "${myeconfargs[@]}" +} + +src_compile() { + emake V=1 all $(usev static) +} + +src_install() { + local makeargs=( + $(usex python install_python '') + $(usex static install-static '') + ) + emake V=1 DESTDIR="${D}" install "${makeargs[@]}" + newbashcomp btrfs-completion btrfs + use python && python_optimize + + # install prebuilt subset of manuals + use doc || doman Documentation/*.[58] +} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/metadata.xml b/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/metadata.xml new file mode 100644 index 0000000000..53a0e4c3fe --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/metadata.xml @@ -0,0 +1,13 @@ + + + + + base-system@gentoo.org + Gentoo Base System + + + Build ext2 conversion utility (btrfs-convert) + Enable reiserfs support in btrfs-convert tool. + Build static binaries in addition to the dynamic ones + + From e6897de5e44ebfebd0c022640ac4b2070da64283 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 10 Nov 2021 14:32:35 +0100 Subject: [PATCH 11/11] sys-fs/btrfs-progs: Apply Flatcar modifications --- .../coreos-overlay/sys-fs/btrfs-progs/README.md | 9 +++++++++ .../sys-fs/btrfs-progs/btrfs-progs-5.10.1-r1.ebuild | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/README.md diff --git a/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/README.md b/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/README.md new file mode 100644 index 0000000000..1b8790d15d --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/README.md @@ -0,0 +1,9 @@ +We forked this package to override the udev rules directory. The +configure script does not provide a way to override it, so we need to +hack it, otherwise the configure script will figure out the wrong path +in our builds. We do it by overriding it in Makefile.inc.in. Also, we +change the python versions, because we still have only python 3.6. + +Ideal solution here would be to patch btrfs-progs to allow overriding +the udev path and then override it in the ebuild properly, without the +sed hacks. diff --git a/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/btrfs-progs-5.10.1-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/btrfs-progs-5.10.1-r1.ebuild index ec36b2152a..73632e785d 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/btrfs-progs-5.10.1-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-fs/btrfs-progs/btrfs-progs-5.10.1-r1.ebuild @@ -3,9 +3,11 @@ EAPI=7 -PYTHON_COMPAT=( python3_{8..9} ) +# Flatcar: We still have python 3.6 only. +PYTHON_COMPAT=( python3_{6..9} ) -inherit bash-completion-r1 python-single-r1 +# Flatcar: Inherit udev eclass, so we can get the udev directory. +inherit bash-completion-r1 python-single-r1 udev libbtrfs_soname=0 @@ -93,6 +95,8 @@ src_prepare() { ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die fi + # Flatcar: Replace udevdir variable with proper udev directory. + sed -i -e 's#^\(udevdir\s\+=\).*#\1 $(get_udevdir)#' Makefile.inc.in } src_configure() {