e264b44682
LICENSE: Add GPL-3.0 license. {{archiso,configs}/*,.editorconfig,.gitlab-ci.yml}: Add SPDX license identifier. Makefile: Add SPDX license identifier. Install the `run_archiso.sh` script as global executable `run_archiso`. Use -D and -t flags to install to install files more generically (without a previous call to install the directory). README.rst: Add README outlining the project's scope, how to build images from the profiles and how to test. AUTHORS.rst: Add list of all direct contributors to the repository. CONTRIBUTING.rst: Add basic contribution guidelines, explaining the linter and the license in use. Closes #7 Closes #3
29 lines
576 B
Bash
Executable File
29 lines
576 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
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
|