aboutsummaryrefslogtreecommitdiff
path: root/build-arch-gce
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-01-28 00:15:52 +0700
committerShulhan <ms@kilabit.info>2026-01-28 00:16:44 +0700
commit5aafb2bf78ba7e421d75cdef028850a6dc8c286f (patch)
treef245567c89165a8dc44431eb4e8c7c4088bbe434 /build-arch-gce
parent701ad0f9188f0cba9e220c97aa78546a0da98344 (diff)
downloadcompute-archlinux-image-builder-5aafb2bf78ba7e421d75cdef028850a6dc8c286f.tar.xz
all: set the resolv.conf symlinked to systemd stub-resolv.conf
The default resolv.conf is empty. This cause program that depends on resolv.conf for name resolution will fail. As a test, we create small Go program "cmd/golookup" that can lookup IP address of host name using pure Go resolver (using/etc/resolv.conf).
Diffstat (limited to 'build-arch-gce')
-rwxr-xr-xbuild-arch-gce5
1 files changed, 5 insertions, 0 deletions
diff --git a/build-arch-gce b/build-arch-gce
index 7a9559f..5046796 100755
--- a/build-arch-gce
+++ b/build-arch-gce
@@ -72,6 +72,7 @@ rsync -r /var/lib/pacman/sync/ $mount_dir/var/lib/pacman/sync/
echo '- Installing Arch Linux.'
pacstrap -c -C "./sys/etc/pacman.conf.org" -M -- "$mount_dir" \
base linux dosfstools e2fsprogs openssh polkit sudo \
+ systemd-resolvconf \
vim-minimal tmux mosh rsync unzip
cp -f ./sys/etc/pacman.conf "$mount_dir/etc/pacman.conf"
@@ -180,6 +181,10 @@ arch-chroot -- "$mount_dir" /bin/bash -s <<-'EOS'
echo '-- Running boot loader.'
bootctl install --no-variables --quiet
+ echo '-- Configuring stub for resolv.conf.'
+ umount /etc/resolv.conf
+ ln -fs /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
+
if [[ -n "${IMAGE_QEMU:-}" ]]; then
echo '-- IMAGE_QEMU: Creating user arch.'
useradd --create-home --groups wheel arch