From fef93a08a81784549efba75816a121ee3b180d46 Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Tue, 16 Jul 2024 16:25:28 +0800 Subject: [PATCH] Use the correct regex to match eth.* Upstream: RHEL-only Resolves: https://issues.redhat.com/browse/RHEL-47130 kdump prefixes kdump- to a name of a network interface when its name matches eth.*. However, the regex is incorrect and matches names like baremetal*. As a consequence, kdump failed with the following message, [ 305.950223] kdump.sh[790]: Device "kdump-baremetal" does not exist. [ 305.992018] kdump[795]: wrong kdumpnic: kdump-baremetal [ 306.029386] kdump[797]: get_host_ip exited with non-zero status! [ 306.038085] systemd[1]: kdump-capture.service: Main process exited, code=exited, status=1/FAILURE [ 306.050082] systemd[1]: kdump-capture.service: Failed with result 'exit-code'. Fixes: ba7660f ("dracut-module-setup: NIC renamed with prefix "kdump-" for native ethX") Reported-by: Dima Shtranvasser Suggeste-by: Dima Shtranvasser Signed-off-by: Coiby Xu --- dracut-module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 97be76f..c425816 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -326,7 +326,7 @@ kdump_setup_ifname() { # fadump to kdump. Skip prefixing 'kdump-' in this case as adding # another prefix may truncate the ifname. Since an ifname with # 'kdump-' is already persistent, this should be fine. - if [[ $1 =~ eth* ]] && [[ ! $1 =~ ^kdump-* ]]; then + if [[ $1 =~ ^eth.* ]] && [[ ! $1 =~ ^kdump-* ]]; then _ifname="kdump-$1" else _ifname="$1"