Move and rename package repositories (part 2)

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. We already renamed coreos to
coreos-overlay accordingly, but we actually want entirely different
names and more convenient locations too.

The repositories are now known as gentoo-subset and flatcar-overlay, and
they live under scripts/repos. Using the same name as upstream Gentoo
would have been problematic, and just "flatcar" would have looked
awkward in documentation.

I have removed code referencing /mnt/host/source/config rather than fix
it up, as this is no location is no longer used anywhere.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
This commit is contained in:
James Le Cuirot 2024-05-20 17:26:22 +01:00
parent a9891ac93b
commit 21699f8433
No known key found for this signature in database
GPG Key ID: 1226415D00DD3137
68 changed files with 177 additions and 269 deletions

View File

@ -13,9 +13,10 @@ if [[ ! -d "${WORK_SCRIPTS_DIR:-}" ]]; then
fail "WORK_SCRIPTS_DIR env var does not point to a directory. It should point to the scripts repo which will be updated."
fi
# Update these to use the new repo location once LTS has migrated.
readonly SDK_OUTER_TOPDIR="${WORK_SCRIPTS_DIR}"
readonly SDK_OUTER_OVERLAY="${SDK_OUTER_TOPDIR}/sdk_container/src/third_party/coreos-overlay"
readonly SDK_INNER_SRCDIR="/mnt/host/source/src"
readonly SDK_INNER_SRCDIR="/mnt/host/source/src/scripts/sdk_container/src"
readonly SDK_INNER_OVERLAY="${SDK_INNER_SRCDIR}/third_party/coreos-overlay"
readonly BUILDBOT_USERNAME="Flatcar Buildbot"

View File

@ -25,8 +25,8 @@ function github_ricj_callback() {
show_changes_env+=(
# Override the default locations of repositories.
"SCRIPTS_REPO=."
"COREOS_OVERLAY_REPO=../coreos-overlay"
"PORTAGE_STABLE_REPO=../portage-stable"
"FLATCAR_OVERLAY_REPO=../flatcar-overlay"
"GENTOO_SUBSET_REPO=../gentoo-subset"
)
show_changes_params+=(
# We may not have a tag handy, so we tell show-changes

View File

@ -1,4 +1,4 @@
name: Keep portage-stable packages updated
name: Keep gentoo-subset packages updated
on:
schedule:
- cron: '0 7 * * 1'
@ -35,10 +35,10 @@ jobs:
git config --global user.name "Flatcar Buildbot"
git config --global user.email "buildbot@flatcar-linux.org"
old_head=$(git -C scripts rev-parse HEAD)
packages_list=$(realpath scripts/.github/workflows/portage-stable-packages-list)
packages_list=$(realpath scripts/.github/workflows/gentoo-subset-packages-list)
gentoo_repo=$(realpath gentoo)
build_scripts=$(realpath flatcar-build-scripts)
pushd scripts/sdk_container/src/third_party/portage-stable
pushd scripts/repos/gentoo-subset
while read -r package; do
if [[ ! -e "${package}" ]]; then
# If this happens, it means that the package was moved to overlay
@ -50,7 +50,7 @@ jobs:
# If this happens, it means that the package was obsoleted or moved
# in Gentoo. The obsoletion needs to be handled in the case-by-case
# manner, while move should be handled by doing the same move
# in portage-stable. The build should not break because of the move,
# in gentoo-subset. The build should not break because of the move,
# because most likely it's already reflected in the profiles/updates
# directory.
echo "::warning title=${package}::Obsolete or moved package"
@ -73,10 +73,10 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: scripts
branch: buildbot/weekly-portage-stable-package-updates-${{steps.update-listed-packages.outputs.TODAYDATE }}
branch: buildbot/weekly-gentoo-subset-package-updates-${{steps.update-listed-packages.outputs.TODAYDATE }}
delete-branch: true
base: main
title: Weekly portage-stable package updates ${{steps.update-listed-packages.outputs.TODAYDATE }}
title: Weekly gentoo-subset package updates ${{steps.update-listed-packages.outputs.TODAYDATE }}
body: |
CI: TODO

View File

@ -15,7 +15,7 @@ jobs:
- name: Update GLSA metadata
id: update-glsa-metadata
run: |
glsa_dir='sdk_container/src/third_party/portage-stable/metadata/glsa'
glsa_dir='repos/gentoo-subset/metadata/glsa'
rm -rf "${glsa_dir}"
mkdir --parents "${glsa_dir}"
rsync --archive rsync://rsync.gentoo.org/gentoo-portage/metadata/glsa/* "${glsa_dir}"
@ -30,6 +30,6 @@ jobs:
base: main
title: Monthly GLSA metadata ${{steps.update-glsa-metadata.outputs.TODAYDATE }}
body: Updated GLSA metadata
commit-message: "portage-stable/metadata: Monthly GLSA metadata updates"
commit-message: "gentoo-subset/metadata: Monthly GLSA metadata updates"
author: Flatcar Buildbot <buildbot@flatcar-linux.org>
labels: main

View File

@ -35,7 +35,7 @@ Prefix uses a _staging environment_ to build binary packages, then installs thes
The _staging environment_ contains toolchains and all build tools required to create binary packages (a full `@system`).
The _final environment_ only contains run-time dependencies.
Packages are built from ebuilds in coreos-overlay, portage-stable, and prefix-overlay.
Packages are built from ebuilds in flatcar-overlay, gentoo-subset, and prefix-overlay.
A QoL `emerge` wrapper is included to install packages to the prefix.

View File

@ -14,20 +14,18 @@ The SDK can be used to
# Using the scripts repository
The repository is meant to be the entry point for Flatcar builds and development.
Ebuilds for all packages reside in one of 2 subdirectories - [coreos-overlay](sdk_container/src/third_party/coreos-overlay) and [portage-stable](sdk_container/src/third_party/portage-stable/):
Ebuilds for all packages reside in one of 2 subdirectories - [flatcar-overlay](repos/flatcar-overlay) and [gentoo-subset](repos/gentoo-subset/):
```
scripts
+--sdk_container
+---------src
+--third_party
+------coreos-overlay
+------portage-stable
+--repos
+--flatcar-overlay
+--gentoo-subset
```
`portage-stable` is kept in alignment with upstream Gentoo and should not contain any modifications (with only minor, well-justified exceptions).
`gentoo-subset` is kept in alignment with upstream Gentoo and should not contain any modifications (with only minor, well-justified exceptions).
Consider it a small sub-set of Gentoo.
`coreos-overlay` contains significantly modified or even entirely self-written ebuilds.
`flatcar-overlay` contains significantly modified or even entirely self-written ebuilds.
The `scripts` repository makes ample use of tags to mark releases.
Sometimes, local and origin tags can diverge (e.g. when re-tagging something locally to test a build).
@ -52,7 +50,7 @@ While work on a native ARM64 native SDK is ongoing, it's unfortunately not ready
The container can be run in one of two ways - "standalone", or integrated with the [scripts](https://github.com/flatcar/scripts) repo:
* Standalone mode will use no host volumes and will allow you to play with the SDK in a sandboxed throw-away environment. In standalone mode, you interface with Docker directly to use the SDK container.
* Integrated mode will closely integrate with the scripts repo directory and bind-mount it as well as the portage-stable and coreos-overlay directories into the container. Integrated mode uses wrapper scripts to interact with the SDK container. This is the recommended way for developing patches for Flatcar.
* Integrated mode will closely integrate with the scripts repo directory and bind-mount it as well as the gentoo-subset and flatcar-overlay directories into the container. Integrated mode uses wrapper scripts to interact with the SDK container. This is the recommended way for developing patches for Flatcar.
## Standalone mode
@ -82,7 +80,7 @@ To start a container in privileged mode with `/dev` available use:
This is the preferred mode of working with the SDK.
Interaction with the container happens via wrapper scripts from the scripts repository.
Both the host's scripts repo as well as the ebuild paths (portage-stable and coreos-overlay) are made available in the container, allowing for work on these directly.
Both the host's scripts repo as well as the ebuild paths (gentoo-subset and flatcar-overlay) are made available in the container, allowing for work on these directly.
The wrapper scripts will re-use existing containers instead of creating new ones to preserve your work in the container, enabling consistency.
To clone the scripts repo and pick a version:

View File

@ -18,13 +18,13 @@
# will be linked against the SEED SDK libraries, NOT against libraries built
# in stage 1.
#
# 3. stage2: Run portage-stable/scripts/bootstrap.sh
# 3. stage2: Run gentoo-subset/scripts/bootstrap.sh
# This rebuilds the toolchain using Gentoo bootstrapping, ensuring it's not linked
# to or otherwise influenced by whatever was in the "seed" tarball.
# The toolchain rebuild may contain updated package ebuilds from
# third_party/(portage-stable|coreos-overlay).
# This and all following stages use portage-stable and coreos-overlay
# from third_party/... (see 1.)
# repos/(gentoo-subset|flatcar-overlay).
# This and all following stages use gentoo-subset and flatcar-overlay
# from repos/... (see 1.)
#
# 4. stage3: Run emerge -e system to rebuild everything using the fresh updated
# toolchain from 3., using the normal USE flags provided by the profile. This
@ -95,13 +95,13 @@ chmod 1777 "${ROOT_OVERLAY}/tmp"
cp "${BUILD_LIBRARY_DIR}/toolchain_util.sh" "${ROOT_OVERLAY}/tmp"
# Stage 1 uses "known-good" ebuilds (from both coreos-overlay and portage-stable)
# Stage 1 uses "known-good" ebuilds (from both flatcar-overlay and gentoo-subset)
# to build a minimal toolchain (USE="-*") for stage 2.
#
# 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/gentoo/repos/). "Current SDK" refers to the SDK we entered with
# 'cork enter', i.e. the SDK we run ./bootstrap_sdk in.
# No package updates must happen in stage 1, so we use the gentoo-subset and
# flatcar-overlay paths included with the current SDK (from the SDK chroot's
# /mnt/host/source/src/scripts/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
# a minimal stage 2 from known-good ebuild versions - the same ebuild versions

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' /mnt/host/source/src/third_party/portage-stable/profiles/thirdpartymirrors | cut -d $'\t' -f 2- | cut -d ' ' -f 1 | tr -d $'\t')"
local location="$(grep "^${mirror}"$'\t' /mnt/host/source/src/scripts/repos/gentoo-subset/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} "
@ -489,8 +489,8 @@ EOF
local license_list # define before assignment because it would mask any error
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/licenses/"
"/mnt/host/source/src/scripts/repos/flatcar-overlay/licenses/"
"/mnt/host/source/src/scripts/repos/gentoo-subset/licenses/"
"none"
)
for license_file in ${license_list}; do

View File

@ -28,10 +28,10 @@ STAGES=
DEFINE_string catalyst_root "${DEFAULT_CATALYST_ROOT}" \
"Path to directory for all catalyst images and other files."
DEFINE_string portage_stable "${SRC_ROOT}/third_party/portage-stable" \
"Path to the portage-stable git checkout."
DEFINE_string coreos_overlay "${SRC_ROOT}/third_party/coreos-overlay" \
"Path to the coreos-overlay git checkout."
DEFINE_string gentoo_subset "${SCRIPTS_DIR}/repos/gentoo-subset" \
"Path to the gentoo-subset git checkout."
DEFINE_string flatcar_overlay "${SCRIPTS_DIR}/repos/flatcar-overlay" \
"Path to the flatcar-overlay git checkout."
DEFINE_string seed_tarball "${DEFAULT_SEED}" \
"Path to an existing stage tarball to start from."
DEFINE_string version "${FLATCAR_VERSION}" \
@ -62,8 +62,8 @@ storedir="$CATALYST_ROOT"
distdir="$DISTDIR"
envscript="$TEMPDIR/catalystrc"
port_logdir="$CATALYST_ROOT/log"
repo_basedir="/mnt/host/source/src/third_party"
repo_name="portage-stable"
repo_basedir="/mnt/host/source/src/scripts/repos"
repo_name="gentoo-subset"
EOF
}
@ -87,8 +87,8 @@ target: stage$1
subarch: $ARCH
rel_type: $TYPE
portage_confdir: $TEMPDIR/portage
repos: $FLAGS_coreos_overlay
keep_repos: portage-stable coreos-overlay
repos: $FLAGS_flatcar_overlay
keep_repos: gentoo-subset flatcar-overlay
profile: $FLAGS_profile
snapshot_treeish: $FLAGS_version
version_stamp: $FLAGS_version
@ -231,7 +231,7 @@ write_configs() {
info "Configuring Portage..."
cp -r "${BUILD_LIBRARY_DIR}"/portage/ "${TEMPDIR}/"
ln -sfT '/mnt/host/source/src/third_party/coreos-overlay/coreos/user-patches' \
ln -sfT '/mnt/host/source/src/scripts/repos/flatcar-overlay/coreos/user-patches' \
"${TEMPDIR}"/portage/patches
}
@ -264,10 +264,10 @@ build_stage() {
build_snapshot() {
local repo_dir snapshot snapshots_dir snapshot_path
repo_dir=${1:-"${FLAGS_portage_stable}"}
repo_dir=${1:-"${FLAGS_gentoo_subset}"}
snapshot=${2:-"${FLAGS_version}"}
snapshots_dir="${CATALYST_ROOT}/snapshots"
snapshot_path="${snapshots_dir}/portage-stable-${snapshot}.sqfs"
snapshot_path="${snapshots_dir}/gentoo-subset-${snapshot}.sqfs"
if [[ -f ${snapshot_path} && $FLAGS_rebuild == $FLAGS_FALSE ]]
then
info "Skipping snapshot, ${snapshot_path} exists"
@ -325,5 +325,5 @@ catalyst_build() {
fi
# Cleanup snapshots, we don't use them
rm -rf "$CATALYST_ROOT/snapshots/${FLAGS_portage_stable##*/}-${FLAGS_version}.sqfs"*
rm -rf "$CATALYST_ROOT/snapshots/${FLAGS_gentoo_subset##*/}-${FLAGS_version}.sqfs"*
}

View File

@ -20,11 +20,11 @@ configure_dev_portage() {
# Need profiles at the bare minimum
local repo
for repo in portage-stable coreos-overlay; do
for repo in gentoo-subset flatcar-overlay; do
sudo mkdir -p "${root_fs_dir}/var/lib/portage/${repo}"
sudo rsync -rtl --exclude=md5-cache \
"${SRC_ROOT}/third_party/${repo}/metadata" \
"${SRC_ROOT}/third_party/${repo}/profiles" \
"${SRC_ROOT}/scripts/repos/${repo}/metadata" \
"${SRC_ROOT}/scripts/repos/${repo}/profiles" \
"${root_fs_dir}/var/lib/portage/${repo}"
done
@ -42,26 +42,26 @@ 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/portage-stable.conf" <<EOF
sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/gentoo-subset.conf" <<EOF
[DEFAULT]
main-repo = portage-stable
main-repo = gentoo-subset
[portage-stable]
location = /var/lib/portage/portage-stable
[gentoo-subset]
location = /var/lib/portage/gentoo-subset
EOF
sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/coreos-overlay.conf" <<EOF
[coreos-overlay]
location = /var/lib/portage/coreos-overlay
sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/flatcar-overlay.conf" <<EOF
[flatcar-overlay]
location = /var/lib/portage/flatcar-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-overlay:coreos/amd64/generic into coreos/amd64/generic/dev
# Turn flatcar-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}"
local profile_directory="${root_fs_dir}/var/lib/portage/flatcar-overlay/profiles/${profile_name}"
if [[ ! -d "${profile_directory}" ]]; then
die "Not a valid profile: ${profile_name}"
fi

View File

@ -67,7 +67,7 @@ function setup_prefix_dirs() {
sudo cp -vR "${prefix_repo}/skel/etc/portage" "${STAGINGROOT}${EPREFIX}/etc/"
sudo cp -vR "${prefix_repo}/skel/etc/portage" "${FINALROOT}${EPREFIX}/etc/"
local profile="/mnt/host/source/src/third_party/portage-stable/profiles/default/linux"
local profile="/mnt/host/source/src/scripts/repos/gentoo-subset/profiles/default/linux"
case "${PREFIX_BOARD}" in
amd64-usr) profile="${profile}/amd64/17.1/no-multilib/prefix/kernel-3.2+";;
arm64-usr) profile="${profile}/arm64/17.0/prefix/kernel-3.2+";;

View File

@ -9,7 +9,7 @@ echo ">>> NOTICE: $0: removing 'gen-manpages', 'containerd-stress' from sysext"
rm -f "${rootfs}/usr/bin/gen-manpages" "${rootfs}/usr/bin/containerd-stress"
script_root="$(cd "$(dirname "$0")/../"; pwd)"
files_dir="${script_root}/sdk_container/src/third_party/coreos-overlay/coreos/sysext/containerd"
files_dir="${script_root}/repos/flatcar-overlay/coreos/sysext/containerd"
echo ">>> NOTICE $0: installing extra files from '${files_dir}'"
cp -va "${files_dir}/"* "${rootfs}"

View File

@ -8,7 +8,7 @@ echo ">>> NOTICE: $0: removing '/usr/lib/debug/', '/usr/share/docker/contrib' fr
rm -rf "${rootfs}/usr/lib/debug/" "${rootfs}/usr/share/docker/contrib/"
script_root="$(cd "$(dirname "$0")/../"; pwd)"
files_dir="${script_root}/sdk_container/src/third_party/coreos-overlay/coreos/sysext/docker"
files_dir="${script_root}/repos/flatcar-overlay/coreos/sysext/docker"
echo ">>> NOTICE $0: installing extra files from '${files_dir}'"
cp -va "${files_dir}/"* "${rootfs}"

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-overlay:coreos/amd64/generic"
CROSS_PROFILES["aarch64-cros-linux-gnu"]="coreos-overlay:coreos/arm64/generic"
CROSS_PROFILES["x86_64-cros-linux-gnu"]="flatcar-overlay:coreos/amd64/generic"
CROSS_PROFILES["aarch64-cros-linux-gnu"]="flatcar-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-overlay:coreos/amd64/generic"
BOARD_PROFILES["amd64-usr"]="flatcar-overlay:coreos/amd64/generic"
BOARD_CHOSTS["arm64-usr"]="aarch64-cros-linux-gnu"
BOARD_PROFILES["arm64-usr"]="coreos-overlay:coreos/arm64/generic"
BOARD_PROFILES["arm64-usr"]="flatcar-overlay:coreos/arm64/generic"
BOARD_NAMES=( "${!BOARD_CHOSTS[@]}" )
@ -169,7 +169,7 @@ get_sdk_arch() {
}
get_sdk_profile() {
echo "coreos-overlay:coreos/$(get_sdk_arch)/sdk"
echo "flatcar-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-overlay
masters = gentoo-subset flatcar-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-overlay:some/profile
# Usage: CBUILD=foo-bar-linux-gnu ROOT=/foo/bar SYSROOT=/foo/bar configure_portage flatcar-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-overlay)
coreos_path=$(portageq get_repo_path "${ROOT}" flatcar-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)
overlay_path=$(portageq get_repo_path / flatcar-overlay)
mangle_fs="${overlay_path}/${metapkg}/files/manglefs.sh"
if [[ -x "${mangle_fs}" ]]; then
build_sysext_flags+=(

View File

@ -65,7 +65,7 @@ metapackage 'coreos-base/oem-azure' for the arm64 squashfs base at
sudo build_sysext \\
--board=arm64-usr \\
--metapkgs=coreos-base/oem-azure \\
--mangle_fs=sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/files/manglefs.sh \\
--mangle_fs=repos/flatcar-overlay/coreos-base/oem-azure/files/manglefs.sh \\
--squashfs_base=build/artifacts/flatcar_production_image_sysext.squashfs \\
--image_builddir=oem-images \\
oem-azure
@ -244,7 +244,7 @@ ROOT="${BUILD_DIR}/install-root" PORTAGE_CONFIGROOT="${BUILD_DIR}/install-root"
if [[ "${FLAGS_strip_binaries}" = "${FLAGS_TRUE}" ]]; then
chost="$("portageq-${BOARD}" envvar CHOST)"
strip="${chost}-strip"
info "Stripping all non-stripped binaries in sysext using '${strip}'"
# Find all non-stripped binaries, remove ':' from filepath, and strip 'em

View File

@ -1 +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))
- As part of the update to Catalyst 4 (used to build the SDK), the portage-stable and coreos package repositories has been moved to the `repos` directory and renamed to gentoo-subset and flatcar-overlay respectively. This will be reflected in package listings and package manager output. ([flatcar/scripts#2115](https://github.com/flatcar/scripts/pull/2115))

View File

@ -17,13 +17,13 @@ usage() {
echo " Usage:"
echo " $0 [-t|-b] [-n] [-u <strategy>] <tag-or-branch>"
echo " Check our a tag or branch and synchronise git submodules"
echo " coreos-overlay and portage-stable."
echo " flatcar-overlay and gentoo-subset."
echo " By default, $0 tries to auto-detect whether to handle a tag or a branch,"
echo " with tags being prioritised over branches of the same name."
echo
echo " <tag-or-branch> Name of the tag or branch to check out."
echo " BRANCH: Check out the branch in scripts, coreos-overlay"
echo " and portage-stable, and fast-forward to the"
echo " BRANCH: Check out the branch in scripts, flatcar-overlay"
echo " and gentoo-subset, and fast-forward to the"
echo " latest changes by default (but see '-u' below)."
echo " TAG: Check out the tag in scripts, and update submodules."
echo
@ -90,8 +90,8 @@ esac
# make sure submodules are initialised
git submodule init
for dir in sdk_container/src/third_party/coreos-overlay \
sdk_container/src/third_party/portage-stable ; do
for dir in repos/flatcar-overlay \
repos/gentoo-subset ; do
if [ ! -f "$dir"/.git ] ; then
git submodule update -N "$dir"
fi
@ -111,10 +111,10 @@ function check_all() {
return
fi
local overlay="$(git -C sdk_container/src/third_party/coreos-overlay $gitcmd \
local overlay="$(git -C repos/flatcar-overlay $gitcmd \
| sed -e 's/^[[:space:]]*//' -e 's:remotes/[^/]\+/::' \
| grep -m1 -E "^$name\$")"
local portage="$(git -C sdk_container/src/third_party/portage-stable $gitcmd \
local portage="$(git -C repos/gentoo-subset $gitcmd \
| sed -e 's/^[[:space:]]*//' -e 's:remotes/[^/]\+/::' \
| grep -m1 -E "^$name\$")"
@ -129,8 +129,8 @@ function check_all() {
#
if ! $force_branch; then
for dir in . \
sdk_container/src/third_party/coreos-overlay \
sdk_container/src/third_party/portage-stable ; do
repos/flatcar-overlay \
repos/gentoo-subset ; do
git -C "$dir" fetch --tags --force --prune --prune-tags
done
tag="$(check_all 'tag -l' "$name")"
@ -166,8 +166,8 @@ echo
echo "Checking out BRANCH '$branch'"
echo "----------------------------------"
for dir in . \
sdk_container/src/third_party/coreos-overlay \
sdk_container/src/third_party/portage-stable ; do
repos/flatcar-overlay \
repos/gentoo-subset ; do
git -C "$dir" checkout "$branch"
if [ -n "$update_strategy" ] ; then
@ -175,4 +175,3 @@ for dir in . \
git -C "$dir" pull "$update_strategy"
fi
done

View File

@ -39,7 +39,7 @@ image_build amd64
### SDK bootstrap build
1. SDK Bootstrap (`sdk.sh`): Use a seed SDK tarball and seed SDK container image to build a new SDK tarball.
The resulting SDK tarball will ship packages and versions from the updated coreos-overlay and portage-stable ebuild directories.
The resulting SDK tarball will ship packages and versions from the updated flatcar-overlay and gentoo-subset ebuild directories.
This step updates the versionfile, recording the SDK container version just built.
It will generate and push a new version tag to the scripts repo.
2. SDK container build (`sdk_container.sh`) : use SDK tarball to build an SDK container image.

View File

@ -81,8 +81,8 @@ function ricj_callback() {
"PATH=${PATH}:${PWD}/ci-automation/python-bin"
# Override the default locations of repositories.
"SCRIPTS_REPO=."
"COREOS_OVERLAY_REPO=../coreos-overlay"
"PORTAGE_STABLE_REPO=../portage-stable"
"FLATCAR_OVERLAY_REPO=../flatcar-overlay"
"GENTOO_SUBSET_REPO=../gentoo-subset"
)
show_changes_params+=(
# The show-changes script expects a tag name, so using git tag
@ -251,7 +251,7 @@ function get_oem_id_list() {
arch=${1}; shift
list_var_name=${1}; shift
local -a ebuilds=("${scripts_repo}/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-"*'.ebuild')
local -a ebuilds=("${scripts_repo}/repos/flatcar-overlay/coreos-base/common-oem-files/common-oem-files-"*'.ebuild')
if [[ ${#ebuilds[@]} -eq 0 ]] || [[ ! -e ${ebuilds[0]} ]]; then
echo "No coreos-base/common-oem-files ebuilds?!" >&2
exit 1

View File

@ -1,14 +1,14 @@
#!/bin/bash
# Prints packages which are in both portage-stable and coreos-overlay
# Prints packages which are in both gentoo-subset and flatcar-overlay
SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
. "${SCRIPT_ROOT}/common.sh" || exit 1
DEFINE_string overlay_path "${SRC_ROOT}/third_party/coreos-overlay" \
DEFINE_string overlay_path "${SCRIPT_ROOT}/repos/flatcar-overlay" \
"Directory containing the overlay"
DEFINE_string portage_stable_path "${SRC_ROOT}/third_party/portage-stable" \
"Path to portage-stable"
DEFINE_string gentoo_subset_path "${SCRIPT_ROOT}/repos/gentoo-subset" \
"Path to gentoo-subset"
# Parse flags
FLAGS "$@" || exit 1
@ -19,10 +19,10 @@ function get_tree_packages() {
find "$1" -maxdepth 3 -type f -name "*.ebuild" -printf "%P\n" | xargs dirname | sort | uniq
}
portage_stable_packages=$(get_tree_packages ${FLAGS_portage_stable_path})
gentoo_subset_packages=$(get_tree_packages ${FLAGS_gentoo_subset_path})
overlay_packages=$(get_tree_packages ${FLAGS_overlay_path})
all_packages="$portage_stable_packages $overlay_packages"
all_packages="$gentoo_subset_packages $overlay_packages"
dups=$(sort <<< "$all_packages" | uniq -D | uniq)
if [[ -z "$dups" ]]; then

View File

@ -388,7 +388,7 @@ for d in ./data/*/*; do
for FILE_PATH in "${DATA_DIR}"/*.sig; do
gpg --verify "${FILE_PATH}"
done
echo "Generating extension payloads for ${DATA_DIR}"
shopt -s nullglob
for EXTENSION_PATH in "${DATA_DIR}/flatcar-"*.raw "${DATA_DIR}/oem-"*.raw; do
@ -401,7 +401,7 @@ for d in ./data/*/*; do
--image "${EXTENSION_PATH}" \
--output "${OUTPUT_PATH}" \
--private_keys "${PRIVATE_KEYS}" \
--public_keys "/mnt/host/source/src/scripts/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-au-key/files/official-v2.pub.pem" \
--public_keys "/mnt/host/source/src/scripts/repos/flatcar-overlay/coreos-base/coreos-au-key/files/official-v2.pub.pem" \
--keys_separator "+"
else
echo "ERROR: Found update payload already: ${OUTPUT_PATH}."
@ -409,10 +409,10 @@ for d in ./data/*/*; do
fi
done
shopt -u nullglob
echo "Extracting flatcar_production_update.bin.bz2 for ${DATA_DIR}"
bunzip2 -f -k "${DATA_DIR}/flatcar_production_update.bin.bz2"
echo "Generating generic update payload for ${DATA_DIR}"
OUTPUT_PATH="${DATA_DIR}/flatcar_production_update.gz"
if [ ! -f "${OUTPUT_PATH}" ]; then
@ -422,12 +422,12 @@ for d in ./data/*/*; do
--kernel "${DATA_DIR}/flatcar_production_image.vmlinuz" \
--output "${OUTPUT_PATH}" \
--private_keys "${PRIVATE_KEYS}" \
--public_keys "/mnt/host/source/src/scripts/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-au-key/files/official-v2.pub.pem" \
--public_keys "/mnt/host/source/src/scripts/repos/flatcar-overlay/coreos-base/coreos-au-key/files/official-v2.pub.pem" \
--keys_separator "+"
else
echo "ERROR: Found update payload already: ${OUTPUT_PATH}."
exit 1
fi
echo "Payload generated: ${OUTPUT_PATH}"
done

View File

@ -117,11 +117,11 @@ then
fi
if [[ -n "${OVERLAY_REF}" ]]
then
setup_manifest_ref coreos-overlay "${OVERLAY_REF}"
setup_manifest_ref flatcar-overlay "${OVERLAY_REF}"
fi
if [[ -n "${PORTAGE_REF}" ]]
then
setup_manifest_ref portage-stable "${PORTAGE_REF}"
setup_manifest_ref gentoo-subset "${PORTAGE_REF}"
fi
ln -fns "${FLATCAR_BUILD_ID}.xml" manifest/default.xml

View File

@ -1,21 +0,0 @@
# Derived from https://github.com/mrueg/repoman-travis/
sudo: required
language: python
python:
- pypy
# For some reason portage is defaulting to lbzip2/lbunzip2 here and then complaining when they don't
# exist, so use plain old b{,un}zip2.
env:
- PORTAGE_VER="2.3.40" PORTAGE_BZIP2_COMMAND="bzip2" PORTAGE_BUNZIP2_COMMAND="bunzip2"
before_install:
- sudo apt-get -qq update
- pip install lxml pyyaml
before_script: ./.travis/setup_repoman.sh
script:
- cd /usr/coreos-overlay
- /tmp/portage/portage-${PORTAGE_VER}/repoman/bin/repoman --experimental-repository-modules=y -dx full

View File

@ -1,8 +0,0 @@
[DEFAULT]
main-repo = portage-stable
[coreos]
location = /usr/coreos-overlay
[portage-stable]
location = /usr/portage

View File

@ -1,23 +0,0 @@
#!/bin/bash
set -euo pipefail
# Set up directory permissions/portage user and group.
sudo chmod a+rwX /etc/passwd /etc/group /etc /usr
echo "portage:x:250:250:portage:/var/tmp/portage:/bin/false" >> /etc/passwd
echo "portage::250:portage,travis" >> /etc/group
# Shuffle portage repositories around into the right places.
mkdir -p /etc/portage/repos.conf /usr/coreos-overlay
mv * /usr/coreos-overlay/
mv .git /usr/coreos-overlay/
git clone https://github.com/coreos/portage-stable /usr/portage/
cp .travis/coreos.conf /etc/portage/repos.conf/
ln -s /usr/coreos-overlay/profiles/coreos/amd64/sdk /etc/portage/make.profile
mkdir -p /usr/portage/metadata/{dtd,xml-schema}
wget -O /usr/portage/metadata/dtd/metadata.dtd https://www.gentoo.org/dtd/metadata.dtd
wget -O /usr/portage/metadata/xml-schema/metadata.xsd https://www.gentoo.org/xml-schema/metadata.xsd
# Download portage.
mkdir /tmp/portage && cd /tmp/portage
wget -qO - "https://gitweb.gentoo.org/proj/portage.git/snapshot/portage-${PORTAGE_VER}.tar.gz" | tar xz

View File

@ -3,7 +3,7 @@
This overlay contains Container Linux specific packages and Gentoo packages
that differ from their upstream Gentoo versions.
See the [portage-stable](https://github.com/coreos/portage-stable) repo
See the [gentoo-subset](https://github.com/flatcar/scripts/repos/gentoo-subset) repo
for packages which do not have Container Linux specific changes.
Licensing information can be found in the respective files, so consult
@ -29,7 +29,7 @@ development or production image, plus any OEM specific packages.
that belong in the OEM partition. Any RDEPENDS from these packages should
be copied to the RDEPENDS in `board-packages` to ensure they are built.
`coreos-base/coreos-oem-*` are metapackages for OEM specific ACIs.
`coreos-base/coreos-oem-*` are metapackages for OEM specific ACIs.
# Updating
@ -39,7 +39,7 @@ To update follow the following steps:
upstream Gentoo, not only resetting the ebuild file but also any additional
files like patches or downstream additions under `files`.
* Run `~/trunk/src/scripts/update_ebuilds --portage_stable . CATEGORY/PACKAGE`
in the `coreos-overlay` folder to import a new version from upstream Gentoo.
in the `flatcar-overlay` folder to import a new version from upstream Gentoo.
Drop the ebuild files that you don't plan to use.
* Commit the changes with a message like `CATEGORY/PACKAGE: Sync from Gentoo`,
and mention the the commit ID in the body (`git show update_ebuilds/master`).

View File

@ -1 +1 @@
This is a temporary overlay over portage-stable until Gentoo catches up with package versions.
This is a temporary overlay over gentoo-subset until Gentoo catches up with package versions.

View File

@ -1 +1 @@
This is a temporary overlay over portage-stable until Gentoo catches up with package versions.
This is a temporary overlay over gentoo-subset until Gentoo catches up with package versions.

View File

@ -1,6 +1,6 @@
The patch for configure.ac is not upstreamable at all, we either need
to modify the ebuild or the build system. We went with the latter, so
the ebuild could eventually be moved to portage-stable.
the ebuild could eventually be moved to gentoo-subset.
Git repo of open-vm-tools has a different layout of files than the
tarball. The files that are in toplevel directory in tarball (like

View File

@ -5,7 +5,7 @@ The following steps were needed to make these patches:
- Checkout the appropriate tag:
- For example `RELEASE_2_20231002`.
- Apply the Gentoo patch:
- See the sec-policy/selinux-base ebuild in portage-stable for the
- See the sec-policy/selinux-base ebuild in gentoo-subset for the
patch tarball URL.
- Apply our changes:
- `git am -p2 <OUR_PATCH>` should do the trick. Try adding `-3` flag

View File

@ -1,4 +1,4 @@
masters = portage-stable
masters = gentoo-subset
thin-manifests = true
use-manifests = strict
cache-format = md5-dict

View File

@ -15,7 +15,7 @@ repoman_version: 2.3.3
# noise than signal.
# * The `profile` module, among other issues, generates a huge number (>10000) of dependency.bad
# errors. This is due to unmodified (or minimally modified) ebuilds from Gentoo upstream that
# depend on ebuilds not present in coreos-overlay or portage-stable. These dependencies are hidden
# depend on ebuilds not present in flatcar-overlay or gentoo-subset. These dependencies are hidden
# behind USE flags or otherwise unused in Container Linux, so the missing ebuilds aren't a
# problem, but the amount of noise generated by this module makes it unusable.
#

View File

@ -1,2 +1,2 @@
portage-stable:default/linux/amd64/17.1/no-multilib/hardened
gentoo-subset:default/linux/amd64/17.1/no-multilib/hardened
:coreos/base

View File

@ -1,2 +1,2 @@
portage-stable:default/linux/arm64/17.0/hardened
gentoo-subset:default/linux/arm64/17.0/hardened
:coreos/base

View File

@ -23,7 +23,7 @@ dev-util/catalyst ~amd64 ~arm64
=app-containers/podman-5.0.2 ~amd64 ~arm64
=app-containers/runc-1.1.13 ~amd64 ~arm64
# Seems to be the only available ebuild in portage-stable right now.
# Seems to be the only available ebuild in gentoo-subset right now.
=app-crypt/adcli-0.9.2 ~amd64 ~arm64
# Needed by arm64-native SDK

View File

@ -11,7 +11,7 @@
# certificate store provided in NSS rather than the Gentoo/Debian package.
>=app-misc/ca-certificates-20000000
# Python 3.12 is in portage-stable (currently testing), so avoid picking it
# Python 3.12 is in gentoo-subset (currently testing), so avoid picking it
# up. Update this to mask later versions when we switch to 3.11.
>=dev-lang/python-3.12

View File

@ -1,4 +1,4 @@
# Overwrite portage-stable mask. We haven't seen LLVM related problems
# Overwrite gentoo-subset mask. We haven't seen LLVM related problems
# with rust so far, so keep using 1.70.0.
~dev-lang/rust-1.79.0
~virtual/rust-1.79.0

View File

@ -146,7 +146,7 @@ net-analyzer/tcpdump -ssl -smi -samba
# selinux: to find files with a particular SElinux label
sys-apps/findutils selinux
# Flatcar defaults formerly defined in coreos-overlay ebuilds
# Flatcar defaults formerly defined in flatcar-overlay ebuilds
app-containers/containerd btrfs device-mapper
app-containers/docker btrfs device-mapper overlay seccomp
app-containers/docker-cli hardened

View File

@ -14,7 +14,7 @@ sys-libs/ncurses cxx
# stage1, because ncurses >= 6.2_p20210619 which does not have the USE
# flag at all.
# To fix that, exclude the unicode USE flag from packages.use.force list,
# which is defined in portage-stable.
# which is defined in gentoo-subset.
app-editors/nano unicode
# Pulls dev-python/sphinx, which in turn pulls a lot of other python stuff.

View File

@ -1,2 +1,2 @@
portage-stable:targets/systemd
gentoo-subset:targets/systemd
:features/systemd

View File

@ -3,7 +3,7 @@
CROS_BUILD_BOARD_TREE="${SYSROOT}/build"
CROS_BUILD_BOARD_BIN="${CROS_BUILD_BOARD_TREE}/bin"
CROS_ADDONS_TREE="/mnt/host/source/src/third_party/coreos-overlay/coreos"
CROS_ADDONS_TREE="/mnt/host/source/src/scripts/repos/flatcar-overlay/coreos"
# Are we merging for the board sysroot, or for the cros sdk, or for
# the target hardware? Returns a string:

View File

@ -123,7 +123,7 @@ __slsa_provenance_resolved_dependencies() {
einfo " Provenance: recording ebuild material (input) '${spm_repo}/${ebuild}'"
local repo_uri uri
repo_uri="https://raw.githubusercontent.com/flatcar/scripts/${scripts_hash}/sdk_container/src/third_party/${spm_repo}"
repo_uri="https://raw.githubusercontent.com/flatcar/scripts/${scripts_hash}/repos/${spm_repo}"
uri="${repo_uri}/${ebuild}"
__slsa_rd_printf "${uri}" 'sha1' "${csum}"

View File

@ -1,4 +1,4 @@
# We don't have a separate /{bin,lib} and /usr/{bin,lib}. But the base
# profile in portage-stable forces split-usr, so here we unforce it
# profile in gentoo-subset forces split-usr, so here we unforce it
# and in use.mask we mask it.
-split-usr

View File

@ -1,4 +1,4 @@
# We don't have a separate /{bin,lib} and /usr/{bin,lib}. But the base
# profile in portage-stable forces split-usr, so in use.force we
# profile in gentoo-subset forces split-usr, so in use.force we
# unforce it and here we mask it.
split-usr

View File

@ -1 +1 @@
coreos-overlay
flatcar-overlay

View File

@ -12,7 +12,7 @@ For this, we can just apply the current patches and fix any broken stuff:
git clone https://github.com/coreos/ignition
cd ignition
git checkout "${RELEASE}"
git am --3way /path/to/coreos-overlay/sys-apps/ignition/files/00*
git am --3way /path/to/flatcar-overlay/sys-apps/ignition/files/00*
```
Once done, we can generate the new set of patches:
@ -20,9 +20,9 @@ Once done, we can generate the new set of patches:
git format-patch "${RELEASE}"
```
Copy the new patches to `::coreos-overlay`
Copy the new patches to `::flatcar-overlay`
```
cp 00* /path/to/coreos-overlay/sys-apps/ignition/files/
cp 00* /path/to/flatcar-overlay/sys-apps/ignition/files/
```
:warning: We might need to update the applied patches' names in the Ignition ebuild.

View File

@ -1,5 +1,5 @@
This is a not-really-a-fork of gentoo's `sys-auth/pambase`
package. The main reasons for having it in `coreos-overlay` are:
package. The main reasons for having it in `flatcar-overlay` are:
1. The `sys-apps/baselayout` package replaced it, so this package
became a stub.

View File

@ -13,7 +13,7 @@ gptrepair, search commands.
The patch is prepared using the coreos/grub PRs, picking the only
required ones, and dropping the others. The README.md file in the
coreos-overlay/sys-boot/grub/ contains more contexual information
flatcar-overlay/sys-boot/grub/ contains more contexual information
along with the commits used to create the patch.
Authored-by: Michael Marineau <michael.marineau@coreos.com>

View File

@ -8,7 +8,7 @@ system via the kernel command line
The patch is prepared using the coreos/grub PRs, picking the only
required ones, and dropping the others. The README.md file in the
coreos-overlay/sys-boot/grub/ contains more contexual information
flatcar-overlay/sys-boot/grub/ contains more contexual information
along with the commits used to create the patch.
Authored-by: Matthew Garrett <mjg59@coreos.com>

View File

@ -1,7 +1,7 @@
We keep this package in overlay, because we carry one extra patch for
the unit generator. It was posted upstream and remains
unacknowledged. We could try sending the patch to gentoo, so we can
bring this package back to portage-stable.
bring this package back to gentoo-subset.
The lvm2-activation(-early).service was triggered multiple times which
if done too quickly leads to a failure like this:

View File

@ -22,7 +22,7 @@ If you'd prefer to use a local copy of the portage tree, you can point
Licensing information can be found in the respective files, so consult
them directly. Most ebuilds are licensed under the GPL version 2.
Upstream Gentoo sources: http://sources.gentoo.org/gentoo-x86/
Upstream Gentoo sources: https://gitweb.gentoo.org/repo/gentoo.git/
# Removing packages
@ -55,7 +55,7 @@ Furthermore, the SDK bootstrapping process uses a list of packages defined the b
file. Install `dev-util/catalyst` and run `/usr/lib64/catalyst/targets/stage1/build.py` to get a list of packages
needed for the boostrapping process, then run `emerge --emptytree` on that list.
A package's ebuild must be removed from `portage-stable` _and_ the package must be removed locally. If only the
A package's ebuild must be removed from `gentoo-subset` _and_ the package must be removed locally. If only the
ebuild is removed, the package will be silently elided in the `emerge --emptytree` dependency list.
To see if there are any packages installed without ebuilds run `eix -tTc`. There are no `eix-<arch>-usr` wrappers, so double
check the packages are also unmerged via the `emerge-<arch>-usr` commands. Make sure to run
@ -72,9 +72,9 @@ See [this bug](https://bugs.gentoo.org/127956).
## grep, git grep, repo grep, ripgrep, find, etc
Use your favorite grep variant to see if the package is used anywhere. Good places to double check are
coreos-overlay, manifest, scripts, and portage-stable, as well as anything specific to the package.
flatcar-overlay, manifest, scripts, and gentoo-subset, as well as anything specific to the package.
Be sure to check `coreos-overlay` to ensure there are no use flags, accept_keywords, or other leftover bits
Be sure to check `flatcar-overlay` to ensure there are no use flags, accept_keywords, or other leftover bits
relating to the package being removed.
## Updating the metadata cache
@ -82,9 +82,9 @@ relating to the package being removed.
If you remove a package, make sure to delete the corresponding files in
metadata/md5cache, or run use egencache to do it for you:
```
egencache --update --repo portage-stable
egencache --update --repo gentoo-subset
```
There is also `scripts/update_metadata` which will update both `portage-stable` and `coreos-overlay`
There is also `scripts/update_metadata` which will update both `gentoo-subset` and `flatcar-overlay`
and optionally generate a commit message.
## Testing changes

View File

@ -1 +1 @@
portage-stable
gentoo-subset

View File

@ -0,0 +1 @@
../../../repos/flatcar-overlay

View File

@ -0,0 +1 @@
../../../repos/gentoo-subset

View File

@ -1,4 +1,4 @@
masters = portage-stable
masters = gentoo-subset
thin-manifests = true
use-manifests = strict
cache-format = md5-dict

View File

@ -1,8 +1,8 @@
[DEFAULT]
main-repo = portage-stable
main-repo = gentoo-subset
[coreos]
location = /mnt/host/source/src/third_party/coreos-overlay
[flatcar-overlay]
location = /mnt/host/source/src/scripts/repos/flatcar-overlay
[portage-stable]
location = /mnt/host/source/src/third_party/portage-stable
[gentoo-subset]
location = /mnt/host/source/src/scripts/repos/gentoo-subset

View File

@ -10,13 +10,8 @@ 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.
# Check if the OS image version we're working on is newer than the SDK container
# version and if it is, update the configuration for the SDK and the boards.
(
source /etc/lsb-release # SDK version in DISTRIB_RELEASE
source /mnt/host/source/.repo/manifests/version.txt # OS image version in FLATCAR_VERSION_ID
@ -29,6 +24,9 @@ sed -i -r '/^masters =/s/\bcoreos(\s|$)/coreos-overlay\1/g' /usr/local/portage/c
fi
if [ "${version}" != "${DISTRIB_RELEASE}" ] ; then
# Fix up SDK repo configuration to use the new layout.
sudo su sdk -l -c "/home/sdk/trunk/src/scripts/update_chroot --setuponly"
for target in amd64-usr arm64-usr; do
if [ ! -d "/build/$target" ] ; then
continue

View File

@ -30,8 +30,4 @@ function clone_version() {
sudo chown -R sdk:sdk /home/sdk /mnt/host/source
version="$(source /mnt/host/source/.repo/manifests/version.txt; echo $FLATCAR_VERSION)"
rmdir /mnt/host/source/src/third_party
ln -s /mnt/host/source/src/scripts/sdk_container/src/third_party /mnt/host/source/src/
clone_version scripts /home/sdk/trunk/src/scripts "$version"

View File

@ -154,8 +154,8 @@ fi
get_board_and_variant $FLAGS_board $FLAGS_variant
# Locations we will need
COREOS_OVERLAY="${REPO_ROOT}/src/third_party/coreos-overlay"
COREOS_CONFIG="${COREOS_OVERLAY}/coreos/config"
FLATCAR_OVERLAY="${SCRIPTS_DIR}/repos/flatcar-overlay"
COREOS_CONFIG="${FLATCAR_OVERLAY}/coreos/config"
BOARD_ROOT="/build/${BOARD_VARIANT}"
BOARD_ETC="${BOARD_ROOT}/etc"
BOARD_ARCH=$(get_board_arch "$BOARD")
@ -232,10 +232,10 @@ if [[ ! -L "${BOARD_ROOT}/packages" ]]; then
fi
info "Configuring portage in ${BOARD_ROOT}"
sudo mkdir -p "${BOARD_ETC}/portage/"{profile,repos.conf}
sudo ln -sfT "$(portageq get_repo_path / coreos-overlay)/coreos/user-patches" \
sudo mkdir -p "${BOARD_ETC}"/portage/profile
sudo ln -sfT "$(portageq get_repo_path / flatcar-overlay)/coreos/user-patches" \
"${BOARD_ETC}/portage/patches"
sudo cp /etc/portage/repos.conf/* "${BOARD_ETC}"/portage/repos.conf/
sudo rsync --archive --delete /etc/portage/repos.conf/ "${BOARD_ETC}"/portage/repos.conf/
sudo ROOT="${BOARD_ROOT}" eselect profile set --force "${PORTAGE_PROFILE}"
# Cleanup/migrate from older make.conf files

View File

@ -96,7 +96,7 @@ function check_force_dirs() {
#
set_prefix_vars "${name}" "${prefix}"
prefix_repo="$(dirname "$(EPREFIX="" portageq get_repo_path / portage-stable)")/prefix-overlay"
prefix_repo="$(dirname "$(EPREFIX="" portageq get_repo_path / gentoo-subset)")/prefix-overlay"
if [ "${FLAGS_uninstall}" = "${FLAGS_TRUE}" ] ; then
warn "Removing prefix '${name}' and all associated direcroties and wrappers."

View File

@ -37,7 +37,7 @@ if [[ "${DEFAULT_MANIFEST}" != master.xml ]]; then
DEFAULT_MAJOR=${CURRENT_VERSION[0]}
DEFAULT_BRANCH=${FLAGS_TRUE}
else
DEFAULT_BRANCH_PROJECTS='coreos-overlay portage-stable scripts'
DEFAULT_BRANCH_PROJECTS='flatcar-overlay gentoo-subset scripts'
fi
# Increment $MINOR if we already made a major release.

View File

@ -61,10 +61,10 @@ if [[ -n "${FLAGS_dev_builds_sdk}" ]]; then
FLATCAR_DEV_BUILDS_SDK="${FLAGS_dev_builds_sdk}"
fi
PORTAGE_STABLE_OVERLAY="${REPO_ROOT}/src/third_party/portage-stable"
GENTOO_SUBSET_OVERLAY="${SCRIPTS_DIR}/repos/gentoo-subset"
CROSSDEV_OVERLAY="/usr/local/portage/crossdev"
COREOS_OVERLAY="${REPO_ROOT}/src/third_party/coreos-overlay"
COREOS_CONFIG="${COREOS_OVERLAY}/coreos/config"
FLATCAR_OVERLAY="${SCRIPTS_DIR}/repos/flatcar-overlay"
COREOS_CONFIG="${FLATCAR_OVERLAY}/coreos/config"
PORTAGE_BINHOST="$FLAGS_binhost $(get_sdk_binhost)"
# PORTAGE_USERNAME may already be in the env but set just to be safe.
@ -83,8 +83,9 @@ info "Setting up portage..."
sudo mkdir -p "${REPO_CACHE_DIR}/distfiles"
sudo chown "${PORTAGE_USERNAME}:portage" "${REPO_CACHE_DIR}/distfiles"
sudo mkdir -p /etc/portage/repos.conf /var/lib/portage/pkgs
sudo ln -sfT "${COREOS_OVERLAY}/coreos/user-patches" '/etc/portage/patches'
sudo ln -sfT "${FLATCAR_OVERLAY}/coreos/user-patches" '/etc/portage/patches'
sudo touch /etc/portage/make.conf.user
sudo rm -f /etc/portage/repos.conf/*.conf
sudo_clobber "/etc/portage/make.conf" <<EOF
# Created by update_chroot
@ -103,53 +104,19 @@ EMERGE_DEFAULT_OPTS="--verbose --oneshot"
source "/etc/portage/make.conf.user"
EOF
sudo_clobber "/etc/portage/repos.conf/portage-stable.conf" <<EOF
sudo_clobber "/etc/portage/repos.conf/gentoo-subset.conf" <<EOF
[DEFAULT]
main-repo = portage-stable
main-repo = gentoo-subset
[portage-stable]
location = ${PORTAGE_STABLE_OVERLAY}
[gentoo-subset]
location = ${GENTOO_SUBSET_OVERLAY}
EOF
sudo_clobber "/etc/portage/repos.conf/coreos-overlay.conf" <<EOF
[coreos-overlay]
location = ${COREOS_OVERLAY}
sudo_clobber "/etc/portage/repos.conf/flatcar-overlay.conf" <<EOF
[flatcar-overlay]
location = ${FLATCAR_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
# relinked to the last file found.
# Automatic file renaming to avoid this is challenging as it has to deal with
# the case where we actually do want the files overwritten and so is outside
# the scope of this function for now.
# If your taking advantage of this functionality in the build toolchain
# you probably found out about it from these code comments so we can assume
# for now at least, that you have been somewhat warned.
# If any directories match config/portage/repos/*/repos.conf
if [[ -n $(sudo find /mnt/host/source/config/portage/repos \
-maxdepth 2 -mindepth 2 -type d -name "repos.conf") ]]; then
# If any files match config/portage/repos/*/repos.conf/*
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-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-overlay.conf") ]]; then
die_notrace "One of the portage repo configuration files to be symlinked is " \
"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.
sudo find /mnt/host/source/config/portage/repos \
-maxdepth 3 -mindepth 3 -path "*/repos.conf/*" -type f \
-exec bash -c 'ln -sf {} /etc/portage/repos.conf/$(basename {})' \;
fi
fi
sudo eselect profile set --force "$(get_sdk_profile)"
# Create crossdev repo_name and metadata

View File

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

View File

@ -12,14 +12,14 @@ RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force
DEFINE_string portage "git" \
"Path to a local portage tree or 'rsync' or 'git' to fetch from remote."
DEFINE_string portage_stable "${SRC_ROOT}/third_party/portage-stable" \
"Path to the portage-stable git checkout."
DEFINE_string gentoo_subset "${SCRIPT_ROOT}/repos/gentoo-subset" \
"Path to the gentoo-subset git checkout."
DEFINE_string git "https://github.com/gentoo/gentoo.git" \
"git location for the gentoo portage repo (for use with --portage=git)"
DEFINE_string rsync "rsync://rsync.gentoo.org/gentoo-portage" \
"Rsync location for gentoo-portage to use with --portage=rsync"
DEFINE_boolean commit ${FLAGS_FALSE} \
"Commit all changes after updating portage-stable."
"Commit all changes after updating gentoo-subset."
# Parse flags
@ -36,7 +36,7 @@ if [[ -z "$*" ]]; then
die "No packages provided"
fi
cd "$FLAGS_portage_stable"
cd "$FLAGS_gentoo_subset"
for pkg in "$@"; do
# Only allow packages, not categories or the whole tree
@ -68,7 +68,7 @@ for pkg in "$@"; do
# Make sure we don't change the repo name to 'gentoo'
if [[ "$pkg" =~ ^profiles ]]; then
echo portage-stable > profiles/repo_name
echo gentoo-subset > profiles/repo_name
fi
git add -A "$pkg"
@ -90,4 +90,3 @@ EOF
else
git status
fi

View File

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

View File

@ -23,7 +23,7 @@ cleanup=""
usage() {
echo " $0 - Update SDK container image."
echo " Create a new container image based on the current SDK ($base_sdk_version)"
echo " with current changes from coreos-overlay and portage-stable."
echo " with current changes from flatcar-overlay and gentoo-subset."
echo
echo " Just like build_sdk_container_image the resulting container comes in 3 flavours:"
echo " 1. flatcar-sdk-all - includes both ARM64 and AMD64 support"