From 17803d20925a72d31dbdbacf56cb0a7d2db6efcb Mon Sep 17 00:00:00 2001 From: Esteban Carnevale Date: Mon, 2 Sep 2013 20:03:39 -0300 Subject: Leave only directory for profile releng --- .../root-image/etc/systemd/scripts/choose-mirror | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 configs/profile/root-image/etc/systemd/scripts/choose-mirror (limited to 'configs/profile/root-image/etc/systemd/scripts/choose-mirror') diff --git a/configs/profile/root-image/etc/systemd/scripts/choose-mirror b/configs/profile/root-image/etc/systemd/scripts/choose-mirror new file mode 100755 index 0000000..13c9f69 --- /dev/null +++ b/configs/profile/root-image/etc/systemd/scripts/choose-mirror @@ -0,0 +1,26 @@ +#!/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 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 -- cgit v1.2.3-54-g00ecf