Merge pull request #2838 from flatcar/chewi/binpkgs

Drop confusing and obsolete binpkg-related code
This commit is contained in:
James Le Cuirot 2025-04-24 14:26:15 +01:00 committed by GitHub
commit 3a887ebc4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 6 additions and 37 deletions

View File

@ -38,8 +38,7 @@ CHOST=$(get_board_chost $BOARD)
DISTDIR="/var/lib/portage/distfiles" DISTDIR="/var/lib/portage/distfiles"
PKGDIR="/var/lib/portage/pkgs" PKGDIR="/var/lib/portage/pkgs"
PORT_LOGDIR="/var/log/portage" PORT_LOGDIR="/var/log/portage"
PORTAGE_BINHOST="$(get_binhost_url "${binhost}" "${update_group}" 'pkgs') PORTAGE_BINHOST="$(get_binhost_url "${binhost}" "${update_group}" 'pkgs')"
$(get_binhost_url "${binhost}" "${update_group}" 'toolchain')"
EOF EOF
sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/portage-stable.conf" <<EOF sudo_clobber "${root_fs_dir}/etc/portage/repos.conf/portage-stable.conf" <<EOF

View File

@ -130,37 +130,24 @@ get_board_profile() {
done done
} }
# Usage: get_board_binhost [-t] board [version...] # Usage: get_board_binhost board [version...]
# -t: toolchain only, full rebuilds re-using toolchain pkgs
# If no versions are specified the current and SDK versions are used. # If no versions are specified the current and SDK versions are used.
get_board_binhost() { get_board_binhost() {
local toolchain_only=0 board ver local board ver
if [[ "$1" == "-t" ]]; then
toolchain_only=1
shift
fi
board="$1" board="$1"
shift shift
local pkgs_include_toolchain=0
if [[ $# -eq 0 ]]; then if [[ $# -eq 0 ]]; then
if [[ "${FLATCAR_BUILD_ID}" =~ ^nightly-.*$ ]] ; then if [[ "${FLATCAR_BUILD_ID}" =~ ^nightly-.*$ ]] ; then
# containerised nightly build; this uses [VERSION]-[BUILD_ID] for binpkg url # containerised nightly build; this uses [VERSION]-[BUILD_ID] for binpkg url
# and toolchain packages are at the same location as OS image ones
set -- "${FLATCAR_VERSION_ID}+${FLATCAR_BUILD_ID}" set -- "${FLATCAR_VERSION_ID}+${FLATCAR_BUILD_ID}"
pkgs_include_toolchain=1
else else
set -- "${FLATCAR_VERSION_ID}" set -- "${FLATCAR_VERSION_ID}"
fi fi
fi fi
for ver in "$@"; do for ver in "$@"; do
if [[ $toolchain_only -eq 0 ]]; then
echo "${FLATCAR_DEV_BUILDS}/boards/${board}/${ver}/pkgs/" echo "${FLATCAR_DEV_BUILDS}/boards/${board}/${ver}/pkgs/"
fi
if [[ $pkgs_include_toolchain -eq 0 ]]; then
echo "${FLATCAR_DEV_BUILDS}/boards/${board}/${ver}/toolchain/"
fi
done done
} }
@ -196,13 +183,9 @@ get_sdk_binhost() {
FLATCAR_DEV_BUILDS_SDK="${FLATCAR_DEV_BUILDS_SDK-${SETTING_BINPKG_SERVER_PROD}/sdk}" FLATCAR_DEV_BUILDS_SDK="${FLATCAR_DEV_BUILDS_SDK-${SETTING_BINPKG_SERVER_PROD}/sdk}"
fi fi
for ver in "$@"; do for ver in "$@"; do
# Usually only crossdev needs to be fetched from /toolchain/ in the setup_board step.
# The entry for /pkgs/ is there if something needs to be reinstalled in the SDK # The entry for /pkgs/ is there if something needs to be reinstalled in the SDK
# but normally it is not needed because everything is already part of the tarball. # but normally it is not needed because everything is already part of the tarball.
# To install the crossdev Rust package, /toolchain-arm64/ is derived from /toolchain/
# when necessary in install_cross_toolchain().
if curl -Ifs -o /dev/null "${FLATCAR_DEV_BUILDS_SDK}/${arch}/${ver}/pkgs/"; then if curl -Ifs -o /dev/null "${FLATCAR_DEV_BUILDS_SDK}/${arch}/${ver}/pkgs/"; then
echo "${FLATCAR_DEV_BUILDS_SDK}/${arch}/${ver}/toolchain/"
echo "${FLATCAR_DEV_BUILDS_SDK}/${arch}/${ver}/pkgs/" echo "${FLATCAR_DEV_BUILDS_SDK}/${arch}/${ver}/pkgs/"
fi fi
done done

View File

@ -24,8 +24,6 @@ DEFINE_boolean getbinpkg "${FLAGS_TRUE}" \
"Download binary packages from remote repository." "Download binary packages from remote repository."
DEFINE_string getbinpkgver "" \ DEFINE_string getbinpkgver "" \
"Use binary packages from a specific version." "Use binary packages from a specific version."
DEFINE_boolean toolchainpkgonly "${FLAGS_FALSE}" \
"Use binary packages only for the board toolchain."
DEFINE_boolean workon "${FLAGS_TRUE}" \ DEFINE_boolean workon "${FLAGS_TRUE}" \
"Automatically rebuild updated flatcar-workon packages." "Automatically rebuild updated flatcar-workon packages."
DEFINE_boolean fetchonly "${FLAGS_FALSE}" \ DEFINE_boolean fetchonly "${FLAGS_FALSE}" \
@ -100,11 +98,6 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
else else
UPDATE_ARGS+=( --nogetbinpkg ) UPDATE_ARGS+=( --nogetbinpkg )
fi fi
if [[ "${FLAGS_toolchainpkgonly}" -eq "${FLAGS_TRUE}" ]]; then
UPDATE_ARGS+=( --toolchainpkgonly )
else
UPDATE_ARGS+=( --notoolchainpkgonly )
fi
if [[ -n "${FLAGS_getbinpkgver}" ]]; then if [[ -n "${FLAGS_getbinpkgver}" ]]; then
UPDATE_ARGS+=( --getbinpkgver="${FLAGS_getbinpkgver}" ) UPDATE_ARGS+=( --getbinpkgver="${FLAGS_getbinpkgver}" )
fi fi

View File

@ -43,8 +43,7 @@ Usage: $0 FLAGS...
--file FILE: Modify another file than ${FILE}, useful if run --file FILE: Modify another file than ${FILE}, useful if run
outside of the SDK chroot. If /dev/stdout or outside of the SDK chroot. If /dev/stdout or
/dev/stderr is used, only new values are printed. /dev/stderr is used, only new values are printed.
--binhost Use a custom binhost (defaults to '${DEFAULT_BASE_URL}'), --binhost Use a custom binhost (defaults to '${DEFAULT_BASE_URL}').
e.g., '${SETTING_BINPKG_SERVER_DEV}'.
This will update BOARD and SDK URLs accordingly. This will update BOARD and SDK URLs accordingly.
" "
exit 1 exit 1

View File

@ -4,5 +4,4 @@
SETTING_BINPKG_SERVER_PROD="https://mirror.release.flatcar-linux.net" SETTING_BINPKG_SERVER_PROD="https://mirror.release.flatcar-linux.net"
# development servers / bin caches. # development servers / bin caches.
SETTING_BINPKG_SERVER_DEV="https://bucket.release.flatcar-linux.net/flatcar-jenkins"
SETTING_BINPKG_SERVER_DEV_CONTAINERISED="https://bincache.flatcar-linux.net" SETTING_BINPKG_SERVER_DEV_CONTAINERISED="https://bincache.flatcar-linux.net"

View File

@ -31,8 +31,6 @@ DEFINE_string pkgdir "" \
"Use binary packages from a custom directory instead of /build/[ARCH]/var/lib/portage/pkgs/." "Use binary packages from a custom directory instead of /build/[ARCH]/var/lib/portage/pkgs/."
DEFINE_string binhost "" \ DEFINE_string binhost "" \
"Use binary packages from a specific location instead of $FLATCAR_DEV_BUILDS/... " "Use binary packages from a specific location instead of $FLATCAR_DEV_BUILDS/... "
DEFINE_boolean toolchainpkgonly "${FLAGS_FALSE}" \
"Use binary packages only for the board toolchain."
DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \ DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \
"Don't update toolchain automatically." "Don't update toolchain automatically."
DEFINE_boolean skip_chroot_upgrade "${FLAGS_FALSE}" \ DEFINE_boolean skip_chroot_upgrade "${FLAGS_FALSE}" \
@ -136,13 +134,11 @@ EOF
} }
generate_binhost_list() { generate_binhost_list() {
local t
[[ "${FLAGS_toolchainpkgonly}" -eq "${FLAGS_TRUE}" ]] && t="-t"
FLAGS_getbinpkgver="${FLAGS_getbinpkgver/current/${FLATCAR_VERSION_ID}}" FLAGS_getbinpkgver="${FLAGS_getbinpkgver/current/${FLATCAR_VERSION_ID}}"
FLAGS_getbinpkgver="${FLAGS_getbinpkgver/latest/${FLATCAR_VERSION_ID}}" FLAGS_getbinpkgver="${FLAGS_getbinpkgver/latest/${FLATCAR_VERSION_ID}}"
FLAGS_getbinpkgver="${FLAGS_getbinpkgver/sdk/${FLATCAR_SDK_VERSION}}" FLAGS_getbinpkgver="${FLAGS_getbinpkgver/sdk/${FLATCAR_SDK_VERSION}}"
get_board_binhost $t "${BOARD}" ${FLAGS_getbinpkgver} get_board_binhost "${BOARD}" ${FLAGS_getbinpkgver}
} }
# Parse command line flags # Parse command line flags