Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Arch Linux installation are the following:
machines.
- Root filesystem is ext4.
- Locale is set to en_US.UTF-8 and timezone is set to UTC.
- Network is configured through dhclient.
- Network is configured through systemd-networkd.
- Systemd-timesyncd is enabled and configured to use the Compute Engine metadata
server.
- Pacman keyring is configured to be built and initialized on first boot.
Expand Down
21 changes: 17 additions & 4 deletions build-arch-gce
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ append_gce_repo() {
cp /etc/pacman.conf "$work_dir"
append_gce_repo "$work_dir/pacman.conf"
pacstrap -G -M -C "$work_dir/pacman.conf" -- "$mount_dir" \
base linux dosfstools e2fsprogs dhclient openssh sudo google-compute-engine
base linux dosfstools e2fsprogs openssh sudo google-compute-engine
append_gce_repo "$mount_dir/etc/pacman.conf"

echo '- Configuring fstab.'
Expand Down Expand Up @@ -113,6 +113,22 @@ arch-chroot -- "$mount_dir" /bin/bash -s <<-'EOS'
locale-gen
echo 'LANG=en_US.UTF-8' > /etc/locale.conf

echo '-- Configuring network.'
cat <<-'EOF' > /etc/systemd/network/05-eth0.network
[Match]
Name=eth0

[Network]
DHCP=yes

[DHCPv4]
UseDomains=yes

[DHCPv6]
UseDomains=yes
EOF
systemctl --quiet enable systemd-networkd.service systemd-resolved.service

echo '-- Configuring journald.'
gawk -i assert -i inplace '
/^#ForwardToConsole=/ { $0 = "ForwardToConsole=yes"; ++f }
Expand Down Expand Up @@ -159,9 +175,6 @@ arch-chroot -- "$mount_dir" /bin/bash -s <<-'EOS'
Before=systemd-growfs@-.service
EOF

echo '-- Enabling other services.'
systemctl --quiet enable dhclient@eth0.service

echo '-- Configuring initcpio.'
gawk -i assert -i inplace '
/^MODULES=/ { $0 = "MODULES=(virtio_pci virtio_scsi sd_mod ext4)"; ++f1 }
Expand Down