please fall back to 8.8.8.8 for DNS server
As reported in FS#63174 by @patrakov.
I am currently working on integration of static IP support for booting from https://netboot.xyz . That is, the user is supposed to boot their PC from their ISO which contains iPXE. This already works fine if they have DHCP, but not if they press "m" and configure a static IP. I was going to fix that, but stumbled upon an incomplete implementation of IP configuration in the archiso_pxe_common hook.
The problem is that there is no way to pass a DNS server when configuring a static IP via ip=... parameter (busybox ipconfig just doesn't support it), and as a result the resolv.conf file isn't created at all.
There is some code in the archiso_pxe_common hook to deal with ip=... parameters other than ip=dhcp, so I assume it is supposed to be useful. But it isn't, because there is no way to specify the DNS server together with the static IP.
Please provide a kernel command line option to set the DNS server for this case, or (better?) just unconditionally fall back to 8.8.8.8 if not doing DHCP.
Steps to reproduce in QEMU without netboot.xyz:
mirror=http://mirror.rackspace.com/archlinux
release=2019.07.01
wget ${mirror}/iso/${release}/arch/boot/x86_64/vmlinuz
wget ${mirror}/iso/${release}/arch/boot/x86_64/archiso.img
# The exercise here is to pretend that there is no DHCP server and still boot successfully.
# There is no possible value of ipparam that does it. Tried:
ipparam="10.0.2.42::10.0.2.2:255.255.255.0 BOOTIF=01-52:54:00:12:34:56" # nowhere to specify the DNS server
ipparam="10.0.2.42::10.0.2.2:255.255.255.0::eth0:none:8.8.8.8" # as documented in nfsroot.txt, but ipconfig chokes on the DNS server specification
qemu-system-x86_64 -m 2048 -enable-kvm -cpu host -kernel vmlinuz -initrd archiso.img \
-append "archiso_http_srv=${mirror}/iso/${release}/ archisobasedir=arch verify=y ip=${ipparam} net.ifnames=0 systemd.mask=dhcpcd@eth0.service"