Commit 0696e888 authored by Thomas Bächler's avatar Thomas Bächler Committed by Gerardo Exequiel Pozzi
Browse files

releng: Allow specifying a mirror on the kernel command line.

The new mirror= option takes a mirror URL and creates a new mirrorlist.
When setting mirror=auto, the mirror is taken from archiso_http_srv in
order to keep using the mirror selected in the netboot menu.
parent 5d75049c
get_cmdline() {
local param
for param in $(< /proc/cmdline); do
case "${param}" in
$1=*) echo "${param##*=}";
return 0
mirror=$(get_cmdline mirror)
[[ $mirror = auto ]] && mirror=$(get_cmdline archiso_http_srv)
[[ $mirror ]] || exit 0
mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig
cat >/etc/pacman.d/mirrorlist << EOF
# Arch Linux repository mirrorlist
# Generated by archiso
Server = ${mirror%%/}/\$repo/os/\$arch
Description=Choose mirror from the kernel command line
......@@ -17,4 +17,4 @@ chmod 440 /etc/sudoers.d/g_wheel
sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist
systemctl enable pacman-init.service
systemctl enable pacman-init.service choose-mirror.service
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment