0696e88801
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.
27 lines
530 B
Bash
Executable File
27 lines
530 B
Bash
Executable File
#!/bin/bash
|
|
|
|
get_cmdline() {
|
|
local param
|
|
for param in $(< /proc/cmdline); do
|
|
case "${param}" in
|
|
$1=*) echo "${param##*=}";
|
|
return 0
|
|
;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
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
|
|
EOF
|