Coiby Xu <coxu(a)redhat.com> 于2022年4月2日周六 11:24写道:
Currently, kexec-tools parses legacy ifcfg-* configuration files or
NetworkManager .nmconnection connection profiles to build up dracut
command line parameters like ip=. Then dracut parses these parameters and
runs nm-initrd-generator to generate NetworkManager connection profiles.
Taking a bonding network as an example, nm-initrd-generator generates two
connections as follows,
$ /usr/libexec/nm-initrd-generator -s -- bootdev=mybond0 rd.neednet kdumpnic=mybond0
bond=mybond0:kdump-eth0
*** Connection 'mybond0' ***
[connection]
id=mybond0
uuid=ed87d02b-dd44-4f0e-8b11-37db7e89bb48
type=bond
autoconnect-retries=1
interface-name=mybond0
multi-connect=1
permissions=
[bond]
mode=balance-rr
[ipv4]
dhcp-timeout=90
dns-search=
method=auto
[ipv6]
addr-gen-mode=eui64
dhcp-timeout=90
dns-search=
method=auto
[proxy]
*** Connection 'kdump-eth0' ***
[connection]
id=kdump-eth0
uuid=ed6a7448-b5f8-4f8a-b718-3e24ea1c924b
type=ethernet
autoconnect-retries=1
interface-name=kdump-eth0
master=ed87d02b-dd44-4f0e-8b11-37db7e89bb48
multi-connect=1
permissions=
slave-type=bond
wait-device-timeout=60000
[ethernet]
mac-address-blacklist=
Later dracut starts NetworkManager to activate these profiles to bring up
the network connections. This way of seting up kdump network is tedious,
error-prone and unncessary. A better way is to directly copy the needed
connection profiles to initrd. A potential benefit of this approach for
the users is they can simply edit the connection profile directly like
changing ipv4.dhcp-timeout instead of being forced to use the hard-coded
value enforced by nm-initrd-generator.
This patch set reuses NetworkManager connection profiles to set up kdump
network. It also reduces the memory consumption of network drivers and
fix other issues at the same time. Here are the bug list that addressed by
this patch set on bugzilla,
- Bug 1962421 - [RHEL-9]"eth0: Failed to rename network interface 3 from
'eth0' to 'kdump-eth0': File exists"
- Bug 2064708 - kdump: mkdumprd: failed to make kdump initrd for bridge network on z15
z/vm
- bugs related to OOM caused by network driver
Hi Coiby,
This looks great, but one thing I don't understand, how is this going
to help reduce the memory consumption? Shoudn't network drivers be the
same, no matter how they are loaded?
> - Bug 1950282 - shutdown those unneeded network interfaces to save
memory for kdump
> - Bug 1958587 - the kdump initramfs includes unnecessary NIC
drivers for SSH/NFS dumping target
> - Bug 1890021 - be2net is using too much memory during kdump
> - Bug 1662202 - [RHEL-8.1] aarch64: hpe-apache crashkernel OOM when
dump to network targe
>
> Coiby Xu (13):
> add function to copy NetworkManage connection profile to the initramfs
> support legacy ifcfg
> ask NM to wait the network device to be available
> don't let NetworkManager manage unneeded network interfaces
> stop dracut 35network-manager from running nm-initrd-generator
> set up kdump network bridge by directly copying NM connection profile
> to initrd
> set up kdump bonding network by directly copying NM connection profile
> to initrd
> fix error for vlan over team network interface
> set up kdump vlan network by directly copying NM connection profile to
> initrd
> set up kdump teaming network by directly copying NM connection profile
> to initrd
> clean up unneeded code after copying .nmconnection to initrd
> address the cases where a NIC has a different name in kdump kernel
> simplify setup_znet by copying connection profile to initrd
>
> dracut-kdump.sh | 18 +-
> dracut-module-setup.sh | 385 ++++++++++++++---------------------------
> 2 files changed, 133 insertions(+), 270 deletions(-)
>
> --
> 2.34.1
> _______________________________________________
> kexec mailing list -- kexec(a)lists.fedoraproject.org
> To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
> Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org
> Do not reply to spam on the list, report it:
https://pagure.io/fedora-infrastructure