Allow to generate Netplan configuration (using systemd-networkd or NetworkManager backend)
This MR enables netcfg to generate Netplan configuration in /etc/netplan/, besides ifupdown and NetworkManager config.
If netplan-generator is detected to be installed on the target system, it will be used as the primary means of network configuration and we're creating a Netplan configuration in /etc/netplan/00-installer-config.yaml. By default, systemd-networkd is used as the Netplan backend. Should network-manager be detected to be installed as well, it will be made the default renderer.
The configuration is copied to the target system and rendered to systemd-networkd/''NetworkManager'' configuration by the netplan-generator (a systemd generator, written in C). And systemd-networkd/NetworkManager will bring up the networking for us on reboot.
See demo of this merge request in a recent blog post of mine: Creating a Netplan enabled system through Debian-Installer
(See my Netplan session at DebConf23 for more details: A declarative approach to Linux networking with Netplan).
Future work
- Consider deprecating WEP "secured" wireless networks in d-i
- Consider using libnetplan's C API, instead of writing the YAML files directly.
- Find consensus about bumping
netplan-generatortoPriority: important, in order to make it part of the base installation - Investigate enablement and bring up of related systemd-networkd services, such as systemd-resovled, which should go hand-in-hand.