harvester-installer icon indicating copy to clipboard operation
harvester-installer copied to clipboard

fix: preserve /var/lib/NetworkManager from initramfs [DNM]

Open tserong opened this issue 6 months ago • 0 comments

This is an experiment only. It's slighly problematic in that because it's done so early, the /var/lib/NetworkManager files copied from the initramfs actually end up in the installed system's root filesystem where strictly we really only want this in the installation environment. But, it's good enough for a test. What I observed when doing this, while looking at the DHCP server logs, is that without this change, I see:

In initramfs:

Oct 16 04:54:14 pxe-server dhcpd[4809]: DHCPDISCOVER from 02:00:00:0d:62:e2 via eth1 Oct 16 04:54:14 pxe-server dhcpd[4809]: DHCPOFFER on 192.168.0.30 to 02:00:00:0d:62:e2 via eth1 Oct 16 04:54:16 pxe-server dhcpd[4809]: DHCPREQUEST for 192.168.0.30 (192.168.0.254) from 02:00:00:0d:62:e2 via eth1 Oct 16 04:54:16 pxe-server dhcpd[4809]: DHCPACK on 192.168.0.30 to 02:00:00:0d:62:e2 via eth1

After switch root:

Oct 16 04:54:23 pxe-server dhcpd[4809]: DHCPDISCOVER from 02:00:00:0d:62:e2 via eth1 Oct 16 04:54:23 pxe-server dhcpd[4809]: DHCPOFFER on 192.168.0.30 to 02:00:00:0d:62:e2 via eth1 Oct 16 04:54:24 pxe-server dhcpd[4809]: DHCPREQUEST for 192.168.0.30 (192.168.0.254) from 02:00:00:0d:62:e2 via eth1 Oct 16 04:54:24 pxe-server dhcpd[4809]: DHCPACK on 192.168.0.30 to 02:00:00:0d:62:e2 via eth1

So there's a full DHCP discovery that happens again after the interface is restarted.

With this change applied, I see the initial discovery in the initramfs:

Oct 16 07:50:20 pxe-server dhcpd[4837]: DHCPDISCOVER from 02:00:00:0d:62:e2 via eth1 Oct 16 07:50:20 pxe-server dhcpd[4837]: DHCPOFFER on 192.168.0.30 to 02:00:00:0d:62:e2 via eth1 Oct 16 07:50:21 pxe-server dhcpd[4837]: DHCPREQUEST for 192.168.0.30 (192.168.0.254) from 02:00:00:0d:62:e2 via eth1 Oct 16 07:50:21 pxe-server dhcpd[4837]: DHCPACK on 192.168.0.30 to 02:00:00:0d:62:e2 via eth1

...but then after switch root, even though the interface is still restarted, I only get this:

Oct 16 07:50:29 pxe-server dhcpd[4837]: DHCPREQUEST for 192.168.0.30 from 02:00:00:0d:62:e2 via eth1 Oct 16 07:50:29 pxe-server dhcpd[4837]: DHCPACK on 192.168.0.30 to 02:00:00:0d:62:e2 via eth1

...so it's not doing the full discovery. I wonder if this will be enough to fix the problem?

tserong avatar Oct 16 '25 08:10 tserong