Skip to content

[FEATURE] Add support for custom bakery url #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bakery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ function _create_sysext_help() {
echo "Optional arguments:"
echo " --arch <arch>: Architecture supported by the sysext."
echo " Either x86-64 (the default) or arm64."
echo " --bakery <url>: 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:"
Expand Down
4 changes: 4 additions & 0 deletions lib/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -151,6 +153,8 @@ function _generate_sysext_options() {
echo " --epoch <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> URL for bakery to fetch sysexts from."
echo " Defaults to 'https://extensions.flatcar.org/extensions'."
}
# --

Expand Down
2 changes: 1 addition & 1 deletion lib/libbakery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ libroot="$(dirname "${BASH_SOURCE[0]}")"
scriptroot="$(cd "$(dirname "${BASH_SOURCE[0]}")/../"; pwd)"

bakery="flatcar/sysext-bakery"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to take care of this one as well, it is used to query version information of existing images from github to determine which ones to build.

bakery_hub="extensions.flatcar.org"
bakery_base_url="https://extensions.flatcar.org/extensions"

# Add new library function scripts here:
source "${libroot}/helpers.sh"
Expand Down
2 changes: 1 addition & 1 deletion lib/sysupdate.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
13 changes: 8 additions & 5 deletions tools/bake_flatcar_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ function print_help() {
echo " --install_to <partition:install-root> 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> URL for bakery to fetch sysexts from."
echo " Defaults to 'https://extensions.flatcar.org/extensions'."
echo
}
# --
Expand Down Expand Up @@ -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"
Expand Down