mirror of
https://salsa.debian.org/kernel-team/initramfs-tools.git
synced 2026-01-27 01:44:25 +00:00
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>