Skip to content

Commit 01b94b3

Browse files
committed
Replace dhclient with systemd-networkd
Fixes #45, #49
1 parent f639b4f commit 01b94b3

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Arch Linux installation are the following:
1818
machines.
1919
- Root filesystem is ext4.
2020
- Locale is set to en_US.UTF-8 and timezone is set to UTC.
21-
- Network is configured through dhclient.
21+
- Network is configured through systemd-networkd.
2222
- Systemd-timesyncd is enabled and configured to use the Compute Engine metadata
2323
server.
2424
- Pacman keyring is configured to be built and initialized on first boot.

build-arch-gce

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ append_gce_repo() {
7676
cp /etc/pacman.conf "$work_dir"
7777
append_gce_repo "$work_dir/pacman.conf"
7878
pacstrap -G -M -C "$work_dir/pacman.conf" -- "$mount_dir" \
79-
base linux dosfstools e2fsprogs dhclient openssh sudo google-compute-engine
79+
base linux dosfstools e2fsprogs openssh sudo google-compute-engine
8080
append_gce_repo "$mount_dir/etc/pacman.conf"
8181

8282
echo '- Configuring fstab.'
@@ -113,6 +113,22 @@ arch-chroot -- "$mount_dir" /bin/bash -s <<-'EOS'
113113
locale-gen
114114
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
115115
116+
echo '-- Configuring network.'
117+
cat <<-'EOF' > /etc/systemd/network/05-eth0.network
118+
[Match]
119+
Name=eth0
120+
121+
[Network]
122+
DHCP=yes
123+
124+
[DHCPv4]
125+
UseDomains=yes
126+
127+
[DHCPv6]
128+
UseDomains=yes
129+
EOF
130+
systemctl --quiet enable systemd-networkd.service systemd-resolved.service
131+
116132
echo '-- Configuring journald.'
117133
gawk -i assert -i inplace '
118134
/^#ForwardToConsole=/ { $0 = "ForwardToConsole=yes"; ++f }
@@ -159,9 +175,6 @@ arch-chroot -- "$mount_dir" /bin/bash -s <<-'EOS'
159175
160176
EOF
161177
162-
echo '-- Enabling other services.'
163-
systemctl --quiet enable [email protected]
164-
165178
echo '-- Configuring initcpio.'
166179
gawk -i assert -i inplace '
167180
/^MODULES=/ { $0 = "MODULES=(virtio_pci virtio_scsi sd_mod ext4)"; ++f1 }

0 commit comments

Comments
 (0)