aboutsummaryrefslogtreecommitdiff
path: root/build-arch-gce
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-07-03 02:59:54 +0700
committerShulhan <ms@kilabit.info>2022-07-25 19:29:22 +0700
commit7be14a53dc3426fe722036c189a611726d5e04dd (patch)
tree8849b3c7e3378491bf2d0c14033e50d28c2b3b40 /build-arch-gce
parentff5f303619eade1089cb22a3acbd6584facad414 (diff)
downloadcompute-archlinux-image-builder-7be14a53dc3426fe722036c189a611726d5e04dd.tar.xz
all: use predefined pacman.conf
The pacman.conf file is rarely updated, so we add the gce repository directly into file and use it during pacstrap and to replace the target root.
Diffstat (limited to 'build-arch-gce')
-rwxr-xr-xbuild-arch-gce16
1 files changed, 2 insertions, 14 deletions
diff --git a/build-arch-gce b/build-arch-gce
index ececc62..2ea7fbb 100755
--- a/build-arch-gce
+++ b/build-arch-gce
@@ -65,21 +65,9 @@ mkdir -p -- "$mount_dir/boot"
mount -- "$efi_dev" "$mount_dir/boot"
echo '- Installing Arch Linux.'
-append_gce_repo() {
- gawk -i inplace '
- /^\[gce\]$/ { found = 1 } { print }
- ENDFILE { if (!found) {
- print ""
- print "[gce]"
- print "Server = https://storage.googleapis.com/arch-linux-gce/repo"
- print "SigLevel = Optional TrustAll"
- } }' "$1"
-}
-cp /etc/pacman.conf "$work_dir"
-append_gce_repo "$work_dir/pacman.conf"
-pacstrap -c -G -M -C "$work_dir/pacman.conf" -- "$mount_dir" \
+pacstrap -c -G -M -C "./sys/etc/pacman.conf" -- "$mount_dir" \
base linux dosfstools e2fsprogs dhclient openssh sudo google-compute-engine
-append_gce_repo "$mount_dir/etc/pacman.conf"
+cp -f ./sys/etc/pacman.conf "$mount_dir/etc/pacman.conf"
echo '- Configuring fstab.'
root_uuid=$(lsblk --noheadings --raw --output UUID -- "$root_dev")