summaryrefslogtreecommitdiff
path: root/configs/lxde-openrc/airootfs/usr/local/bin/choose-mirror
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2020-08-26 16:18:05 -0400
committerDavid P <megver83@parabola.nu>2020-08-26 16:27:37 -0400
commit0d5c488921e1911a5ebaf5d1a9ac3eeb1e72b188 (patch)
treef9c52ed87dec3e5a2b61bac3178d3a989ce31d84 /configs/lxde-openrc/airootfs/usr/local/bin/choose-mirror
parentebbfe24e975da3783b85ab3f2e4a4c8227a3b9ea (diff)
[openrc] airootfs: add/modify scripts to emulate its systemd counterparts, better than beforev47.1
New: * add choose-mirror to openrc profiles * add choose-mirror.start and etc-pacman.d-gnupg.start to openrc profiles * enable haveged in openrc profiles Fixed: * read the kernel cmdline in reflector NM dispatcher script and pacman-init.start * talkingparabola: a little improvement in .zlogin, discovered by shellcheck * Makefile: add talkingparabola's choose-mirror to the shellcheck'ed files Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'configs/lxde-openrc/airootfs/usr/local/bin/choose-mirror')
-rwxr-xr-xconfigs/lxde-openrc/airootfs/usr/local/bin/choose-mirror28
1 files changed, 28 insertions, 0 deletions
diff --git a/configs/lxde-openrc/airootfs/usr/local/bin/choose-mirror b/configs/lxde-openrc/airootfs/usr/local/bin/choose-mirror
new file mode 100755
index 0000000..e8f8254
--- /dev/null
+++ b/configs/lxde-openrc/airootfs/usr/local/bin/choose-mirror
@@ -0,0 +1,28 @@
+#!/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 parabolaiso_http_srv)
+[[ $mirror ]] || exit 0
+
+mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig
+cat >/etc/pacman.d/mirrorlist << EOF
+#
+# Parabola GNU/Linux-libre repository mirrorlist
+# Generated by parabolaiso
+#
+
+Server = ${mirror%%/}/\$repo/os/\$arch
+EOF