mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-13 11:09:33 +00:00

commitc86cfb8bbd
dropped allow-hotplug from the primary interfaces file completely on write, but that breaks setups that come from plain Debian. Instead, as stop-gap measurement, transform "allow-hotplug" to auto in the PVE controlled config. That avoids conflict and improves installing PVE on top of plain Debian, as the interface still comes up after the first reboot. But it is not ideal auto is not the same as hotplug, so we need to also track that difference in the future, but that needs some adaptions in the API too (change autostart from boolean to string+enum or so= Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> (cherry picked from commit0dc7fd7b50
) Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
26 lines
658 B
Perl
26 lines
658 B
Perl
my $active_ifaces = ['lo', 'ens18', 'ens'];
|
|
my $proc_net = load('proc_net_dev');
|
|
$proc_net =~ s/eth0/ens18/;
|
|
|
|
my $wanted = load('base-allow-hotplug');
|
|
|
|
# parse the config
|
|
r($wanted, $proc_net, $active_ifaces);
|
|
|
|
$wanted =~ s/allow-hotplug ens18/auto ens18/; # FIXME: hack! rather we need to keep allow-hotplug!
|
|
|
|
expect $wanted;
|
|
|
|
# idempotency (save, re-parse, and re-check)
|
|
r(w(), $proc_net, $active_ifaces);
|
|
expect $wanted;
|
|
|
|
# parse one with both, "auto" and "allow-hotplug"
|
|
my $bad = load('base-auto-allow-hotplug');
|
|
r($bad, $proc_net, $active_ifaces);
|
|
|
|
# should drop the first occuring one of the conflicting options ("auto" currently)
|
|
expect $wanted;
|
|
|
|
1;
|