diff --git a/bootstrap_sdk b/bootstrap_sdk index ccfba3720e..f3fb419e12 100755 --- a/bootstrap_sdk +++ b/bootstrap_sdk @@ -11,33 +11,36 @@ # For reference the procedure it performs is this: # # 1. snapshot: Grab a snapshot of the portage-stable repo from -# third_party/... . coreoy-overlay is used as-is from the same source. +# 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. Tarball is built from the current SDK's -# portage-stable and coreos-overlay instead of the ones from stage1 -# since stage1 must not contain updated ebuilds (see build_stage1 below). -# This stage uses: -# - portage-stable from the SDK's /var/lib/gentoo/repos/gentoo -# - a fresh check-out of coreos-overlay at the revision used to build the SDK +# minimal root file system into a clean directory using ROOT=... +# and USE=-* The restricted USE flags are key be small and avoid +# circular dependencies. +# This stage uses: +# - portage-stable from the SDK's /var/lib/gentoo/repos/gentoo +# or a git ref via --stage1_portage_ref command line option +# - coreos-overlay from the SDK's /var/lib/gentoo/repos/coreos-overlay +# or a git ref via --stage1_overlay_ref command line option +# Command line option refs need caution though, since +# stage1 must not contain updated ebuilds (see build_stage1 below). # # 3. stage2: Run portage-stable/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.) +# 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.) # # 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 -# will also pull in assorted base system packages that weren't included -# in the minimal environment stage1 created. +# toolchain from 3., using the normal USE flags provided by the profile. This +# will also pull in assorted base system packages that weren't included +# in the minimal environment stage1 created. # # 5. stage4: Install any extra packages or other desired tweaks. For the -# sdk we just install all the packages normally make_chroot.sh does. +# sdk we just install all the packages normally make_chroot.sh does. # # Usage: bootstrap_sdk [stage1 stage2 etc] # By default all four stages will be built using the latest stage4 as a seed. @@ -52,6 +55,13 @@ TYPE="flatcar-sdk" # include upload options . "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1 + +DEFINE_string stage1_portage_ref "" \ + "Custom portage repo git ref to use in stage 1 (USE WITH CAUTION)" +DEFINE_string stage1_overlay_ref "" \ + "Custom overlay repo git ref to use in stage 1 (USE WITH CAUTION)" + + ## Define the stage4 config template catalyst_stage4() { cat <>"$TEMPDIR/stage1.spec" + fi + # Finally, build stage 1 build_stage stage1 "$SEED" "$TEMPDIR/catalyst-stage1.conf" }