From 15cfc5badb0c2a7132b63f1912464a143176c625 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Mon, 8 Jul 2024 17:48:24 +0100 Subject: [PATCH 1/8] app-arch/pixz: Import from Gentoo This is needed by Catalyst 4. Signed-off-by: James Le Cuirot --- .../portage-stable/app-arch/pixz/Manifest | 1 + .../portage-stable/app-arch/pixz/metadata.xml | 11 ++++ .../app-arch/pixz/pixz-1.0.7-r1.ebuild | 63 +++++++++++++++++++ .../app-arch/pixz/pixz-9999.ebuild | 60 ++++++++++++++++++ 4 files changed, 135 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/app-arch/pixz/Manifest create mode 100644 sdk_container/src/third_party/portage-stable/app-arch/pixz/metadata.xml create mode 100644 sdk_container/src/third_party/portage-stable/app-arch/pixz/pixz-1.0.7-r1.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/app-arch/pixz/pixz-9999.ebuild diff --git a/sdk_container/src/third_party/portage-stable/app-arch/pixz/Manifest b/sdk_container/src/third_party/portage-stable/app-arch/pixz/Manifest new file mode 100644 index 00000000000..e3e710507a2 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-arch/pixz/Manifest @@ -0,0 +1 @@ +DIST pixz-1.0.7.tar.xz 120876 BLAKE2B 23563837169611d54dc4540715537b2e16c66bd9682097e4f37957e7422b487f221603b11aa30a39fd05c77dbeddc1697ac9ffe208d984c1da885a67f79a180f SHA512 7f343cb74958b9582b60a2e916243e72421fad1ebecc5867c9e046c881e8a318da9bb885edd71da8fe6953fd5d5c2f5119133cd0bbbf4d0f9b35f8aecd61120d diff --git a/sdk_container/src/third_party/portage-stable/app-arch/pixz/metadata.xml b/sdk_container/src/third_party/portage-stable/app-arch/pixz/metadata.xml new file mode 100644 index 00000000000..4f7e31333ee --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-arch/pixz/metadata.xml @@ -0,0 +1,11 @@ + + + + + zerochaos@gentoo.org + Rick Farina + + + vasi/pixz + + diff --git a/sdk_container/src/third_party/portage-stable/app-arch/pixz/pixz-1.0.7-r1.ebuild b/sdk_container/src/third_party/portage-stable/app-arch/pixz/pixz-1.0.7-r1.ebuild new file mode 100644 index 00000000000..42b11e22d69 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-arch/pixz/pixz-1.0.7-r1.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://github.com/vasi/${PN}.git" + inherit git-r3 autotools +else + SRC_URI="https://github.com/vasi/pixz/releases/download/v${PV}/${P}.tar.xz" + KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86" +fi + +DESCRIPTION="Parallel Indexed XZ compressor" +HOMEPAGE="https://github.com/vasi/pixz" + +LICENSE="BSD-2" +SLOT="0" +IUSE="static" + +LIB_DEPEND=" + >=app-arch/libarchive-2.8:=[static-libs(+)] + >=app-arch/xz-utils-5[static-libs(+)] +" +RDEPEND=" + !static? ( ${LIB_DEPEND//\[static-libs(+)]} ) +" +DEPEND=" + ${RDEPEND} + static? ( ${LIB_DEPEND} ) +" +[[ ${PV} == 9999 ]] && BDEPEND+=" app-text/asciidoc" + +src_prepare() { + default + + # We're not interested in linting tests for our purposes (bug #915008) + cat > test/cppcheck-src.sh <<-EOF || die + #!/bin/sh + exit 77 + EOF + + [[ ${PV} == "9999" ]] && eautoreconf +} + +src_configure() { + use static && append-ldflags -static + append-flags -std=gnu99 + + # Workaround silly logic that breaks cross-compiles. + # https://github.com/vasi/pixz/issues/67 + export ac_cv_file_src_pixz_1=$([[ -f src/pixz.1 ]] && echo yes || echo no) + econf +} + +src_install() { + default + + # https://github.com/vasi/pixz/issues/94 + [[ ${PV} == "9999" ]] || doman src/pixz.1 +} diff --git a/sdk_container/src/third_party/portage-stable/app-arch/pixz/pixz-9999.ebuild b/sdk_container/src/third_party/portage-stable/app-arch/pixz/pixz-9999.ebuild new file mode 100644 index 00000000000..10a369c58a1 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-arch/pixz/pixz-9999.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://github.com/vasi/${PN}.git" + inherit git-r3 autotools +else + SRC_URI="https://github.com/vasi/pixz/releases/download/v${PV}/${P}.tar.xz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +fi + +DESCRIPTION="Parallel Indexed XZ compressor" +HOMEPAGE="https://github.com/vasi/pixz" + +LICENSE="BSD-2" +SLOT="0" +IUSE="static" + +LIB_DEPEND=" + >=app-arch/libarchive-2.8:=[static-libs(+)] + >=app-arch/xz-utils-5[static-libs(+)] +" +RDEPEND=" + !static? ( ${LIB_DEPEND//\[static-libs(+)]} ) +" +DEPEND=" + ${RDEPEND} + static? ( ${LIB_DEPEND} ) +" +[[ ${PV} == 9999 ]] && BDEPEND+=" app-text/asciidoc" + +src_prepare() { + default + + # We're not interested in linting tests for our purposes (bug #915008) + cat > test/cppcheck-src.sh <<-EOF || die + #!/bin/sh + exit 77 + EOF + + [[ ${PV} == "9999" ]] && eautoreconf +} + +src_configure() { + use static && append-ldflags -static + append-flags -std=gnu99 + + econf +} + +src_install() { + default + + # https://github.com/vasi/pixz/issues/94 + [[ ${PV} == "9999" ]] || doman src/pixz.1 +} From 82c6aacd713f9b61a65136b442bcfcc32b36f07b Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Mon, 8 Jul 2024 17:48:53 +0100 Subject: [PATCH 2/8] sys-fs/squashfs-tools-ng: Import from Gentoo This is needed by Catalyst 4. Signed-off-by: James Le Cuirot --- .../sys-fs/squashfs-tools-ng/Manifest | 2 + .../sys-fs/squashfs-tools-ng/metadata.xml | 14 +++++ .../squashfs-tools-ng-1.3.0.ebuild | 57 +++++++++++++++++++ .../squashfs-tools-ng-1.3.1.ebuild | 57 +++++++++++++++++++ .../squashfs-tools-ng-9999.ebuild | 57 +++++++++++++++++++ 5 files changed, 187 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/Manifest create mode 100644 sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/metadata.xml create mode 100644 sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-1.3.0.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-1.3.1.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-9999.ebuild diff --git a/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/Manifest b/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/Manifest new file mode 100644 index 00000000000..26e21fcfc54 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/Manifest @@ -0,0 +1,2 @@ +DIST squashfs-tools-ng-1.3.0.tar.xz 585800 BLAKE2B 658ff825b2cda63116c29d8c582f54df5bd511a6da98e737527d54720ed95a541edc39b94f61195f4c99d125cbcc8db824ea9d1e2a7a7a557fb647f5e795d623 SHA512 10ddff837464227d97c3c2dabeefa408a63fbab4ddc8ca184f4ecce7288ac47c0c6baf6d10146f7e29e4a845592720e39281f779420f5ba0b1e7736c0dea73d7 +DIST squashfs-tools-ng-1.3.1.tar.xz 585916 BLAKE2B 697131ddb9959bed388534f90c93e2e7495ef5aec9facf97e7d17475cff64d7a4badb709a16ae5e6da3ee89b1a1e3a49833bd15b9a0b4b364e15a565bd18e480 SHA512 0a433f7c3633cd5d8646d990744e31ed59c7012d5f8bb4fdb7892b892631f22a8fd0969f7d81de68f53e44670e71cb8e29729cd925a93b98ab3b6942bbc30662 diff --git a/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/metadata.xml b/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/metadata.xml new file mode 100644 index 00000000000..cca9452d2e4 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/metadata.xml @@ -0,0 +1,14 @@ + + + + + mattst88@gentoo.org + Matt Turner + + + Build the gensquashfs, rdsquashfs, sqfs2tar, sqfsdiff, and tar2sqfs tools + + + AgentD/squashfs-tools-ng + + diff --git a/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-1.3.0.ebuild b/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-1.3.0.ebuild new file mode 100644 index 00000000000..a4168be5e3b --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-1.3.0.ebuild @@ -0,0 +1,57 @@ +# Copyright 2019-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="A new set of tools for working with SquashFS images" +HOMEPAGE="https://github.com/AgentD/squashfs-tools-ng" +if [[ ${PV} = 9999* ]]; then + inherit autotools git-r3 + EGIT_REPO_URI="https://github.com/AgentD/${PN}.git" +else + inherit libtool + KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + SRC_URI="https://infraroot.at/pub/squashfs/${P}.tar.xz" +fi + +LICENSE="LGPL-3+ BSD-2 MIT tools? ( GPL-3+ )" +SLOT="0" +IUSE="lz4 +lzma lzo selinux +tools zstd" + +DEPEND=" + app-arch/bzip2:= + sys-libs/zlib:= + lz4? ( app-arch/lz4:= ) + lzma? ( app-arch/xz-utils ) + lzo? ( dev-libs/lzo:2 ) + selinux? ( sys-libs/libselinux:= ) + zstd? ( app-arch/zstd:= ) +" +RDEPEND="${DEPEND}" + +src_prepare() { + default + if [[ ${PV} = "9999" ]]; then + eautoreconf + else + elibtoolize + fi +} + +src_configure() { + local myconf=( + --disable-static + $(use_with lz4) + $(use_with lzo) + $(use_with selinux) + $(use_with tools) + $(use_with lzma xz) + $(use_with zstd) + ) + econf "${myconf[@]}" +} + +src_install() { + default + find "${D}" -name "*.la" -delete || die +} diff --git a/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-1.3.1.ebuild b/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-1.3.1.ebuild new file mode 100644 index 00000000000..313023a84cc --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-1.3.1.ebuild @@ -0,0 +1,57 @@ +# Copyright 2019-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="A new set of tools for working with SquashFS images" +HOMEPAGE="https://github.com/AgentD/squashfs-tools-ng" +if [[ ${PV} = 9999* ]]; then + inherit autotools git-r3 + EGIT_REPO_URI="https://github.com/AgentD/${PN}.git" +else + inherit libtool + KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + SRC_URI="https://infraroot.at/pub/squashfs/${P}.tar.xz" +fi + +LICENSE="LGPL-3+ BSD-2 MIT tools? ( GPL-3+ )" +SLOT="0" +IUSE="lz4 +lzma lzo selinux +tools zstd" + +DEPEND=" + app-arch/bzip2:= + sys-libs/zlib:= + lz4? ( app-arch/lz4:= ) + lzma? ( app-arch/xz-utils ) + lzo? ( dev-libs/lzo:2 ) + selinux? ( sys-libs/libselinux:= ) + zstd? ( app-arch/zstd:= ) +" +RDEPEND="${DEPEND}" + +src_prepare() { + default + if [[ ${PV} = "9999" ]]; then + eautoreconf + else + elibtoolize + fi +} + +src_configure() { + local myconf=( + --disable-static + $(use_with lz4) + $(use_with lzo) + $(use_with selinux) + $(use_with tools) + $(use_with lzma xz) + $(use_with zstd) + ) + econf "${myconf[@]}" +} + +src_install() { + default + find "${D}" -name "*.la" -delete || die +} diff --git a/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-9999.ebuild b/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-9999.ebuild new file mode 100644 index 00000000000..f936c78e267 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-fs/squashfs-tools-ng/squashfs-tools-ng-9999.ebuild @@ -0,0 +1,57 @@ +# Copyright 2019-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="A new set of tools for working with SquashFS images" +HOMEPAGE="https://github.com/AgentD/squashfs-tools-ng" +if [[ ${PV} = 9999* ]]; then + inherit autotools git-r3 + EGIT_REPO_URI="https://github.com/AgentD/${PN}.git" +else + inherit libtool + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + SRC_URI="https://infraroot.at/pub/squashfs/${P}.tar.xz" +fi + +LICENSE="LGPL-3+ BSD-2 MIT tools? ( GPL-3+ )" +SLOT="0" +IUSE="lz4 +lzma lzo selinux +tools zstd" + +DEPEND=" + app-arch/bzip2:= + sys-libs/zlib:= + lz4? ( app-arch/lz4:= ) + lzma? ( app-arch/xz-utils ) + lzo? ( dev-libs/lzo:2 ) + selinux? ( sys-libs/libselinux:= ) + zstd? ( app-arch/zstd:= ) +" +RDEPEND="${DEPEND}" + +src_prepare() { + default + if [[ ${PV} = "9999" ]]; then + eautoreconf + else + elibtoolize + fi +} + +src_configure() { + local myconf=( + --disable-static + $(use_with lz4) + $(use_with lzo) + $(use_with selinux) + $(use_with tools) + $(use_with lzma xz) + $(use_with zstd) + ) + econf "${myconf[@]}" +} + +src_install() { + default + find "${D}" -name "*.la" -delete || die +} From 6d96f2a9ac8147a60d1806791ef0dd2684c23297 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Mon, 8 Jul 2024 19:24:34 +0100 Subject: [PATCH 3/8] dev-util/catalyst: Sync with Gentoo Signed-off-by: James Le Cuirot --- .../portage-stable/dev-util/catalyst/Manifest | 1 + .../dev-util/catalyst/catalyst-4.0_rc1.ebuild | 2 +- .../dev-util/catalyst/catalyst-4.0_rc2.ebuild | 130 ++++++++++++++++++ .../dev-util/catalyst/catalyst-9999.ebuild | 2 +- 4 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-4.0_rc2.ebuild diff --git a/sdk_container/src/third_party/portage-stable/dev-util/catalyst/Manifest b/sdk_container/src/third_party/portage-stable/dev-util/catalyst/Manifest index 6e330cfa382..2ce9f0ec5b9 100644 --- a/sdk_container/src/third_party/portage-stable/dev-util/catalyst/Manifest +++ b/sdk_container/src/third_party/portage-stable/dev-util/catalyst/Manifest @@ -1,3 +1,4 @@ DIST catalyst-3.0.21.tar.bz2 620472 BLAKE2B 6ecf59edde24cbec6d072a31680b75e2e7f142e267b43783473dc607b189d5091b6ca2b7bd02e88a6528a7bccea8441fce21c74aed6623ec14d701557fb4d267 SHA512 e2c58a562508e25465186a5d9771040ddb9f00104943a6434489e5ef01da220ac0330339f741d023717c8d1df6ec2bf765654fabe4097d93d3086ef9005a294c DIST catalyst-3.0.22.tar.bz2 620528 BLAKE2B f0eb5bf1052ba65bcdab4a14fe8ab564b6396c8a7271ee16c664b90c595df2a7bcda480279d64e0c7c6ff2045e0119a6a3afec75819a673ae721e77587e1f2b2 SHA512 c2b2d20ee6581b7c9c837fd64e798b0d1b0e5cc00346827cdf7154af8e8b6e279d32ab0d7f10314aa8d50923065e8b1121d2c01a506521cdae04736769cf6ba4 DIST catalyst-4.0-rc1.tar.bz2 355575 BLAKE2B 373f3fa4a340e14461ab4881ae17cb8266e01a3d66fdffe37d648e5b816e95064e36360b3ced7dd4dc9f05c80eabdeb41dac506d4c156fa3072056b35a6e1074 SHA512 89660b603ecb6acf39b6bb7eb6e43f035c30b1610636586c84b9a75140963e2aefe4a9d97f465c15c293da9c4fc4146f0edce5685293a290d5d182e131dabb7b +DIST catalyst-4.0-rc2.tar.bz2 355924 BLAKE2B b14905e989674a9b547c6e7c83129e1bcc0b55cf64b86e0668532d067518d7a66dd0d494b9e1f84bf0ba9f6d57c79baeb39c35d7ffd9ef09602dd4c1be9a1bd9 SHA512 16ffdf74639bde74e043480d3c756121489033cf72850b38959701c53a689263b46bb10403496de222af00321b5d691aba7bcb41eafb8b5dcb1dd56dd658ace5 diff --git a/sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-4.0_rc1.ebuild b/sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-4.0_rc1.ebuild index 9bf921904e9..7bc3d781337 100644 --- a/sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-4.0_rc1.ebuild +++ b/sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-4.0_rc1.ebuild @@ -15,7 +15,7 @@ else S="${WORKDIR}/${MY_P/_/-}" fi -PYTHON_COMPAT=( python3_{9..11} ) +PYTHON_COMPAT=( python3_{9..12} ) DISTUTILS_USE_PEP517=setuptools inherit distutils-r1 linux-info optfeature tmpfiles ${SRC_ECLASS} diff --git a/sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-4.0_rc2.ebuild b/sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-4.0_rc2.ebuild new file mode 100644 index 00000000000..7bc3d781337 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-4.0_rc2.ebuild @@ -0,0 +1,130 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_P=${P/_/-} + +if [[ ${PV} == *9999* ]]; then + SRC_ECLASS="git-r3" + EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/catalyst.git" + EGIT_BRANCH="master" +else + SRC_URI="https://gitweb.gentoo.org/proj/catalyst.git/snapshot/${MY_P}.tar.bz2" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + S="${WORKDIR}/${MY_P/_/-}" +fi + +PYTHON_COMPAT=( python3_{9..12} ) +DISTUTILS_USE_PEP517=setuptools + +inherit distutils-r1 linux-info optfeature tmpfiles ${SRC_ECLASS} + +DESCRIPTION="Release metatool used for creating releases based on Gentoo Linux" +HOMEPAGE="https://wiki.gentoo.org/wiki/Catalyst" + +LICENSE="GPL-2+" +SLOT="0" +IUSE="doc +iso" + +BDEPEND=" + app-text/asciidoc +" +DEPEND=" + sys-apps/portage[${PYTHON_USEDEP}] + >=dev-python/snakeoil-0.6.5[${PYTHON_USEDEP}] + dev-python/fasteners[${PYTHON_USEDEP}] + dev-python/tomli[${PYTHON_USEDEP}] + sys-apps/util-linux[python,${PYTHON_USEDEP}] +" +RDEPEND=" + ${DEPEND} + >=dev-python/pydecomp-0.3[${PYTHON_USEDEP}] + app-arch/lbzip2 + app-arch/pixz + app-arch/tar[xattr] + dev-vcs/git + sys-fs/dosfstools + sys-fs/squashfs-tools-ng[tools] + + iso? ( + app-cdr/cdrtools + dev-libs/libisoburn + + amd64? ( + sys-boot/grub[grub_platforms_efi-32,grub_platforms_efi-64] + sys-fs/mtools + ) + arm64? ( + sys-boot/grub[grub_platforms_efi-64] + sys-fs/mtools + ) + ia64? ( + sys-boot/grub[grub_platforms_efi-64] + sys-fs/mtools + ) + ppc? ( + sys-boot/grub:2[grub_platforms_ieee1275] + ) + ppc64? ( + sys-boot/grub:2[grub_platforms_ieee1275] + ) + sparc? ( + sys-boot/grub:2[grub_platforms_ieee1275] + ) + x86? ( + sys-boot/grub[grub_platforms_efi-32] + ) + ) +" + +pkg_setup() { + CONFIG_CHECK=" + ~UTS_NS ~IPC_NS + ~SQUASHFS ~SQUASHFS_ZLIB + " + linux-info_pkg_setup +} + +python_prepare_all() { + python_setup + echo VERSION="${PV}" "${PYTHON}" setup.py set_version + VERSION="${PV}" "${PYTHON}" setup.py set_version || die + distutils-r1_python_prepare_all +} + +# Build man pages here so as to not clobber default src_compile +src_configure() { + # build the man pages and docs + emake +} + +python_install_all() { + distutils-r1_python_install_all + if use doc; then + dodoc files/HOWTO.html files/docbook-xsl.css + fi +} + +python_install() { + distutils-r1_python_install + rm -rv "${D}"$(python_get_sitedir)/usr +} + +src_install() { + distutils-r1_src_install + + echo 'd /var/tmp/catalyst 0755 root root' > "${T}"/catalyst-tmpdir.conf + dotmpfiles "${T}"/catalyst-tmpdir.conf + + doman files/catalyst.1 files/catalyst-config.5 files/catalyst-spec.5 + insinto /etc/catalyst + doins etc/* +} + +pkg_postinst() { + if [[ -z ${REPLACING_VERSIONS} ]]; then + optfeature "ccache support" dev-util/ccache + fi + tmpfiles_process catalyst-tmpdir.conf +} diff --git a/sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-9999.ebuild b/sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-9999.ebuild index c5bd9ff2d04..541b54e2bac 100644 --- a/sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-9999.ebuild +++ b/sdk_container/src/third_party/portage-stable/dev-util/catalyst/catalyst-9999.ebuild @@ -12,7 +12,7 @@ else KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" fi -PYTHON_COMPAT=( python3_{9..11} ) +PYTHON_COMPAT=( python3_{9..12} ) DISTUTILS_USE_PEP517=setuptools inherit distutils-r1 linux-info optfeature tmpfiles ${SRC_ECLASS} From 8d8be982289f3f4ae67959c1754e6d92ec1d7dd7 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Fri, 28 Jun 2024 23:15:58 +0100 Subject: [PATCH 4/8] Drop Python path override hack in profile.bashrc This hasn't been needed for a while, since Gentoo started handling Python modules according to PEP 517. We now need util-linux with Python support for Catalyst 4, and this hack erroneously causes the module to be installed under /usr/lib64 rather than /usr/lib. Signed-off-by: James Le Cuirot --- .../profiles/coreos/base/profile.bashrc | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc index e686af54199..7abb2c7af01 100644 --- a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc +++ b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc @@ -71,23 +71,6 @@ cros_setup_hooks() { } cros_setup_hooks -# Packages that use python will run a small python script to find the -# pythondir. Unfortunately, they query the host python to find out the -# paths for things, which means they inevitably guess wrong. Export -# the cached values ourselves and since we know these are going through -# autoconf, we can leverage ${libdir} that econf sets up automatically. -cros_pre_src_unpack_python_multilib_setup() { - # Avoid executing multiple times in a single build. - [[ ${am_cv_python_version:+set} == "set" ]] && return - - local py=${PYTHON:-python} - local py_ver=$(${py} -c 'import sys;sys.stdout.write(sys.version[:4])') - - export am_cv_python_version=${py_ver} - export am_cv_python_pythondir="\${libdir}/python${py_ver}/site-packages" - export am_cv_python_pyexecdir=${am_cv_python_pythondir} -} - # Since we're storing the wrappers in a board sysroot, make sure that # is actually in our PATH. cros_pre_pkg_setup_sysroot_build_bin_dir() { From 1d7d53fad99460f79570a1ecbab9b7d98873d31b Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Mon, 8 Jul 2024 17:40:52 +0100 Subject: [PATCH 5/8] Upgrade to Catalyst 4 Catalyst 4 has totally changed the way repositories are handled. It only works when the name of the directory containing the repository matches the configured name of that repository. This was not the case for us, with the coreos repository residing in the coreos-overlay directory. We wanted to move and rename our repositories anyway, but this is a big change, so we'll do separately. For now, this just renames coreos to coreos-overlay. Catalyst 4 also ingests the main repository snapshot as a squashfs rather than a tarball. It features a utility to generate such a snapshot, but it doesn't fit Flatcar well, particularly because it expects each ebuild repository to reside at the top level of its own git repository. It was very easy to call tar2sqfs manually though. Signed-off-by: James Le Cuirot --- bootstrap_sdk | 58 ++++---- build_library/catalyst.sh | 131 ++++++------------ build_library/catalyst_sdk.sh | 17 +-- build_library/catalyst_toolchains.sh | 2 +- build_library/dev_container_util.sh | 12 +- .../package.use.force/releng/alternatives | 10 ++ build_library/toolchain_util.sh | 16 +-- build_library/vm_image_util.sh | 2 +- build_toolchains | 3 +- changelog/changes/2024-07-15-repo-rename.md | 1 + .../coreos/base/package.accept_keywords | 3 + .../profiles/coreos/base/package.unmask | 4 - .../profiles/coreos/base/package.use.mask | 4 +- .../coreos/targets/generic/package.use.mask | 2 + .../profiles/coreos/targets/sdk/package.use | 3 + .../coreos-overlay/profiles/repo_name | 2 +- .../portage-stable/metadata/layout.conf | 1 - .../portage-stable/profiles/repo_name | 2 +- setup_board | 2 +- update_chroot | 20 +-- update_distfiles | 2 +- update_metadata | 2 +- 22 files changed, 133 insertions(+), 166 deletions(-) create mode 100644 build_library/portage/profile/package.use.force/releng/alternatives create mode 100644 changelog/changes/2024-07-15-repo-rename.md create mode 100644 sdk_container/src/third_party/coreos-overlay/profiles/coreos/targets/generic/package.use.mask diff --git a/bootstrap_sdk b/bootstrap_sdk index fccd6e039cf..bf094e28a79 100755 --- a/bootstrap_sdk +++ b/bootstrap_sdk @@ -7,9 +7,9 @@ # This uses Gentoo's catalyst for very thoroughly building images from # scratch. Using images based on this will eliminate some of the hackery # in make_chroot.sh for building up the sdk from a stock stage3 tarball. -# +# # For reference the procedure it performs is this: -# +# # 1. snapshot: Grab a snapshot of the portage-stable repo from # the current SDK's /var/lib/gentoo/repos/gentoo. # Alternatively, check out a git ref specified via --portage-ref. @@ -68,15 +68,14 @@ DEFINE_string stage1_overlay_path "" \ ## Define the stage4 config template catalyst_stage4() { cat < "$TEMPDIR/catalyst-stage1.conf" - sed -i "s:^portdir.*:portdir=\"$stage1_repos/gentoo\":" \ - "$TEMPDIR/catalyst-stage1.conf" # take the "portage directory" (portage-stable copy) snapshot - build_snapshot "${TEMPDIR}/catalyst-stage1.conf" "${FLAGS_version}-stage1" + build_snapshot "$stage1_repos/portage-stable" "${FLAGS_version}-stage1" # Update the stage 1 spec to use the "known-good" portage-stable snapshot # and coreos-overlay copy repository versions from above. - sed -i -e "s/^snapshot:.*/snapshot: $FLAGS_version-stage1/" \ - -e "s,^portage_overlay:.*,portage_overlay: $stage1_repos/coreos-overlay," \ + sed -i -e "s/^snapshot_treeish:.*/snapshot_treeish: $FLAGS_version-stage1/" \ + -e "s,^repos:.*,repos: $stage1_repos/coreos-overlay," \ "$TEMPDIR/stage1.spec" # If we are to use a custom path for either ebuild repo we want to update the stage1 seed SDK @@ -220,10 +213,11 @@ build_stage1() { echo "update_seed_command: --update --deep --newuse --complete-graph --rebuild-if-new-ver --rebuild-exclude cross-*-cros-linux-gnu/* sys-devel/gcc " \ >>"$TEMPDIR/stage1.spec" fi + rm -f "${update_seed_file}" # Finally, build stage 1 - build_stage stage1 "$SEED" "$TEMPDIR/catalyst-stage1.conf" + build_stage stage1 } if [[ "$STAGES" =~ stage1 ]]; then diff --git a/build_library/catalyst.sh b/build_library/catalyst.sh index ea1f6a97654..ef08aa5f8b6 100644 --- a/build_library/catalyst.sh +++ b/build_library/catalyst.sh @@ -55,17 +55,15 @@ DEFINE_boolean debug ${FLAGS_FALSE} "Enable verbose output from catalyst." catalyst_conf() { cat < "$TEMPDIR/catalyst.conf" info " catalystrc" catalystrc > "$TEMPDIR/catalystrc" - info " portage/repos.conf/coreos.conf" - repos_conf > "$TEMPDIR/portage/repos.conf/coreos.conf" info " stage1.spec" catalyst_stage1 > "$TEMPDIR/stage1.spec" - info " stage2.spec" - catalyst_stage2 > "$TEMPDIR/stage2.spec" - info " stage3.spec" - catalyst_stage3 > "$TEMPDIR/stage3.spec" - info " stage4.spec" - catalyst_stage4 > "$TEMPDIR/stage4.spec" - info "Putting a symlink to user patches..." - ln -sfT '/var/gentoo/repos/local/coreos/user-patches' \ - "$TEMPDIR/portage/patches" + + info "Configuring Portage..." + cp -r "${BUILD_LIBRARY_DIR}"/portage/ "${TEMPDIR}/" + + ln -sfT '/var/gentoo/repos/coreos-overlay/coreos/user-patches' \ + "${TEMPDIR}"/portage/patches } build_stage() { - local stage srcpath catalyst_conf target_tarball + local stage catalyst_conf target_tarball stage="$1" - srcpath="$2" - catalyst_conf="$3" + catalyst_conf="$TEMPDIR/catalyst.conf" target_tarball="${stage}-${ARCH}-${FLAGS_version}.tar.bz2" - [ -z "$catalyst_conf" ] && catalyst_conf="$TEMPDIR/catalyst.conf" - if [[ -f "$BUILDS/${target_tarball}" && $FLAGS_rebuild == $FLAGS_FALSE ]] then info "Skipping $stage, $target_tarball already exists." @@ -270,8 +247,7 @@ build_stage() { "${DEBUG[@]}" \ --verbose \ --config "$TEMPDIR/catalyst.conf" \ - --file "$TEMPDIR/${stage}.spec" \ - --cli "source_subpath=$srcpath" + --file "$TEMPDIR/${stage}.spec" # Catalyst does not clean up after itself... rm -rf "$TEMPDIR/$stage-${ARCH}-${FLAGS_version}" ln -sf "$stage-${ARCH}-${FLAGS_version}.tar.bz2" \ @@ -280,46 +256,19 @@ build_stage() { } build_snapshot() { - local catalyst_conf snapshot snapshots_dir snapshot_base snapshot_path + local repo_dir snapshot snapshots_dir snapshot_path - catalyst_conf=${1:-"${TEMPDIR}/catalyst.conf"} + repo_dir=${1:-"${FLAGS_portage_stable}"} snapshot=${2:-"${FLAGS_version}"} snapshots_dir="${CATALYST_ROOT}/snapshots" - snapshot_base="${snapshots_dir}/gentoo-${snapshot}" - snapshot_path="${snapshot_base}.tar.bz2" - if [[ -f "${snapshot_path}" && $FLAGS_rebuild == $FLAGS_FALSE ]] + snapshot_path="${snapshots_dir}/portage-stable-${snapshot}.sqfs" + if [[ -f ${snapshot_path} && $FLAGS_rebuild == $FLAGS_FALSE ]] then info "Skipping snapshot, ${snapshot_path} exists" else info "Creating snapshot ${snapshot_path}" - catalyst \ - "${DEBUG[@]}" \ - --verbose \ - --config "${catalyst_conf}" \ - --snapshot "${snapshot}" - fi - local f - local to_remove=() - # This will expand to at least our just built snapshot tarball, so - # no nullglob is needed here. - for f in "${snapshot_base}".*; do - case "${f}" in - "${snapshot_path}") - # Our snapshot, keep it as is. - : - ;; - *.CONTENTS|*.CONTENTS.gz|*.DIGESTS) - # These can stay, catalyst is not bothered by those. - : - ;; - *) - to_remove+=("${f}") - ;; - esac - done - if [[ ${#to_remove[@]} -gt 0 ]]; then - info "$(printf '%s\n' 'Found spurious files in snapshots directory that may confuse Catalyst, removing them:' "${to_remove[@]}")" - rm -rf "${to_remove[@]}" + mkdir -p "${snapshot_path%/*}" + tar -c -C "${repo_dir}" . | tar2sqfs "${snapshot_path}" -q -f -j1 -c gzip fi } @@ -335,7 +284,7 @@ catalyst_build() { used_seed=0 if [[ "$STAGES" =~ stage1 ]]; then - build_stage stage1 "$SEED" + build_stage stage1 used_seed=1 fi @@ -343,7 +292,9 @@ catalyst_build() { if [[ $used_seed -eq 1 ]]; then SEED="${TYPE}/stage1-${ARCH}-latest" fi - build_stage stage2 "$SEED" + info " stage2.spec" + catalyst_stage2 > "$TEMPDIR/stage2.spec" + build_stage stage2 used_seed=1 fi @@ -351,7 +302,9 @@ catalyst_build() { if [[ $used_seed -eq 1 ]]; then SEED="${TYPE}/stage2-${ARCH}-latest" fi - build_stage stage3 "$SEED" + info " stage3.spec" + catalyst_stage3 > "$TEMPDIR/stage3.spec" + build_stage stage3 used_seed=1 fi @@ -359,10 +312,12 @@ catalyst_build() { if [[ $used_seed -eq 1 ]]; then SEED="${TYPE}/stage3-${ARCH}-latest" fi - build_stage stage4 "$SEED" + info " stage4.spec" + catalyst_stage4 > "$TEMPDIR/stage4.spec" + build_stage stage4 used_seed=1 fi # Cleanup snapshots, we don't use them - rm -rf "$CATALYST_ROOT/snapshots/gentoo-${FLAGS_version}.tar.bz2"* + rm -rf "$CATALYST_ROOT/snapshots/${FLAGS_portage_stable##*/}-${FLAGS_version}.sqfs"* } diff --git a/build_library/catalyst_sdk.sh b/build_library/catalyst_sdk.sh index e5fb29a188b..ff3f3d4b1d4 100644 --- a/build_library/catalyst_sdk.sh +++ b/build_library/catalyst_sdk.sh @@ -11,7 +11,7 @@ echo "Setting the default Python interpreter" eselect python update echo "Building cross toolchain for the SDK." -configure_crossdev_overlay / /tmp/crossdev +configure_crossdev_overlay / /usr/local/portage/crossdev for cross_chost in $(get_chost_list); do echo "Building cross toolchain for ${cross_chost}" @@ -21,10 +21,11 @@ for cross_chost in $(get_chost_list); do install_cross_rust "${cross_chost}" ${clst_myemergeopts} done -echo "Saving snapshot of coreos-overlay repo for future SDK bootstraps" -# Copy coreos-overlay, which is in /var/gentoo/repos/local/, into a -# local directory. /var/gentoo/repos/local/ is removed before archiving -# and we want to keep a snapshot. This snapshot is used - alongside -# /var/gentoo/repos/gentoo - by stage 1 of future bootstraps. -mkdir -p /var/gentoo/repos/coreos-overlay -cp -R /var/gentoo/repos/local/* /var/gentoo/repos/coreos-overlay +echo "Saving snapshot of repos for future SDK bootstraps" +# Copy portage-stable and coreos-overlay, which are under +# /mnt/host/source/src/third_party, into a local directory because they are +# removed before archiving and we want to keep snapshots. These snapshots are +# used by stage 1 in future bootstraps. +mkdir -p /var/gentoo/repos/{gentoo,coreos-overlay} +cp -R /mnt/host/source/src/third_party/portage-stable/* /var/gentoo/repos/gentoo/ +cp -R /mnt/host/source/src/third_party/coreos-overlay/* /var/gentoo/repos/coreos-overlay/ diff --git a/build_library/catalyst_toolchains.sh b/build_library/catalyst_toolchains.sh index 0c041b3dd34..92d6e932136 100644 --- a/build_library/catalyst_toolchains.sh +++ b/build_library/catalyst_toolchains.sh @@ -37,7 +37,7 @@ build_target_toolchain() { run_merge -u --root="$ROOT" --sysroot="$ROOT" "${TOOLCHAIN_PKGS[@]}" } -configure_crossdev_overlay / /tmp/crossdev +configure_crossdev_overlay / /usr/local/portage/crossdev for board in $(get_board_list); do echo "Building native toolchain for ${board}" diff --git a/build_library/dev_container_util.sh b/build_library/dev_container_util.sh index a0c07477cd1..3d702c32eb1 100755 --- a/build_library/dev_container_util.sh +++ b/build_library/dev_container_util.sh @@ -42,22 +42,24 @@ PORTAGE_BINHOST="$(get_binhost_url "${binhost}" "${update_group}" 'pkgs') $(get_binhost_url "${binhost}" "${update_group}" 'toolchain')" EOF - sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/coreos.conf" < /dev/null "${sudo[@]}" tee "${root}${location}/metadata/layout.conf" > /dev/null < Date: Fri, 5 Jul 2024 10:11:34 +0100 Subject: [PATCH 6/8] Don't use repo snapshots for stage1 by updating seed the new way This is what upstream Gentoo does. They would previously update the entire seed, but this took a long time. Our seeds are much bigger, so we kept repo snapshots to build stage1 against these instead. The new method of only rebuilding packages with changed sub-slots is a good compromise and removes the need to write stage1 hooks that selectively catch the repository up. This also avoids some conflicts by adding the `--ignore-world` option. Gentoo seeds have nothing in @world. We have much more, but none of that is needed for stage1. This continues to exclude cross-*-cros-linux-gnu/* as that is not needed for stage1. It now also excludes dev-lang/rust, because it is never a DEPEND, so it would not break other packages in this way. It may fail to run due to a sub-slot change in one of its own dependencies, but it is also unlikely to be needed in stage1 and it is not configured to use the system LLVM. If needs be, we could improve the behaviour of Portage's @changed-subslot to respect `--with-bdeps`. In my testing, it was unable to handle an SDK from 17 months ago, but one from 7 months ago did work. In practise, we will always use a much more recent one, which is far more likely to work. Signed-off-by: James Le Cuirot --- bootstrap_sdk | 119 ++---------------- build_library/build_image_util.sh | 5 +- build_library/catalyst.sh | 5 +- build_library/catalyst_sdk.sh | 9 -- .../0000-bump-baselayout-coreos-overlay.sh | 30 ----- .../0000-glibc-crypt-portage-stable.sh | 19 --- .../0001-update-profile-coreos-overlay.sh | 25 ---- .../0002-glibc-crypt-coreos-overlay.sh | 53 -------- .../coreos/stage1_hooks/README.md | 18 --- 9 files changed, 14 insertions(+), 269 deletions(-) delete mode 100755 sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0000-bump-baselayout-coreos-overlay.sh delete mode 100755 sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0000-glibc-crypt-portage-stable.sh delete mode 100755 sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0001-update-profile-coreos-overlay.sh delete mode 100755 sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0002-glibc-crypt-coreos-overlay.sh delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/README.md diff --git a/bootstrap_sdk b/bootstrap_sdk index bf094e28a79..36bda6ecca9 100755 --- a/bootstrap_sdk +++ b/bootstrap_sdk @@ -4,30 +4,19 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # -# This uses Gentoo's catalyst for very thoroughly building images from -# scratch. Using images based on this will eliminate some of the hackery -# in make_chroot.sh for building up the sdk from a stock stage3 tarball. -# +# This uses Gentoo's catalyst for very thoroughly building images from scratch. # For reference the procedure it performs is this: # -# 1. snapshot: Grab a snapshot of the portage-stable repo from -# the current SDK's /var/lib/gentoo/repos/gentoo. -# Alternatively, check out a git ref specified via --portage-ref. +# 1. seed: Take a recent SDK, dev container, or custom tarball as a seed to +# build stage 1 with. Before proceeding, update relevant packages that have +# changed sub-slot to avoid missing library issues later in the build. # -# 2. stage1: Using a "seed" tarball as a build environment, build a -# minimal root file system into a clean directory using ROOT=... -# and USE=-* The restricted USE flags are key be small and avoid -# circular dependencies. +# 2. stage1: Using the above seed tarball as a build environment, build a +# minimal root file system into a clean directory using ROOT=... and USE=-* +# The restricted USE flags are key be small and avoid circular dependencies. # NOTE that stage1 LACKS PROPER STAGE ISOLATION. Binaries produced in stage1 -# will be linked against the SEED SDK libraries, NOT against libraries -# built in stage 1. See "stage_repo()" documentation further below for more. -# This stage uses: -# - portage-stable from the SDK's /var/lib/gentoo/repos/gentoo -# or a custom path via --stage1_portage_path command line option -# - coreos-overlay from the SDK's /var/lib/gentoo/repos/coreos-overlay -# or a custom path via --stage1_overlay_path command line option -# Command line option refs need caution though, since -# stage1 must not contain updated ebuilds (see build_stage1 below). +# will be linked against the SEED SDK libraries, NOT against libraries built +# in stage 1. # # 3. stage2: Run portage-stable/scripts/bootstrap.sh # This rebuilds the toolchain using Gentoo bootstrapping, ensuring it's not linked @@ -59,12 +48,6 @@ TYPE="flatcar-sdk" . "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1 -DEFINE_string stage1_portage_path "" \ - "Path to custom portage ebuilds tree to use in stage 1 (DANGEROUS; USE WITH CAUTION)" -DEFINE_string stage1_overlay_path "" \ - "Path to custom overlay ebuilds tree to use in stage 1 (DANGEROUS; USE WITH CAUTION)" - - ## Define the stage4 config template catalyst_stage4() { cat <>"$TEMPDIR/stage1.spec" - fi - - rm -f "${update_seed_file}" - - # Finally, build stage 1 - build_stage stage1 -} - -if [[ "$STAGES" =~ stage1 ]]; then - build_stage1 - STAGES="${STAGES/stage1/}" - SEED="${TYPE}/stage1-${ARCH}-latest" -fi - catalyst_build if [[ "$STAGES" =~ stage4 ]]; then diff --git a/build_library/build_image_util.sh b/build_library/build_image_util.sh index 4abef8f0ef4..7712141c36a 100755 --- a/build_library/build_image_util.sh +++ b/build_library/build_image_util.sh @@ -365,7 +365,7 @@ get_metadata() { local mirror="$(echo "${v}" | grep mirror:// | cut -d '/' -f 3)" if [ -n "${mirror}" ]; then # Take only first mirror, those not working should be removed - local location="$(grep "^${mirror}"$'\t' /var/gentoo/repos/gentoo/profiles/thirdpartymirrors | cut -d $'\t' -f 2- | cut -d ' ' -f 1 | tr -d $'\t')" + local location="$(grep "^${mirror}"$'\t' /mnt/host/source/src/third_party/portage-stable/profiles/thirdpartymirrors | cut -d $'\t' -f 2- | cut -d ' ' -f 1 | tr -d $'\t')" v="$(echo "${v}" | sed "s#mirror://${mirror}/#${location}#g")" fi new_val+="${v} " @@ -490,8 +490,7 @@ EOF license_list="$(jq -r '.[] | "\(.licenses | .[])"' "${json_input}" | sort | uniq)" local license_dirs=( "/mnt/host/source/src/third_party/coreos-overlay/licenses/" - "/mnt/host/source/src/third_party/portage-stable/" - "/var/gentoo/repos/gentoo/licenses/" + "/mnt/host/source/src/third_party/portage-stable/licenses/" "none" ) for license_file in ${license_list}; do diff --git a/build_library/catalyst.sh b/build_library/catalyst.sh index ef08aa5f8b6..fab4a947c1e 100644 --- a/build_library/catalyst.sh +++ b/build_library/catalyst.sh @@ -104,7 +104,8 @@ catalyst_stage1() { cat <"${update_seed_file}" diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0001-update-profile-coreos-overlay.sh b/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0001-update-profile-coreos-overlay.sh deleted file mode 100755 index e9a01036aed..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0001-update-profile-coreos-overlay.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -set -x -set -euo pipefail - -stage1_repo="${1}" -new_repo="${2}" -parent_file='profiles/coreos/amd64/parent' -old_parent_line='portage-stable:default/linux/amd64/17.0/no-multilib/hardened' -stage1_parent="${stage1_repo}/${parent_file}" -new_parent="${new_repo}/${parent_file}" - -if [[ ! -e "${new_parent}" ]]; then - echo "no file '${parent_file}' in new repo, nothing to do" - exit 0 -fi - -if [[ ! -e "${stage1_parent}" ]]; then - echo "no file '${parent_file}' in stage1 repo, nothing to do" - exit 0 -fi - -if grep --quiet --fixed-strings --line-regexp --regexp="${old_parent_line}" -- "${stage1_parent}"; then - rm -f "${stage1_parent}" - cp -a "${new_parent}" "${stage1_parent}" -fi diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0002-glibc-crypt-coreos-overlay.sh b/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0002-glibc-crypt-coreos-overlay.sh deleted file mode 100755 index e8891c76a33..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/0002-glibc-crypt-coreos-overlay.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -set -x -set -euo pipefail - -stage1_repo=${1} -new_repo=${2} -update_seed_file=${3} - -base_profile_dir='profiles/coreos/base' - -declare -A fixups_old=( - ['package.mask']='>=virtual/libcrypt-2' - ['package.unmask']='=virtual/libcrypt-1-r1' - ['package.use.force']='sys-libs/glibc crypt' - ['package.use.mask']='sys-libs/glibc -crypt' -) - -declare -A fixups_new=( - ['package.mask']='>=virtual/libcrypt-2' - ['package.unmask']='"${ff}" - done - echo x >"${update_seed_file}" - exit 0 -done diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/README.md b/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/README.md deleted file mode 100644 index d31163fe6c2..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos/stage1_hooks/README.md +++ /dev/null @@ -1,18 +0,0 @@ -The scripts in this directory are called by the SDK bootstrapping -script when setting up the portage-stable and coreos-overlay repos for -the stage1 build. The scripts are invoked with two arguments - a path -to the stage1 repository, and a path to the current repository. The -difference between the two is that the stage1 repository is a copy of -a repository saved in the seed SDK (thus it's going to be an older -version of the repository), whereas the current repository is a -repository that will be a base of the new SDK. The idea here is that -something in the stage1 repository may be too old, thus it should be -replaced with its equivalent from the current repository. - -For more information about the bootstrap process, please see the -`bootstrap_sdk` script in [the scripts -repository](https://github.com/flatcar/scripts). - -The script for portage-stable should end with `-portage-stable.sh`, -and the script for coreos-overlay with '-coreos-overlay.sh`. For -example: `0000-replace-ROOTPATH-coreos-overlay.sh`. From a783cc2303d8864126fe13f3eb096688ff9e33fb Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Thu, 11 Jul 2024 14:07:45 +0100 Subject: [PATCH 7/8] Fix up SDK repo configuration to use new coreos-overlay name on startup Signed-off-by: James Le Cuirot --- sdk_lib/sdk_entry.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk_lib/sdk_entry.sh b/sdk_lib/sdk_entry.sh index eca47d7fa84..9ebc141771b 100755 --- a/sdk_lib/sdk_entry.sh +++ b/sdk_lib/sdk_entry.sh @@ -10,6 +10,10 @@ fi chown -R sdk:sdk /home/sdk +# Fix up SDK repo configuration to use the new coreos-overlay name. +sed -i -r 's/^\[coreos\]/[coreos-overlay]/' /etc/portage/repos.conf/coreos.conf 2>/dev/null +sed -i -r '/^masters =/s/\bcoreos(\s|$)/coreos-overlay\1/g' /usr/local/portage/crossdev/metadata/layout.conf 2>/dev/null + # Check if the OS image version we're working on is newer than # the SDK container version and if it is, update the boards # chroot portage conf to point to the correct binhost. From 186f31168cfb35a768719b84790a9f6a1612ddcc Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Thu, 11 Jul 2024 15:05:41 +0100 Subject: [PATCH 8/8] Upgrade to (at least) Catalyst 4 before trying to run Catalyst The changes to support Catalyst 4 are not backwards compatible and we need a seamless transition for builds in CI. Signed-off-by: James Le Cuirot --- build_library/catalyst.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build_library/catalyst.sh b/build_library/catalyst.sh index fab4a947c1e..4706007c40a 100644 --- a/build_library/catalyst.sh +++ b/build_library/catalyst.sh @@ -3,6 +3,11 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +# Before doing anything, ensure we have at least Catalyst 4. +if catalyst --version | grep -q "Catalyst [0-3]\."; then + sudo emerge -v1 ">=dev-util/catalyst-4" || exit 1 +fi + # common.sh should be sourced first [[ -n "${DEFAULT_BUILD_ROOT}" ]] || exit 1 . "${SCRIPTS_DIR}/sdk_lib/sdk_util.sh" || exit 1