diff --git a/bootstrap_sdk b/bootstrap_sdk index fccd6e039cf..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. # -# 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. +# 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 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,24 +48,17 @@ 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/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" - - # 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," \ - "$TEMPDIR/stage1.spec" - - # If we are to use a custom path for either ebuild repo we want to update the stage1 seed SDK - if [[ -n ${FLAGS_stage1_portage_path} ]] || [[ -n ${FLAGS_stage1_overlay_path} ]] || [[ -s ${update_seed_file} ]]; then - sed -i 's/^update_seed: no/update_seed: yes/' "$TEMPDIR/stage1.spec" - 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" -} - -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 ea1f6a97654..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 @@ -55,17 +60,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 '/mnt/host/source/src/third_party/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 +253,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 +262,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 +290,7 @@ catalyst_build() { used_seed=0 if [[ "$STAGES" =~ stage1 ]]; then - build_stage stage1 "$SEED" + build_stage stage1 used_seed=1 fi @@ -343,7 +298,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 +308,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 +318,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..742b04f86c9 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}" @@ -20,11 +20,3 @@ for cross_chost in $(get_chost_list); do PKGDIR="$(portageq envvar PKGDIR)/crossdev" \ 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 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 <"${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`. diff --git a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.accept_keywords b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.accept_keywords index 5e216c42b09..0e2113c44d3 100644 --- a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.accept_keywords +++ b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.accept_keywords @@ -7,6 +7,9 @@ # Gentoo upstream package stabilisation # (the following packages are "unstable" upstream; we're stabilising these) +# Catalyst 4 is not stable yet, but earlier versions are masked now. +dev-util/catalyst ~amd64 ~arm64 + =app-containers/containerd-1.7.19 ~amd64 ~arm64 # DO NOT EDIT THIS LINE. Added by containerd-apply-patch.sh on 2024-07-05 08:17:23 =app-containers/cri-tools-1.27.0 ~amd64 ~arm64 =app-containers/runc-1.1.13 ~amd64 ~arm64 diff --git a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.unmask b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.unmask index 1d33cf13b19..7eebbb56b18 100644 --- a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.unmask +++ b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.unmask @@ -2,7 +2,3 @@ # with rust so far, so keep using 1.70.0. ~dev-lang/rust-1.79.0 ~virtual/rust-1.79.0 - -# portage-stable masked catalyst-3, and has not provided a stable way to -# update to catalyst-4 so overriding the change for now to use catalyst-3 - + + + + 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 +} 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} diff --git a/sdk_container/src/third_party/portage-stable/metadata/layout.conf b/sdk_container/src/third_party/portage-stable/metadata/layout.conf index da12d64d54b..b507dd6f614 100644 --- a/sdk_container/src/third_party/portage-stable/metadata/layout.conf +++ b/sdk_container/src/third_party/portage-stable/metadata/layout.conf @@ -1,4 +1,3 @@ -repo-name = portage-stable use-manifests = strict thin-manifests = true cache-format = md5-dict diff --git a/sdk_container/src/third_party/portage-stable/profiles/repo_name b/sdk_container/src/third_party/portage-stable/profiles/repo_name index 23574f35785..316c11ecc49 100644 --- a/sdk_container/src/third_party/portage-stable/profiles/repo_name +++ b/sdk_container/src/third_party/portage-stable/profiles/repo_name @@ -1 +1 @@ -gentoo +portage-stable 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 +} 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. diff --git a/setup_board b/setup_board index ecc689decfe..bba9251ab7e 100755 --- a/setup_board +++ b/setup_board @@ -233,7 +233,7 @@ fi info "Configuring portage in ${BOARD_ROOT}" sudo mkdir -p "${BOARD_ETC}/portage/"{profile,repos.conf} -sudo ln -sfT "$(portageq get_repo_path / coreos)/coreos/user-patches" \ +sudo ln -sfT "$(portageq get_repo_path / coreos-overlay)/coreos/user-patches" \ "${BOARD_ETC}/portage/patches" sudo cp /etc/portage/repos.conf/* "${BOARD_ETC}"/portage/repos.conf/ sudo ROOT="${BOARD_ROOT}" eselect profile set --force "${PORTAGE_PROFILE}" diff --git a/update_chroot b/update_chroot index af57a729b58..2a9cbeb3212 100755 --- a/update_chroot +++ b/update_chroot @@ -103,17 +103,19 @@ EMERGE_DEFAULT_OPTS="--verbose --oneshot" source "/etc/portage/make.conf.user" EOF -sudo_clobber "/etc/portage/repos.conf/coreos.conf" <