diff --git a/bakery.sh b/bakery.sh index 61cb4cd..75cc476 100755 --- a/bakery.sh +++ b/bakery.sh @@ -44,6 +44,8 @@ function _create_sysext_help() { echo "Optional arguments:" echo " --arch : Architecture supported by the sysext." echo " Either x86-64 (the default) or arm64." + echo " --bakery : URL for the bakery." + echo " Default is: 'https://extensions.flatcar.org/extensions'." _generate_sysext_options if [[ $(type -t populate_sysext_root_options ) == function ]] ; then echo "Sysext specific optional parameters:" diff --git a/lib/generate.sh b/lib/generate.sh index 28cf04a..9e07d70 100644 --- a/lib/generate.sh +++ b/lib/generate.sh @@ -85,11 +85,13 @@ function _create_sysupdate() { local match_pattern="${2:-${extname}-@v-%a.raw}" local source_rel="${3:-${extname}}" local target_file="${4:-${source_rel}}" + local bakery_base_url=$(get_optional_param 'bakery' "${bakery_base_url}" "${@}") sed -e "s/{EXTNAME}/${extname}/g" \ -e "s/{MATCH_PATTERN}/${match_pattern}/g" \ -e "s,{SOURCE_REL},${source_rel},g" \ -e "s,{TARGET_FILE},${target_file},g" \ + -e "s,{BAKERY_BASE_URL},${bakery_base_url},g" \ "${libroot}/sysupdate.conf.tmpl" \ >"${extname}.conf" @@ -151,6 +153,8 @@ function _generate_sysext_options() { echo " --epoch : Set SOURCE_DATE_EPOCH (defaults to "0") for reproducible builds." echo " See https://reproducible-builds.org/docs/source-date-epoch/" echo " for more information." + echo " --bakery URL for bakery to fetch sysexts from." + echo " Defaults to 'https://extensions.flatcar.org/extensions'." } # -- diff --git a/lib/libbakery.sh b/lib/libbakery.sh index 6c085f1..36ee2f1 100644 --- a/lib/libbakery.sh +++ b/lib/libbakery.sh @@ -11,7 +11,7 @@ libroot="$(dirname "${BASH_SOURCE[0]}")" scriptroot="$(cd "$(dirname "${BASH_SOURCE[0]}")/../"; pwd)" bakery="flatcar/sysext-bakery" -bakery_hub="extensions.flatcar.org" +bakery_base_url="https://extensions.flatcar.org/extensions" # Add new library function scripts here: source "${libroot}/helpers.sh" diff --git a/lib/sysupdate.conf.tmpl b/lib/sysupdate.conf.tmpl index ed37141..eea70eb 100644 --- a/lib/sysupdate.conf.tmpl +++ b/lib/sysupdate.conf.tmpl @@ -3,7 +3,7 @@ Verify=false [Source] Type=url-file -Path=https://extensions.flatcar.org/extensions/{SOURCE_REL}/ +Path={BAKERY_BASE_URL}/{SOURCE_REL}/ MatchPattern={MATCH_PATTERN} [Target] diff --git a/tools/bake_flatcar_image.sh b/tools/bake_flatcar_image.sh index f96c945..a8e23b8 100755 --- a/tools/bake_flatcar_image.sh +++ b/tools/bake_flatcar_image.sh @@ -56,6 +56,8 @@ function print_help() { echo " --install_to Partition and installation directory of sysexts" echo " in the OS image. Partition can be 'root' and 'oem'." echo " Defaults to '${install_to}'" + echo " --bakery URL for bakery to fetch sysexts from." + echo " Defaults to 'https://extensions.flatcar.org/extensions'." echo } # -- @@ -260,11 +262,12 @@ declare -a sysexts while [ $# -gt 0 ]; do case "$1" in - "--fetch") fetch="yes"; shift;; - "--vendor") vendor="$2"; shift 2;; - "--arch") arch="$2"; shift 2;; - "--release") release="$2"; shift 2;; - "--install_to") install_to="$2"; shift 2;; + "--fetch") fetch="yes"; shift;; + "--vendor") vendor="$2"; shift 2;; + "--arch") arch="$2"; shift 2;; + "--release") release="$2"; shift 2;; + "--install_to") install_to="$2"; shift 2;; + "--bakery") bakery_base_url="$2" shift 2;; --help) print_help; exit;; -h) print_help; exit;; --*) echo -e "\nUnknown option '$1'\n"