Skip to content

Commit 37f3625

Browse files
committed
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 <[email protected]>
1 parent a9891ac commit 37f3625

File tree

68 files changed

+177
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+177
-269
lines changed

.github/workflows/common.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ if [[ ! -d "${WORK_SCRIPTS_DIR:-}" ]]; then
1313
fail "WORK_SCRIPTS_DIR env var does not point to a directory. It should point to the scripts repo which will be updated."
1414
fi
1515

16+
# Update these to use the new repo location once LTS has migrated.
1617
readonly SDK_OUTER_TOPDIR="${WORK_SCRIPTS_DIR}"
1718
readonly SDK_OUTER_OVERLAY="${SDK_OUTER_TOPDIR}/sdk_container/src/third_party/coreos-overlay"
18-
readonly SDK_INNER_SRCDIR="/mnt/host/source/src"
19+
readonly SDK_INNER_SRCDIR="/mnt/host/source/src/scripts/sdk_container/src"
1920
readonly SDK_INNER_OVERLAY="${SDK_INNER_SRCDIR}/third_party/coreos-overlay"
2021

2122
readonly BUILDBOT_USERNAME="Flatcar Buildbot"

.github/workflows/image_changes.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ function github_ricj_callback() {
2525
show_changes_env+=(
2626
# Override the default locations of repositories.
2727
"SCRIPTS_REPO=."
28-
"COREOS_OVERLAY_REPO=../coreos-overlay"
29-
"PORTAGE_STABLE_REPO=../portage-stable"
28+
"FLATCAR_OVERLAY_REPO=../flatcar-overlay"
29+
"GENTOO_SUBSET_REPO=../gentoo-subset"
3030
)
3131
show_changes_params+=(
3232
# We may not have a tag handy, so we tell show-changes

.github/workflows/update-portage-stable-packages-from-list.yaml renamed to .github/workflows/update-gentoo-subset-packages-from-list.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Keep portage-stable packages updated
1+
name: Keep gentoo-subset packages updated
22
on:
33
schedule:
44
- cron: '0 7 * * 1'
@@ -35,10 +35,10 @@ jobs:
3535
git config --global user.name "Flatcar Buildbot"
3636
git config --global user.email "[email protected]"
3737
old_head=$(git -C scripts rev-parse HEAD)
38-
packages_list=$(realpath scripts/.github/workflows/portage-stable-packages-list)
38+
packages_list=$(realpath scripts/.github/workflows/gentoo-subset-packages-list)
3939
gentoo_repo=$(realpath gentoo)
4040
build_scripts=$(realpath flatcar-build-scripts)
41-
pushd scripts/sdk_container/src/third_party/portage-stable
41+
pushd scripts/repos/gentoo-subset
4242
while read -r package; do
4343
if [[ ! -e "${package}" ]]; then
4444
# If this happens, it means that the package was moved to overlay
@@ -50,7 +50,7 @@ jobs:
5050
# If this happens, it means that the package was obsoleted or moved
5151
# in Gentoo. The obsoletion needs to be handled in the case-by-case
5252
# manner, while move should be handled by doing the same move
53-
# in portage-stable. The build should not break because of the move,
53+
# in gentoo-subset. The build should not break because of the move,
5454
# because most likely it's already reflected in the profiles/updates
5555
# directory.
5656
echo "::warning title=${package}::Obsolete or moved package"
@@ -73,10 +73,10 @@ jobs:
7373
with:
7474
token: ${{ secrets.GITHUB_TOKEN }}
7575
path: scripts
76-
branch: buildbot/weekly-portage-stable-package-updates-${{steps.update-listed-packages.outputs.TODAYDATE }}
76+
branch: buildbot/weekly-gentoo-subset-package-updates-${{steps.update-listed-packages.outputs.TODAYDATE }}
7777
delete-branch: true
7878
base: main
79-
title: Weekly portage-stable package updates ${{steps.update-listed-packages.outputs.TODAYDATE }}
79+
title: Weekly gentoo-subset package updates ${{steps.update-listed-packages.outputs.TODAYDATE }}
8080
body: |
8181
CI: TODO
8282

.github/workflows/update-metadata-glsa.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Update GLSA metadata
1616
id: update-glsa-metadata
1717
run: |
18-
glsa_dir='sdk_container/src/third_party/portage-stable/metadata/glsa'
18+
glsa_dir='repos/gentoo-subset/metadata/glsa'
1919
rm -rf "${glsa_dir}"
2020
mkdir --parents "${glsa_dir}"
2121
rsync --archive rsync://rsync.gentoo.org/gentoo-portage/metadata/glsa/* "${glsa_dir}"
@@ -30,6 +30,6 @@ jobs:
3030
base: main
3131
title: Monthly GLSA metadata ${{steps.update-glsa-metadata.outputs.TODAYDATE }}
3232
body: Updated GLSA metadata
33-
commit-message: "portage-stable/metadata: Monthly GLSA metadata updates"
33+
commit-message: "gentoo-subset/metadata: Monthly GLSA metadata updates"
3434
author: Flatcar Buildbot <[email protected]>
3535
labels: main

PREFIX.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Prefix uses a _staging environment_ to build binary packages, then installs thes
3535
The _staging environment_ contains toolchains and all build tools required to create binary packages (a full `@system`).
3636
The _final environment_ only contains run-time dependencies.
3737

38-
Packages are built from ebuilds in coreos-overlay, portage-stable, and prefix-overlay.
38+
Packages are built from ebuilds in flatcar-overlay, gentoo-subset, and prefix-overlay.
3939

4040
A QoL `emerge` wrapper is included to install packages to the prefix.
4141

README.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,18 @@ The SDK can be used to
1414
# Using the scripts repository
1515

1616
The repository is meant to be the entry point for Flatcar builds and development.
17-
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/):
17+
Ebuilds for all packages reside in one of 2 subdirectories - [flatcar-overlay](repos/flatcar-overlay) and [gentoo-subset](repos/gentoo-subset/):
1818
```
1919
scripts
20-
+--sdk_container
21-
+---------src
22-
+--third_party
23-
+------coreos-overlay
24-
+------portage-stable
20+
+--repos
21+
+--flatcar-overlay
22+
+--gentoo-subset
2523
```
2624

27-
`portage-stable` is kept in alignment with upstream Gentoo and should not contain any modifications (with only minor, well-justified exceptions).
25+
`gentoo-subset` is kept in alignment with upstream Gentoo and should not contain any modifications (with only minor, well-justified exceptions).
2826
Consider it a small sub-set of Gentoo.
2927

30-
`coreos-overlay` contains significantly modified or even entirely self-written ebuilds.
28+
`flatcar-overlay` contains significantly modified or even entirely self-written ebuilds.
3129

3230
The `scripts` repository makes ample use of tags to mark releases.
3331
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
5250

5351
The container can be run in one of two ways - "standalone", or integrated with the [scripts](https://github.com/flatcar/scripts) repo:
5452
* 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.
55-
* 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.
53+
* 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.
5654

5755
## Standalone mode
5856

@@ -82,7 +80,7 @@ To start a container in privileged mode with `/dev` available use:
8280

8381
This is the preferred mode of working with the SDK.
8482
Interaction with the container happens via wrapper scripts from the scripts repository.
85-
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.
83+
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.
8684
The wrapper scripts will re-use existing containers instead of creating new ones to preserve your work in the container, enabling consistency.
8785

8886
To clone the scripts repo and pick a version:

bootstrap_sdk

+9-9
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
# will be linked against the SEED SDK libraries, NOT against libraries built
1919
# in stage 1.
2020
#
21-
# 3. stage2: Run portage-stable/scripts/bootstrap.sh
21+
# 3. stage2: Run gentoo-subset/scripts/bootstrap.sh
2222
# This rebuilds the toolchain using Gentoo bootstrapping, ensuring it's not linked
2323
# to or otherwise influenced by whatever was in the "seed" tarball.
2424
# The toolchain rebuild may contain updated package ebuilds from
25-
# third_party/(portage-stable|coreos-overlay).
26-
# This and all following stages use portage-stable and coreos-overlay
27-
# from third_party/... (see 1.)
25+
# repos/(gentoo-subset|flatcar-overlay).
26+
# This and all following stages use gentoo-subset and flatcar-overlay
27+
# from repos/... (see 1.)
2828
#
2929
# 4. stage3: Run emerge -e system to rebuild everything using the fresh updated
3030
# toolchain from 3., using the normal USE flags provided by the profile. This
@@ -95,13 +95,13 @@ chmod 1777 "${ROOT_OVERLAY}/tmp"
9595
cp "${BUILD_LIBRARY_DIR}/toolchain_util.sh" "${ROOT_OVERLAY}/tmp"
9696

9797

98-
# Stage 1 uses "known-good" ebuilds (from both coreos-overlay and portage-stable)
98+
# Stage 1 uses "known-good" ebuilds (from both flatcar-overlay and gentoo-subset)
9999
# to build a minimal toolchain (USE="-*") for stage 2.
100100
#
101-
# No package updates must happen in stage 1, so we use the portage-stable and
102-
# coreos-overlay paths included with the current SDK (from the SDK chroot's
103-
# /var/gentoo/repos/). "Current SDK" refers to the SDK we entered with
104-
# 'cork enter', i.e. the SDK we run ./bootstrap_sdk in.
101+
# No package updates must happen in stage 1, so we use the gentoo-subset and
102+
# flatcar-overlay paths included with the current SDK (from the SDK chroot's
103+
# /mnt/host/source/src/scripts/repos/). "Current SDK" refers to the SDK we
104+
# entered with 'cork enter', i.e. the SDK we run ./bootstrap_sdk in.
105105
#
106106
# Using ebuilds from the above mentioned sources will ensure that stage 1 builds
107107
# a minimal stage 2 from known-good ebuild versions - the same ebuild versions

build_library/build_image_util.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ get_metadata() {
365365
local mirror="$(echo "${v}" | grep mirror:// | cut -d '/' -f 3)"
366366
if [ -n "${mirror}" ]; then
367367
# Take only first mirror, those not working should be removed
368-
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')"
368+
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')"
369369
v="$(echo "${v}" | sed "s#mirror://${mirror}/#${location}#g")"
370370
fi
371371
new_val+="${v} "
@@ -489,8 +489,8 @@ EOF
489489
local license_list # define before assignment because it would mask any error
490490
license_list="$(jq -r '.[] | "\(.licenses | .[])"' "${json_input}" | sort | uniq)"
491491
local license_dirs=(
492-
"/mnt/host/source/src/third_party/coreos-overlay/licenses/"
493-
"/mnt/host/source/src/third_party/portage-stable/licenses/"
492+
"/mnt/host/source/src/scripts/repos/flatcar-overlay/licenses/"
493+
"/mnt/host/source/src/scripts/repos/gentoo-subset/licenses/"
494494
"none"
495495
)
496496
for license_file in ${license_list}; do

build_library/catalyst.sh

+12-12
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ STAGES=
2828

2929
DEFINE_string catalyst_root "${DEFAULT_CATALYST_ROOT}" \
3030
"Path to directory for all catalyst images and other files."
31-
DEFINE_string portage_stable "${SRC_ROOT}/third_party/portage-stable" \
32-
"Path to the portage-stable git checkout."
33-
DEFINE_string coreos_overlay "${SRC_ROOT}/third_party/coreos-overlay" \
34-
"Path to the coreos-overlay git checkout."
31+
DEFINE_string gentoo_subset "${SCRIPTS_DIR}/repos/gentoo-subset" \
32+
"Path to the gentoo-subset git checkout."
33+
DEFINE_string flatcar_overlay "${SCRIPTS_DIR}/repos/flatcar-overlay" \
34+
"Path to the flatcar-overlay git checkout."
3535
DEFINE_string seed_tarball "${DEFAULT_SEED}" \
3636
"Path to an existing stage tarball to start from."
3737
DEFINE_string version "${FLATCAR_VERSION}" \
@@ -62,8 +62,8 @@ storedir="$CATALYST_ROOT"
6262
distdir="$DISTDIR"
6363
envscript="$TEMPDIR/catalystrc"
6464
port_logdir="$CATALYST_ROOT/log"
65-
repo_basedir="/mnt/host/source/src/third_party"
66-
repo_name="portage-stable"
65+
repo_basedir="/mnt/host/source/src/scripts/repos"
66+
repo_name="gentoo-subset"
6767
EOF
6868
}
6969

@@ -87,8 +87,8 @@ target: stage$1
8787
subarch: $ARCH
8888
rel_type: $TYPE
8989
portage_confdir: $TEMPDIR/portage
90-
repos: $FLAGS_coreos_overlay
91-
keep_repos: portage-stable coreos-overlay
90+
repos: $FLAGS_flatcar_overlay
91+
keep_repos: gentoo-subset flatcar-overlay
9292
profile: $FLAGS_profile
9393
snapshot_treeish: $FLAGS_version
9494
version_stamp: $FLAGS_version
@@ -231,7 +231,7 @@ write_configs() {
231231
info "Configuring Portage..."
232232
cp -r "${BUILD_LIBRARY_DIR}"/portage/ "${TEMPDIR}/"
233233

234-
ln -sfT '/mnt/host/source/src/third_party/coreos-overlay/coreos/user-patches' \
234+
ln -sfT '/mnt/host/source/src/scripts/repos/flatcar-overlay/coreos/user-patches' \
235235
"${TEMPDIR}"/portage/patches
236236
}
237237

@@ -264,10 +264,10 @@ build_stage() {
264264
build_snapshot() {
265265
local repo_dir snapshot snapshots_dir snapshot_path
266266

267-
repo_dir=${1:-"${FLAGS_portage_stable}"}
267+
repo_dir=${1:-"${FLAGS_gentoo_subset}"}
268268
snapshot=${2:-"${FLAGS_version}"}
269269
snapshots_dir="${CATALYST_ROOT}/snapshots"
270-
snapshot_path="${snapshots_dir}/portage-stable-${snapshot}.sqfs"
270+
snapshot_path="${snapshots_dir}/gentoo-subset-${snapshot}.sqfs"
271271
if [[ -f ${snapshot_path} && $FLAGS_rebuild == $FLAGS_FALSE ]]
272272
then
273273
info "Skipping snapshot, ${snapshot_path} exists"
@@ -325,5 +325,5 @@ catalyst_build() {
325325
fi
326326

327327
# Cleanup snapshots, we don't use them
328-
rm -rf "$CATALYST_ROOT/snapshots/${FLAGS_portage_stable##*/}-${FLAGS_version}.sqfs"*
328+
rm -rf "$CATALYST_ROOT/snapshots/${FLAGS_gentoo_subset##*/}-${FLAGS_version}.sqfs"*
329329
}

build_library/dev_container_util.sh

+12-12
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ configure_dev_portage() {
2020

2121
# Need profiles at the bare minimum
2222
local repo
23-
for repo in portage-stable coreos-overlay; do
23+
for repo in gentoo-subset flatcar-overlay; do
2424
sudo mkdir -p "${root_fs_dir}/var/lib/portage/${repo}"
2525
sudo rsync -rtl --exclude=md5-cache \
26-
"${SRC_ROOT}/third_party/${repo}/metadata" \
27-
"${SRC_ROOT}/third_party/${repo}/profiles" \
26+
"${SRC_ROOT}/scripts/repos/${repo}/metadata" \
27+
"${SRC_ROOT}/scripts/repos/${repo}/profiles" \
2828
"${root_fs_dir}/var/lib/portage/${repo}"
2929
done
3030

@@ -42,26 +42,26 @@ PORTAGE_BINHOST="$(get_binhost_url "${binhost}" "${update_group}" 'pkgs')
4242
$(get_binhost_url "${binhost}" "${update_group}" 'toolchain')"
4343
EOF
4444

45-
sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/portage-stable.conf" <<EOF
45+
sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/gentoo-subset.conf" <<EOF
4646
[DEFAULT]
47-
main-repo = portage-stable
47+
main-repo = gentoo-subset
4848
49-
[portage-stable]
50-
location = /var/lib/portage/portage-stable
49+
[gentoo-subset]
50+
location = /var/lib/portage/gentoo-subset
5151
EOF
5252

53-
sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/coreos-overlay.conf" <<EOF
54-
[coreos-overlay]
55-
location = /var/lib/portage/coreos-overlay
53+
sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/flatcar-overlay.conf" <<EOF
54+
[flatcar-overlay]
55+
location = /var/lib/portage/flatcar-overlay
5656
EOF
5757

5858
# Now set the correct profile, we do not use the eselect tool - it
5959
# does not seem to be usable outside of the chroot without using
6060
# deprecated PORTDIR and PORTDIR_OVERLAY environment variables.
6161
local profile_name=$(get_board_profile "${BOARD}")
62-
# Turn coreos-overlay:coreos/amd64/generic into coreos/amd64/generic/dev
62+
# Turn flatcar-overlay:coreos/amd64/generic into coreos/amd64/generic/dev
6363
profile_name="${profile_name#*:}/dev"
64-
local profile_directory="${root_fs_dir}/var/lib/portage/coreos-overlay/profiles/${profile_name}"
64+
local profile_directory="${root_fs_dir}/var/lib/portage/flatcar-overlay/profiles/${profile_name}"
6565
if [[ ! -d "${profile_directory}" ]]; then
6666
die "Not a valid profile: ${profile_name}"
6767
fi

build_library/prefix_util.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function setup_prefix_dirs() {
6767
sudo cp -vR "${prefix_repo}/skel/etc/portage" "${STAGINGROOT}${EPREFIX}/etc/"
6868
sudo cp -vR "${prefix_repo}/skel/etc/portage" "${FINALROOT}${EPREFIX}/etc/"
6969

70-
local profile="/mnt/host/source/src/third_party/portage-stable/profiles/default/linux"
70+
local profile="/mnt/host/source/src/scripts/repos/gentoo-subset/profiles/default/linux"
7171
case "${PREFIX_BOARD}" in
7272
amd64-usr) profile="${profile}/amd64/17.1/no-multilib/prefix/kernel-3.2+";;
7373
arm64-usr) profile="${profile}/arm64/17.0/prefix/kernel-3.2+";;

build_library/sysext_mangle_containerd-flatcar

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ echo ">>> NOTICE: $0: removing 'gen-manpages', 'containerd-stress' from sysext"
99
rm -f "${rootfs}/usr/bin/gen-manpages" "${rootfs}/usr/bin/containerd-stress"
1010

1111
script_root="$(cd "$(dirname "$0")/../"; pwd)"
12-
files_dir="${script_root}/sdk_container/src/third_party/coreos-overlay/coreos/sysext/containerd"
12+
files_dir="${script_root}/repos/flatcar-overlay/coreos/sysext/containerd"
1313

1414
echo ">>> NOTICE $0: installing extra files from '${files_dir}'"
1515
cp -va "${files_dir}/"* "${rootfs}"

build_library/sysext_mangle_docker-flatcar

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ echo ">>> NOTICE: $0: removing '/usr/lib/debug/', '/usr/share/docker/contrib' fr
88
rm -rf "${rootfs}/usr/lib/debug/" "${rootfs}/usr/share/docker/contrib/"
99

1010
script_root="$(cd "$(dirname "$0")/../"; pwd)"
11-
files_dir="${script_root}/sdk_container/src/third_party/coreos-overlay/coreos/sysext/docker"
11+
files_dir="${script_root}/repos/flatcar-overlay/coreos/sysext/docker"
1212

1313
echo ">>> NOTICE $0: installing extra files from '${files_dir}'"
1414
cp -va "${files_dir}/"* "${rootfs}"

0 commit comments

Comments
 (0)