Make mirror server configurable

This commit is contained in:
Joshua Boniface 2023-09-01 15:41:59 -04:00
parent fcc4c992e6
commit 7193b4e488
1 changed files with 10 additions and 2 deletions

View File

@ -29,6 +29,7 @@ show_help() {
echo -e " -o: Create the ISO as <output_filename> instead of the default."
echo -e " -u: Change 'deploy' user to a new username."
echo -e " -c: Change CPU architecture to a new architecture [x86_64/aarch64]."
echo -e " -m: Change the mirror server (default 'https://debian.mirror.rafal.ca')."
echo -e " -a: Preserve live-build artifacts."
echo -e " -k: Preserve live-build config."
}
@ -69,6 +70,10 @@ while [ $# -gt 0 ]; do
fi
shift 2
;;
-m)
mirror_server="${2}"
shift 2
;;
-a)
preserve_artifacts='y'
shift
@ -95,6 +100,9 @@ fi
if [[ -z ${deployusername} ]]; then
deployusername="deploy"
fi
if [[ -z ${mirror_server} ]]; then
mirror_server="https://debian.mirror.rafal.ca"
fi
mkdir -p artifacts/lb
pushd artifacts/lb &>/dev/null
@ -108,8 +116,8 @@ echo "Initializing config..."
lb config \
--distribution buster \
--archive-areas "main contrib non-free" \
--mirror-bootstrap "https://debian.mirror.rafal.ca/debian" \
--mirror-chroot-security "https://debian.mirror.rafal.ca/debian-security" \
--mirror-bootstrap "${mirror_server}/debian" \
--mirror-chroot-security "${mirror_server}/debian-security" \
--apt-recommends false \
${arch_config_append} || fail "Failed to initialize live-build config"
echo