diff options
| author | Shulhan <ms@kilabit.info> | 2022-08-28 14:08:43 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-02-11 14:23:10 +0700 |
| commit | 1c986750dc494c67438d88920200d6245646d8dc (patch) | |
| tree | e6829d229b5c2887fee47206aba5153543327a2e /build-arch-gce | |
| parent | 6ab17f6eb52e14e0814cd3e23cd4177ba2d1d7c7 (diff) | |
| download | compute-archlinux-image-builder-1c986750dc494c67438d88920200d6245646d8dc.tar.xz | |
all: use worldwide pacman mirrorlist
We have an issue where the image build on local and the generated
mirrorlist is located in India (or Pakistan?).
This cause our package installation/update really slow when creating a
VM in Singapore region.
Since we did not know who or where the image to be used, the safe
configuration should be to use the worldwide one.
Diffstat (limited to 'build-arch-gce')
| -rwxr-xr-x | build-arch-gce | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/build-arch-gce b/build-arch-gce index affacda..b343b6f 100755 --- a/build-arch-gce +++ b/build-arch-gce @@ -118,6 +118,9 @@ cp ./sys/etc/systemd/journald.conf.d/00-google.conf $mount_dir/etc/systemd/journ echo '-- Configuring ssh.' cp ./sys/etc/ssh/sshd_config $mount_dir/etc/ssh/ +echo '-- Configuring pacman mirrorlist.' +cp -f ./sys/etc/pacman.d/mirrorlist $mount_dir/etc/pacman.d/mirrorlist + echo '-- Creating pacman-init service.' cp ./sys/etc/systemd/system/pacman-init.service $mount_dir/etc/systemd/system/ @@ -139,13 +142,6 @@ arch-chroot -- "$mount_dir" /bin/bash -s <<-'EOS' echo '-- Enabling sshd service.' systemctl --quiet enable sshd.service - echo '-- Configuring pacman.' - curl --silent --show-error -o /etc/pacman.d/mirrorlist \ - 'https://archlinux.org/mirrorlist/?country=all&ip_version=4&use_mirror_status=on' - gawk -i assert -i inplace ' - /^#Server / { $0 = substr($0, 2); ++f } - { print } END { assert(f > 0, "f > 0") }' /etc/pacman.d/mirrorlist - echo '-- Enabling pacman-init service.' systemctl --quiet enable pacman-init.service |
