Merge pull request #2 from digineo/networkd

Use net.ifnames=0 and networkd
This commit is contained in:
Andrey Prokopenko
2020-03-09 19:13:24 +01:00
committed by GitHub
2 changed files with 24 additions and 25 deletions

View File

@@ -602,20 +602,17 @@ CONF
ip6addr_prefix=$(ip -6 a s | grep -E "inet6.+global" | sed -nE 's/.+inet6\s(([0-9a-z]{1,4}:){4,4}).+/\1/p')
mkdir -p /mnt/etc/network/
cat <<CONF > /mnt/etc/systemd/network/10-eth0.network
[Match]
Name=eth0
cat > "/mnt/etc/network/interfaces" <<CONF
auto lo
iface lo inet loopback
iface lo inet6 loopback
auto ens3
iface ens3 inet dhcp
iface ens3 inet6 static
address ${ip6addr_prefix}:1/64
gateway fe80::1
[Network]
DHCP=ipv4
Address=${ip6addr_prefix}:1/64
Gateway=fe80::1
CONF
chroot_execute "systemctl enable systemd-networkd.service"
cp /etc/resolv.conf $c_zfs_mount_dir/etc/resolv.conf
@@ -749,7 +746,8 @@ chroot_execute "DEBIAN_FRONTEND=noninteractive apt install --yes grub-pc"
chroot_execute "grub-install ${v_selected_disks[0]}"
chroot_execute "sed -i 's/#GRUB_TERMINAL=console/GRUB_TERMINAL=console/g' /etc/default/grub"
chroot_execute "sed -i 's|GRUB_CMDLINE_LINUX=\"\"|GRUB_CMDLINE_LINUX=\"root=ZFS=rpool/ROOT/ubuntu\"|g' /etc/default/grub"
chroot_execute "sed -i 's|GRUB_CMDLINE_LINUX_DEFAULT=.*|GRUB_CMDLINE_LINUX_DEFAULT=\"net.ifnames=0\"|' /etc/default/grub"
chroot_execute "sed -i 's|GRUB_CMDLINE_LINUX=\"\"|GRUB_CMDLINE_LINUX=\"root=ZFS=rpool/ROOT/ubuntu\"|g' /etc/default/grub"
chroot_execute "sed -i 's/quiet//g' /etc/default/grub"
chroot_execute "sed -i 's/splash//g' /etc/default/grub"