You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
615 B

4 years ago
#!/bin/bash
#
# SPDX-License-Identifier: GPL-3.0-or-later
get_cmdline() {
local param
10 months ago
for param in $(</proc/cmdline); do
4 years ago
case "${param}" in
10 months ago
"${1}="*)
echo "${param##*=}"
return 0
;;
4 years ago
esac
done
}
10 months ago
mirror="$(get_cmdline mirror)"
[[ "$mirror" == 'auto' ]] && mirror="$(get_cmdline archiso_http_srv)"
[[ -n "$mirror" ]] || exit 0
4 years ago
mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig
10 months ago
cat >/etc/pacman.d/mirrorlist <<EOF
4 years ago
#
# Arch Linux repository mirrorlist
# Generated by archiso
#
Server = ${mirror%%/}/\$repo/os/\$arch
EOF