Package: vmdebootstrap Version: 1.5-1+terceiro Severity: important Tags: patch
Hi, building a stretch image results in systemd-networkd enabled for interfaces matching en*, and DHCP works, but DNS is not configured. You end up with /etc/resolv.conf copied from the host machine when the image was built. To have resolv.conf properly setup when using systemd-networkd, you need to also use systemd-resolved. The attached patch does just that. I have tested locally, and the image built gets proper a proper DNS setup, and everything works. -- System Information: Debian Release: stretch/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages vmdebootstrap depends on: ii debootstrap 1.0.81 ii extlinux 3:6.03+dfsg-14 ii kpartx 0.6.1-3 ii libjs-sphinxdoc 1.4.5-1 ii mbr 1.1.11-5+b1 ii parted 3.2-15 ii python-cliapp 1.20160316-1 ii python-distro-info 0.14 ii python2.7 2.7.12-1 pn python:any <none> ii qemu-utils 1:2.6+dfsg-3 Versions of packages vmdebootstrap recommends: ii grub2-common 2.02~beta2-36 ii python-guestfs 1:1.32.6-1 ii qemu-system 1:2.6+dfsg-3 ii qemu-user-static 1:2.6+dfsg-3 ii squashfs-tools 1:4.3-3 Versions of packages vmdebootstrap suggests: pn cmdtest <none> ii pandoc 1.17.0.3~dfsg-2+b1 pn u-boot:armhf <none> -- no debconf information -- Antonio Terceiro <terce...@debian.org>
Description: Enable systemd-resolved together with systemd-networkd Without systemctl-resolved, DNS servers informed by DHCP and received by systemd-networkd will not be used to update /etc/resolv.conf Author: Antonio Terceiro <terce...@debian.org> --- vmdebootstrap-1.5.orig/vmdebootstrap/network.py +++ vmdebootstrap-1.5/vmdebootstrap/network.py @@ -101,3 +101,8 @@ class Networking(Base): eth.write('\n[Network]\n') eth.write('DHCP=yes\n') runcmd(['chroot', rootdir, 'systemctl', 'enable', 'systemd-networkd']) + + self.message('Enabling systemctl-resolved for DNS') + runcmd(['chroot', rootdir, 'systemctl', 'enable', 'systemd-resolved']) + runcmd(['chroot', rootdir, 'ln', '-sfT', + '/run/systemd/resolve/resolv.conf', '/etc/resolv.conf'])
signature.asc
Description: PGP signature