Benjamin Drung 3d29bf9098 Configure /etc/resolv.conf and persist hostname
live-boot generates `/etc/hostname`, `/etc/hosts`, and
`/etc/resolv.conf` in `do_netsetup` from `9990-networking.sh`.
kdump-tools needs similar code for generating a self-contained initrd
for dumping a crashed kernel via network.

Ubuntu carries a patch for initramfs-tools that adds
`netinfo_to_resolv_conf` to configure `/etc/resolv.conf` which is more
complex than the code from live-boot.

To prevent code duplication, implement `netinfo_to_resolv_conf` and
`persist_hostname` as helper functions and let `configure_networking`
call these functions.

Let `netinfo_to_resolv_conf` support multiple `/run/net-<device>` style
files to allow Ubuntu to reuse this code.

Signed-off-by: Benjamin Drung <bdrung@debian.org>
2022-10-21 10:55:43 +02:00
..