Merge pull request #2115 from flatcar/chewi/catalyst-4

Upgrade to Catalyst 4 and don't use repo snapshots for stage1
This commit is contained in:
James Le Cuirot 2024-07-15 16:10:00 +01:00 committed by GitHub
commit 7c23476bc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
43 changed files with 580 additions and 423 deletions

View File

@ -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 <<EOF
target: stage4
pkgcache_path: $BINPKGS
stage4/packages: coreos-devel/sdk-depends
stage4/fsscript: ${BUILD_LIBRARY_DIR}/catalyst_sdk.sh
stage4/root_overlay: ${ROOT_OVERLAY}
stage4/empty: /etc/portage/repos.conf /root /usr/portage /var/cache/edb
stage4/empty: /root /var/cache/edb
stage4/rm: /etc/machine-id /etc/resolv.conf
EOF
catalyst_stage_default
catalyst_stage_default 4
}
# Switch to HTTP because early boostrap stages do not have SSL support.
@ -118,7 +100,7 @@ cp "${BUILD_LIBRARY_DIR}/toolchain_util.sh" "${ROOT_OVERLAY}/tmp"
#
# No package updates must happen in stage 1, so we use the portage-stable and
# coreos-overlay paths included with the current SDK (from the SDK chroot's
# /var/lib/gentoo/repos/). "Current SDK" refers to the SDK we entered with
# /var/gentoo/repos/). "Current SDK" refers to the SDK we entered with
# 'cork enter', i.e. the SDK we run ./bootstrap_sdk in.
#
# Using ebuilds from the above mentioned sources will ensure that stage 1 builds
@ -143,95 +125,6 @@ cp "${BUILD_LIBRARY_DIR}/toolchain_util.sh" "${ROOT_OVERLAY}/tmp"
# by stage one. Therefore, these binaries will cease to work in stage 2 when linked against
# outdated "seed tarball" libraries which have been updated to newer versions in stage 1.
stage_repo() {
local repo=${1}
local path=${2}
local dest=${3}
local update_seed_file=${4}
local gitname="$repo"
if [ "$gitname" = "gentoo" ] ; then
gitname="portage-stable"
fi
if [ -z "$path" ]; then
cp -R "/var/gentoo/repos/${repo}" "$dest"
info "Using local SDK's ebuild repo '$repo' ('$gitname') in stage 1."
else
mkdir "$dest/$repo"
cp -R "${path}/"* "$dest/${repo}/"
info "Using custom path '$path' for ebuild repo '$repo' ('$gitname') in stage 1."
info "This may break stage 2. YOU HAVE BEEN WARNED. You break it, you keep it."
fi
(
set -euo pipefail
local repo_var hook name
# FLAGS_coreos_overlay for gitname coreos-overlay
repo_var="FLAGS_${gitname//-/_}"
shopt -s nullglob
for hook in "${FLAGS_coreos_overlay}/coreos/stage1_hooks/"*"-${gitname}.sh"; do
name=${hook##*/}
name=${name%"-${gitname}.sh"}
info "Invoking stage1 ${gitname} hook ${name} on ${dest}/${repo}"
"${hook}" "${dest}/${repo}" "${!repo_var}" "${update_seed_file}"
done
)
}
build_stage1() {
# First, write out the default 4-stage catalyst configuration files
write_configs
# Prepare local copies of both the "known-good" portage-stable and the
# "known-good" coreos-overlay ebuild repos
local stage1_repos="$TEMPDIR/stage1-ebuild-repos"
info "Creating stage 1 ebuild repos and stage 1 snapshot in '$stage1_repos'"
rm -rf "$stage1_repos"
mkdir "$stage1_repos"
# If the file exists and is not empty, seed will be updated.
# Stage1 hooks may decide that the seed SDK needs updating.
local update_seed_file="${TEMPDIR}/update_seed"
# prepare ebuild repos for stage 1, either from the local SDK (default)
# or from custom paths specified via command line flags
stage_repo "gentoo" "${FLAGS_stage1_portage_path}" "$stage1_repos" "${update_seed_file}"
stage_repo "coreos-overlay" "${FLAGS_stage1_overlay_path}" "$stage1_repos" "${update_seed_file}"
# Create a snapshot of "known-good" portage-stable repo copy for use in stage 1
# This requires us to create a custom catalyst config to point it to the
# repo copy we just created, for snapshotting.
catalyst_conf > "$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

View File

@ -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

View File

@ -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 <<EOF
# catalyst.conf
contents="auto"
digests="md5 sha1 sha512 whirlpool"
hash_function="crc32"
options="pkgcache"
digests=["md5", "sha1", "sha512", "blake2b"]
options=["pkgcache"]
sharedir="/usr/share/catalyst"
storedir="$CATALYST_ROOT"
distdir="$DISTDIR"
envscript="$TEMPDIR/catalystrc"
port_logdir="$CATALYST_ROOT/log"
portdir="$FLAGS_portage_stable"
snapshot_cache="$CATALYST_ROOT/tmp/snapshot_cache"
repo_basedir="/mnt/host/source/src/third_party"
repo_name="portage-stable"
EOF
}
@ -82,61 +85,49 @@ export ac_cv_posix_semaphores_enabled=yes
EOF
}
repos_conf() {
cat <<EOF
[DEFAULT]
main-repo = portage-stable
[coreos]
location = /var/gentoo/repos/local
[portage-stable]
location = /var/gentoo/repos/gentoo
EOF
}
# Common values for all stage spec files
catalyst_stage_default() {
cat <<EOF
target: stage$1
subarch: $ARCH
rel_type: $TYPE
portage_confdir: $TEMPDIR/portage
portage_overlay: $FLAGS_coreos_overlay
repos: $FLAGS_coreos_overlay
keep_repos: portage-stable coreos-overlay
profile: $FLAGS_profile
snapshot: $FLAGS_version
snapshot_treeish: $FLAGS_version
version_stamp: $FLAGS_version
cflags: -O2 -pipe
cxxflags: -O2 -pipe
ldflags: -Wl,-O2 -Wl,--as-needed
source_subpath: ${SEED}
EOF
}
# Config values for each stage
catalyst_stage1() {
cat <<EOF
target: stage1
# stage1 packages aren't published, save in tmp
pkgcache_path: ${TEMPDIR}/stage1-${ARCH}-packages
update_seed: no
update_seed: yes
update_seed_command: --exclude cross-*-cros-linux-gnu/* --exclude dev-lang/rust --ignore-world y --ignore-built-slot-operator-deps y @changed-subslot
EOF
catalyst_stage_default
catalyst_stage_default 1
}
catalyst_stage2() {
cat <<EOF
target: stage2
# stage2 packages aren't published, save in tmp
pkgcache_path: ${TEMPDIR}/stage2-${ARCH}-packages
EOF
catalyst_stage_default
catalyst_stage_default 2
}
catalyst_stage3() {
cat <<EOF
target: stage3
pkgcache_path: $BINPKGS
EOF
catalyst_stage_default
catalyst_stage_default 3
}
catalyst_stage4() {
@ -207,8 +198,8 @@ catalyst_init() {
# so far so good, expand path to work with weird comparison code below
FLAGS_seed_tarball=$(readlink -f "$FLAGS_seed_tarball")
if [[ ! "$FLAGS_seed_tarball" =~ .*\.tar\.bz2 ]]; then
die_notrace "Seed tarball doesn't end in .tar.bz2 :-/"
if [[ ! "$FLAGS_seed_tarball" =~ .\.tar\.(bz2|xz) ]]; then
die_notrace "Seed tarball doesn't end in .tar.bz2 or .tar.xz :-/"
fi
# catalyst is obnoxious and wants the $TYPE/stage3-$VERSION part of the
@ -216,49 +207,41 @@ catalyst_init() {
# directory under $TEMPDIR instead, aka the SEEDCACHE feature.)
if [[ "$FLAGS_seed_tarball" =~ "$CATALYST_ROOT/builds/".* ]]; then
SEED="${FLAGS_seed_tarball#$CATALYST_ROOT/builds/}"
SEED="${SEED%.tar.bz2}"
SEED="${SEED%.tar.*}"
else
mkdir -p "$CATALYST_ROOT/builds/seed"
cp -n "$FLAGS_seed_tarball" "$CATALYST_ROOT/builds/seed"
SEED="seed/${FLAGS_seed_tarball##*/}"
SEED="${SEED%.tar.bz2}"
SEED="${SEED%.tar.*}"
fi
}
write_configs() {
info "Creating output directories..."
mkdir -m 775 -p "$TEMPDIR/portage/repos.conf" "$DISTDIR"
mkdir -m 775 -p "$DISTDIR"
chown portage:portage "$DISTDIR"
info "Writing out catalyst configs..."
info " catalyst.conf"
catalyst_conf > "$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"*
}

View File

@ -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

View File

@ -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}"

View File

@ -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" <<EOF
sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/portage-stable.conf" <<EOF
[DEFAULT]
main-repo = portage-stable
[coreos]
location = /var/lib/portage/coreos-overlay
[portage-stable]
location = /var/lib/portage/portage-stable
EOF
sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/coreos-overlay.conf" <<EOF
[coreos-overlay]
location = /var/lib/portage/coreos-overlay
EOF
# Now set the correct profile, we do not use the eselect tool - it
# does not seem to be usable outside of the chroot without using
# deprecated PORTDIR and PORTDIR_OVERLAY environment variables.
local profile_name=$(get_board_profile "${BOARD}")
# Turn coreos:coreos/amd64/generic into coreos/amd64/generic/dev
# Turn coreos-overlay:coreos/amd64/generic into coreos/amd64/generic/dev
profile_name="${profile_name#*:}/dev"
local profile_directory="${root_fs_dir}/var/lib/portage/coreos-overlay/profiles/${profile_name}"
if [[ ! -d "${profile_directory}" ]]; then

View File

@ -0,0 +1,10 @@
# need this here because of stage1
app-alternatives/awk gawk
app-alternatives/bc gnu
app-alternatives/bzip2 reference
app-alternatives/cpio gnu
app-alternatives/gzip reference
app-alternatives/lex flex
app-alternatives/sh bash
app-alternatives/tar gnu
app-alternatives/yacc bison

View File

@ -14,18 +14,18 @@ TOOLCHAIN_PKGS=(
# This is only used as an intermediate step to be able to use the cross
# compiler to build a full native toolchain. Packages are not uploaded.
declare -A CROSS_PROFILES
CROSS_PROFILES["x86_64-cros-linux-gnu"]="coreos:coreos/amd64/generic"
CROSS_PROFILES["aarch64-cros-linux-gnu"]="coreos:coreos/arm64/generic"
CROSS_PROFILES["x86_64-cros-linux-gnu"]="coreos-overlay:coreos/amd64/generic"
CROSS_PROFILES["aarch64-cros-linux-gnu"]="coreos-overlay:coreos/arm64/generic"
# Map board names to CHOSTs and portage profiles. This is the
# definitive list, there is assorted code new and old that either
# guesses or hard-code these. All that should migrate to this list.
declare -A BOARD_CHOSTS BOARD_PROFILES
BOARD_CHOSTS["amd64-usr"]="x86_64-cros-linux-gnu"
BOARD_PROFILES["amd64-usr"]="coreos:coreos/amd64/generic"
BOARD_PROFILES["amd64-usr"]="coreos-overlay:coreos/amd64/generic"
BOARD_CHOSTS["arm64-usr"]="aarch64-cros-linux-gnu"
BOARD_PROFILES["arm64-usr"]="coreos:coreos/arm64/generic"
BOARD_PROFILES["arm64-usr"]="coreos-overlay:coreos/arm64/generic"
BOARD_NAMES=( "${!BOARD_CHOSTS[@]}" )
@ -169,7 +169,7 @@ get_sdk_arch() {
}
get_sdk_profile() {
echo "coreos:coreos/$(get_sdk_arch)/sdk"
echo "coreos-overlay:coreos/$(get_sdk_arch)/sdk"
}
get_sdk_libdir() {
@ -244,7 +244,7 @@ configure_crossdev_overlay() {
echo "x-crossdev" | \
"${sudo[@]}" tee "${root}${location}/profiles/repo_name" > /dev/null
"${sudo[@]}" tee "${root}${location}/metadata/layout.conf" > /dev/null <<EOF
masters = portage-stable coreos
masters = portage-stable coreos-overlay
use-manifests = true
thin-manifests = true
EOF
@ -271,7 +271,7 @@ _get_dependency_list() {
# Configure a new ROOT
# Values are copied from the environment or the current host configuration.
# Usage: CBUILD=foo-bar-linux-gnu ROOT=/foo/bar SYSROOT=/foo/bar configure_portage coreos:some/profile
# Usage: CBUILD=foo-bar-linux-gnu ROOT=/foo/bar SYSROOT=/foo/bar configure_portage coreos-overlay:some/profile
# Note: if using portageq to get CBUILD it must be called before CHOST is set.
_configure_sysroot() {
local profile="$1"
@ -287,7 +287,7 @@ _configure_sysroot() {
"${sudo[@]}" eselect profile set --force "$profile"
local coreos_path
coreos_path=$(portageq get_repo_path "${ROOT}" coreos)
coreos_path=$(portageq get_repo_path "${ROOT}" coreos-overlay)
"${sudo[@]}" ln -sfT "${coreos_path}/coreos/user-patches" "${ROOT}/etc/portage/patches"
echo "Writing make.conf for the sysroot ${SYSROOT}, root ${ROOT}"

View File

@ -553,7 +553,7 @@ install_oem_sysext() {
--metapkgs="${metapkg}"
)
local overlay_path mangle_fs
overlay_path=$(portageq get_repo_path / coreos)
overlay_path=$(portageq get_repo_path / coreos-overlay)
mangle_fs="${overlay_path}/${metapkg}/files/manglefs.sh"
if [[ -x "${mangle_fs}" ]]; then
build_sysext_flags+=(

View File

@ -18,13 +18,12 @@ FORCE_STAGES="stage4"
## Define the stage4 config template
catalyst_stage4() {
cat <<EOF
target: stage4
pkgcache_path: $BINPKGS
stage4/packages: @system
stage4/fsscript: ${BUILD_LIBRARY_DIR}/catalyst_toolchains.sh
stage4/root_overlay: ${ROOT_OVERLAY}
EOF
catalyst_stage_default
catalyst_stage_default 4
}
create_provenance_overlay() {
local root_overlay="$1"

View File

@ -0,0 +1 @@
- As part of the update to Catalyst 4 (used to build the SDK), the coreos package repository has been renamed to coreos-overlay to match its directory name. This will be reflected in package listings and package manager output. ([flatcar/scripts#2115](https://github.com/flatcar/scripts/pull/2115))

View File

@ -1,30 +0,0 @@
#!/bin/bash
set -euo pipefail
stage1_repo="${1}"
new_repo="${2}"
good_version="3.6.8-r10"
stage1_version=''
for f in "${stage1_repo}/sys-apps/baselayout/baselayout-"*'.ebuild'; do
f="${f##*/}"
if [[ "${f}" = *9999* ]]; then continue; fi
f="${f%.ebuild}"
f="${f#baselayout-}"
stage1_version="${f}"
done
if [[ -z "${stage1_version}" ]]; then exit 1; fi
older_version=$(printf '%s\n' "${stage1_version}" "${good_version}" | sort -V | head -n 1)
if [[ "${older_version}" = "${good_version}" ]]; then
# Stage1 version is equal or newer than the good version, nothing
# to do.
exit 0
fi
rm -rf "${stage1_repo}/sys-apps/baselayout"
cp -a "${new_repo}/sys-apps/baselayout" "${stage1_repo}/sys-apps/baselayout"

View File

@ -1,19 +0,0 @@
#!/bin/bash
set -x
set -euo pipefail
stage1_repo=${1}
new_repo=${2}
update_seed_file=${3}
cat=sys-libs
pkg=libxcrypt
if [[ -d "${stage1_repo}/${cat}/${pkg}" ]]; then
# libxcrypt is already a part of portage-stable, nothing to do
exit 0
fi
mkdir -p "${stage1_repo}/${cat}"
cp -a "${new_repo}/${cat}/${pkg}" "${stage1_repo}/${cat}/${pkg}"
echo x >"${update_seed_file}"

View File

@ -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

View File

@ -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']='<virtual/libcrypt-2'
['package.use.force']='sys-libs/glibc crypt'
['package.use.mask']='sys-libs/glibc -crypt'
)
for var_name in fixups_old fixups_new; do
declare -n fixups="${var_name}"
skip=''
for f in "${!fixups[@]}"; do
l=${fixups["${f}"]}
ff="${stage1_repo}/${base_profile_dir}/${f}"
if ! grep --quiet --fixed-strings --line-regexp --regexp="${l}" -- "${ff}"; then
# fixup not applicable, try next one
skip=x
break
fi
done
if [[ -n ${skip} ]]; then
unset -n fixups
continue
fi
for f in "${!fixups[@]}"; do
l=${fixups["${f}"]}
ff="${stage1_repo}/${base_profile_dir}/${f}"
ffb="${ff}.bak"
mv "${ff}" "${ffb}"
grep --invert-match --fixed-strings --line-regexp --regexp="${l}" -- "${ffb}" >"${ff}"
done
echo x >"${update_seed_file}"
exit 0
done

View File

@ -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`.

View File

@ -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

View File

@ -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
<dev-util/catalyst-4

View File

@ -1,8 +1,8 @@
# We don't ship GnuTLS by default, and smartcard has a dep loop
app-crypt/gnupg smartcard ssl
# not needed, requires dev-lang/python-exec
sys-apps/util-linux python
# Our ISOs are not built with Catalyst.
dev-util/catalyst iso
# not needed, requires lots of Perl
sys-boot/syslinux perl

View File

@ -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() {

View File

@ -0,0 +1,2 @@
# Only needed by Catalyst in the SDK, requires dev-lang/python-exec.
sys-apps/util-linux python

View File

@ -1,3 +1,6 @@
# Needed by Catalyst.
sys-apps/util-linux python
coreos-base/update_engine delta_generator
dev-vcs/git pcre

View File

@ -1 +1 @@
coreos
coreos-overlay

View File

@ -0,0 +1 @@
DIST pixz-1.0.7.tar.xz 120876 BLAKE2B 23563837169611d54dc4540715537b2e16c66bd9682097e4f37957e7422b487f221603b11aa30a39fd05c77dbeddc1697ac9ffe208d984c1da885a67f79a180f SHA512 7f343cb74958b9582b60a2e916243e72421fad1ebecc5867c9e046c881e8a318da9bb885edd71da8fe6953fd5d5c2f5119133cd0bbbf4d0f9b35f8aecd61120d

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>zerochaos@gentoo.org</email>
<name>Rick Farina</name>
</maintainer>
<upstream>
<remote-id type="github">vasi/pixz</remote-id>
</upstream>
</pkgmetadata>

View File

@ -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
}

View File

@ -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
}

View File

@ -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

View File

@ -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}

View File

@ -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
}

View File

@ -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}

View File

@ -1,4 +1,3 @@
repo-name = portage-stable
use-manifests = strict
thin-manifests = true
cache-format = md5-dict

View File

@ -1 +1 @@
gentoo
portage-stable

View File

@ -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

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>mattst88@gentoo.org</email>
<name>Matt Turner</name>
</maintainer>
<use>
<flag name="tools">Build the gensquashfs, rdsquashfs, sqfs2tar, sqfsdiff, and tar2sqfs tools</flag>
</use>
<upstream>
<remote-id type="github">AgentD/squashfs-tools-ng</remote-id>
</upstream>
</pkgmetadata>

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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.

View File

@ -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}"

View File

@ -103,17 +103,19 @@ EMERGE_DEFAULT_OPTS="--verbose --oneshot"
source "/etc/portage/make.conf.user"
EOF
sudo_clobber "/etc/portage/repos.conf/coreos.conf" <<EOF
sudo_clobber "/etc/portage/repos.conf/portage-stable.conf" <<EOF
[DEFAULT]
main-repo = portage-stable
[coreos]
location = ${COREOS_OVERLAY}
[portage-stable]
location = ${PORTAGE_STABLE_OVERLAY}
EOF
sudo_clobber "/etc/portage/repos.conf/coreos-overlay.conf" <<EOF
[coreos-overlay]
location = ${COREOS_OVERLAY}
EOF
# Automatically symlink any provided portage repo configurations into
# the appropriate destination directory from "config/portage/repos".
# CAUTON: Any repo configuration files with the same name, will be silently
@ -132,13 +134,13 @@ if [[ -n $(sudo find /mnt/host/source/config/portage/repos \
if [[ -n $(sudo find /mnt/host/source/config/portage/repos \
-maxdepth 3 -mindepth 3 -path "*/repos.conf/*" -type f) ]]; then
info "Symlinking portage repo configuration files into repos.conf dir..."
# Do not name any of your repo configs "coreos.conf" bad things will happen.
# We abort if any file matches config/portage/repos/*/repos.conf/coreos.conf
# Do not name any of your repo configs "coreos-overlay.conf" bad things will happen.
# We abort if any file matches config/portage/repos/*/repos.conf/coreos-overlay.conf
if [[ -n $(sudo find /mnt/host/source/config/portage/repos \
-maxdepth 3 -mindepth 3 -path "*/repos.conf/*" -name "coreos.conf") ]]; then
-maxdepth 3 -mindepth 3 -path "*/repos.conf/*" -name "coreos-overlay.conf") ]]; then
die_notrace "One of the portage repo configuration files to be symlinked is " \
"named \"coreos.conf\" which will conflict with the main configuation file " \
"called \"coreos.conf\" which is created during the chroot build process."
"named \"coreos-overlay.conf\" which will conflict with the main configuation file " \
"called \"coreos-overlay.conf\" which is created during the chroot build process."
fi
# We run through all the other files matching config/portage/repos/*/repos.conf/*
# and symlink them to the right place for portage.

View File

@ -26,7 +26,7 @@ eval set -- "${FLAGS_ARGV}"
switch_to_strict_mode
if [[ $# -eq 0 ]]; then
eval set -- portage-stable coreos
eval set -- portage-stable coreos-overlay
fi
GSUTIL_OPTS=

View File

@ -16,7 +16,7 @@ eval set -- "${FLAGS_ARGV}"
switch_to_strict_mode
if [[ $# -eq 0 ]]; then
eval set -- portage-stable coreos
eval set -- portage-stable coreos-overlay
fi
update_overlay() {