Skip to content

Comments

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

Draft
tserong wants to merge 1 commit intoharvester:masterfrom
tserong:wip-preserve-var-lib-networkmanager-experiment
Draft

fix: preserve /var/lib/NetworkManager from initramfs [DNM]#1166
tserong wants to merge 1 commit intoharvester:masterfrom
tserong:wip-preserve-var-lib-networkmanager-experiment

Conversation

@tserong
Copy link
Member

@tserong tserong commented Oct 16, 2025

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?

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?

Signed-off-by: Tim Serong <tserong@suse.com>
@tserong tserong marked this pull request as draft October 16, 2025 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant