diff options
| author | Shulhan <ms@kilabit.info> | 2025-12-25 19:01:04 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-12-25 19:03:16 +0700 |
| commit | fca620c1e13bae91b4a3167a10d660f3d72e7aeb (patch) | |
| tree | 5f586763b54324f85b80822eb0062e9d485ef20e /build-arch-gce | |
| parent | cbc720a6c7b686312d1d309157b37c855eab063c (diff) | |
| download | compute-archlinux-image-builder-fca620c1e13bae91b4a3167a10d660f3d72e7aeb.tar.xz | |
all: remove dependency on gce repository
Since around 13 December 2025, the gce repository return an error 403,
error: failed retrieving file 'gce.db' from storage.googleapis.com
: The requested URL returned error: 403
We then build google-compute-engine and google-guest-agent and host it
under build.kilabit.info repository using the latest releases [1][2].
For google-compute-engine we use version 20251014.00-1.
For google-guest-agent we use version 20251223.00-1.
[1]: https://build.kilabit.info/karajo/app/#job_aur_google-compute-engine
[2]: https://build.kilabit.info/karajo/app/#job_aur_google-guest-agent
Diffstat (limited to 'build-arch-gce')
| -rwxr-xr-x | build-arch-gce | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/build-arch-gce b/build-arch-gce index 094ab67..ca03f13 100755 --- a/build-arch-gce +++ b/build-arch-gce @@ -70,12 +70,15 @@ mkdir -p $mount_dir/var/lib/pacman/sync rsync -r /var/lib/pacman/sync/ $mount_dir/var/lib/pacman/sync/ echo '- Installing Arch Linux.' -pacstrap -c -C "./sys/etc/pacman.conf" -- "$mount_dir" \ - base linux dosfstools e2fsprogs openssh polkit sudo google-compute-engine \ - vim-minimal tmux mosh rsync unzip \ - google-cloud-ops-agent-git google-compute-engine-oslogin +pacstrap -c -C "./sys/etc/pacman.conf.org" -M -- "$mount_dir" \ + base linux dosfstools e2fsprogs openssh polkit sudo \ + vim-minimal tmux mosh rsync unzip + cp -f ./sys/etc/pacman.conf "$mount_dir/etc/pacman.conf" +mkdir -p $mount_dir/etc/pacman.d/ +cp -f ./sys/etc/pacman.d/mirrorlist $mount_dir/etc/pacman.d/ + echo '- Configuring fstab.' root_uuid=$(lsblk --noheadings --raw --output UUID -- "$root_dev") boot_uuid=$(lsblk --noheadings --raw --output UUID -- "$boot_dev") @@ -119,9 +122,6 @@ 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/ @@ -129,10 +129,6 @@ echo '-- Configuring initcpio.' cp ./sys/etc/mkinitcpio.conf $mount_dir/etc/ cp ./sys/etc/mkinitcpio.d/linux.preset $mount_dir/etc/mkinitcpio.d/ -echo '-- Configuring Google Cloud Ops Agent.' -mkdir -p $mount_dir/etc/google-cloud-ops-agent/ -cp ./sys/etc/google-cloud-ops-agent/config.yaml $mount_dir/etc/google-cloud-ops-agent/ - echo '-- Configuring network.' mkdir -p $mount_dir/etc/systemd/network/ cp ./sys/etc/systemd/network/10-eth0.network $mount_dir/etc/systemd/network/ @@ -154,6 +150,8 @@ arch-chroot -- "$mount_dir" /bin/bash -s <<-'EOS' set -eEuo pipefail trap 'echo "Error: \`$BASH_COMMAND\` exited with status $?"' ERR + ls -l /etc/pacman.d/gnupg/ + echo '-- Configuring time.' ln -sf /usr/share/zoneinfo/UTC /etc/localtime systemctl --quiet enable systemd-timesyncd.service @@ -168,8 +166,16 @@ arch-chroot -- "$mount_dir" /bin/bash -s <<-'EOS' echo '-- Enabling sshd service.' systemctl --quiet enable sshd.service - echo '-- Enabling pacman-init service.' - systemctl --quiet enable pacman-init.service + echo '-- Installing google-compute-engine and guest-agent.' + ## Import the key for build.kilabit.info repository. + pacman-key --recv-key 4A5360B500C9C4F0 + pacman-key --lsign-key 4A5360B500C9C4F0 + + ## The google-compute-engine depends on + ## google-compute-engine-oslogin and google-guest-agent. + pacman -Syy --noconfirm \ + google-compute-engine \ + google-cloud-ops-agent-git echo '-- Enabling google-cloud-ops-agent.service' systemctl --quiet enable google-cloud-ops-agent.service @@ -191,6 +197,10 @@ arch-chroot -- "$mount_dir" /bin/bash -s <<-'EOS' fi EOS +echo '- Configuring Google Cloud Ops Agent.' +mkdir -p $mount_dir/etc/google-cloud-ops-agent/ +cp ./sys/etc/google-cloud-ops-agent/config.yaml $mount_dir/etc/google-cloud-ops-agent/ + echo '- Configuring boot loader.' cp ./sys/efi/loader/loader.conf $mount_dir/boot/loader/ cp ./sys/efi/loader/entries/arch.conf $mount_dir/boot/loader/entries/ |
