[PATCH] dracut-module-setup.sh: eliminate redundant kdump_get_mac_addr call
by Ziyue Yang
This commit eliminates a redundant kdump_get_mac_addr call in
kdump_setup_netdev.
Signed-off-by: Ziyue Yang <ziyang(a)redhat.com>
---
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 ae13337..1830a91 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -310,7 +310,7 @@ kdump_setup_netdev() {
elif kdump_is_vlan "$_netdev"; then
kdump_setup_vlan "$_netdev"
else
- _ifname_opts=" ifname=$(kdump_setup_ifname $_netdev):$(kdump_get_mac_addr $_netdev)"
+ _ifname_opts=" ifname=$(kdump_setup_ifname $_netdev):$_netmac"
echo "$_ifname_opts" >> $_ip_conf
fi
--
2.9.3
6 years, 2 months
[PATCH v2 0/9] apply "--hostonly-cmdline" and "--no-hostonly-default-device"
by Xunlei Pang
Dracut has "--hostonly-cmdline" which can generate cmdlines(if any)
regarding the dump target, it's an existing way for us to use to
simplify the code. E.g. We can remove generate_lvm_cmdlines() if we
use "--hostonly-cmdline"(see PATCH 4).
But "--hostonly-cmdline" has other issues(e.g. BZ1451717), it adds
needless devices for kdump like root device. These issues can be
solved with the help of dracut "--no-hostonly-default-device", we
can have only one device being recognized (dump target) in most
cases under kdump.
This patch series applies dracut's "--hostonly-cmdline" together with
"--no-hostonly-default-device", and removes some old code accordingly.
Please "man dracut.cmdline" for "--hostonly-cmdline", "--no-hostonly-default-device"
details.
See "--no-hostonly-default-device" patches:
https://github.com/dracutdevs/dracut/pull/269
Also see the following former threads for some background:
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.o...
Has passed tests about LUKS, iscsi, lvm, nfs, etc.
Xunlei Pang (9):
Revert "mkdumprd: omit dracut modules in case of network dumping"
Revert "mkdumprd: omit dracut modules in case of no dm target"
Revert "mkdumprd: omit crypt when there is no crypt kdump target"
Revert "kdumpctl: use generated rd.lvm.lv=X"
kdumpctl: move is_fadump_capable() to kdump-lib.sh
Change dump_to_rootfs to use "--mount" instead of "root=X"
mkdumprd: apply dracut "--hostonly-cmdline" and
"--no-hostonly-default-device"
kdumpctl: remove some cmdline inheritage from 1st kernel
module-setup: remove software iscsi cmdline generated by dracut
dracut-module-setup.sh | 5 +++++
kdump-lib.sh | 30 +++++++++----------------
kdumpctl | 61 ++++++++------------------------------------------
kexec-tools.spec | 2 +-
mkdumprd | 61 +++++++-------------------------------------------
5 files changed, 34 insertions(+), 125 deletions(-)
--
1.8.3.1
6 years, 2 months
[PATCH v8 0/4] support dump ssh via link local ipv6 address
by Ziyue Yang
When dumping to ssh via link local ipv6 address, the ssh
parameter in kdump.conf is supposed to have the form like:
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
However, there are 4 problems in enabling link local ipv6:
1) The get_remote_host function in kdump-lib.sh currently
doesn't remove the network interface in the ipv6 address,
causing the ip command in kdump_install_net function to fail,
leading to a "Bad kdump location" message.
2) The logic in kdump_install_net will find the network
interface to use by "ip route" command, which might be
different from what user specified in kdump.conf in link
local ipv6 cases.
3) The kdump_setup_ifname function in dracut-module-setup.sh
would add 'kdump-' prefix to network interfaces with name like
'eth*', causing ssh target specified in kdump.conf invalid
while dumping process.
4) ssh target with 'kdump-' prefixed interface name is not
in known_hosts while dumping, leading to ssh connection failure.
This patch series handles the problems above.
Ziyue Yang (4):
dracut-module-setup.sh: change route finding logic in link local ipv6
cases
dracut-module-setup.sh: add 'kdump-' prefix in kdump.conf for link
local ipv6
dracut-kdump.sh: support 'kdump-' prefixed interfaces for link local
ipv6
kdump.conf: add documents for link local ipv6 in ssh
dracut-kdump.sh | 10 +++++++++-
dracut-module-setup.sh | 46 +++++++++++++++++++++++++++++++++++++++++-----
kdump-lib.sh | 13 +++++++++++++
kdump.conf | 5 ++++-
kdump.conf.5 | 7 ++++++-
5 files changed, 73 insertions(+), 8 deletions(-)
--
2.9.3
6 years, 3 months
[PATCH] mkdumprd: fix patterns to drop noauto mount option
by Dave Young
mkdumprd removes "noauto" mount option, but it also mistakenly removes
"noauto" within a string. For example ext4 has mount option noauto_da_alloc
mkdumprd will replace it with _da_alloc.
Use '\b' to match a whole word of "noauto" to fix it.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
mkdumprd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- kexec-tools.orig/mkdumprd
+++ kexec-tools/mkdumprd
@@ -101,7 +101,7 @@ to_mount() {
[ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
# with 'noauto' in fstab nfs and non-root disk mount will fail in 2nd
# kernel, filter it out here.
- _options=$(echo $_options | sed 's/noauto//')
+ _options=$(echo $_options | sed 's/\bnoauto\b//')
_options=${_options/#ro/rw} #mount fs target as rw in 2nd kernel
_mntopts="$_target $_fstype $_options"
6 years, 3 months
[PATCH] fadump: rebuild default initrd with dump capture capability
by Hari Bathini
As default initrd is used for booting fadump capture kernel, it must be
rebuilt with dump capture capability when dump mode is fadump. Check if
default initrd is already fadump capable and rebuild, if necessary.
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
---
* Using `lsinitrd -f` over `lsinitrd -m`, to find if kdumpbase module
is included, as it is observed to take only about half the time.
kdumpctl | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index b7a3105..f69a5f0 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -6,6 +6,7 @@ KDUMP_COMMANDLINE=""
KEXEC_ARGS=""
KDUMP_CONFIG_FILE="/etc/kdump.conf"
MKDUMPRD="/sbin/mkdumprd -f"
+DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
SAVE_PATH=/var/crash
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
@@ -693,6 +694,7 @@ check_system_modified()
check_rebuild()
{
local extra_modules
+ local capture_capable_initrd="1"
local _force_rebuild force_rebuild="0"
local _force_no_rebuild force_no_rebuild="0"
local ret system_modified="0"
@@ -747,6 +749,12 @@ check_rebuild()
#since last build of the image file
if [ -f $TARGET_INITRD ]; then
image_time=`stat -c "%Y" $TARGET_INITRD 2>/dev/null`
+
+ #in case of fadump mode, check whether the default/target
+ #initrd is already built with dump capture capability
+ if [ "$DEFAULT_DUMP_MODE" == "fadump" ]; then
+ capture_capable_initrd=`lsinitrd -f $DRACUT_MODULES_FILE $TARGET_INITRD | grep ^kdumpbase$ | wc -l`
+ fi
fi
check_system_modified
@@ -761,6 +769,8 @@ check_rebuild()
if [ $image_time -eq 0 ]; then
echo -n "No kdump initial ramdisk found."; echo
+ elif [ "$capture_capable_initrd" == "0" ]; then
+ echo -n "Rebuild $TARGET_INITRD with dump capture support"; echo
elif [ "$force_rebuild" != "0" ]; then
echo -n "Force rebuild $TARGET_INITRD"; echo
elif [ "$system_modified" != "0" ]; then
6 years, 3 months
[PATCH v2] fadump: rebuild default initrd with dump capture
capability
by Hari Bathini
As default initrd is used for booting fadump capture kernel, it must be
rebuilt with dump capture capability when dump mode is fadump. Check if
default initrd is already fadump capable and rebuild, if necessary.
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
Reviewed-by: Xunlei Pang <xlpang(a)redhat.com>
---
Changes in V2:
* Using $(..) instead of the deprecated `..`
kdumpctl | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index b7a3105..2931858 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -6,6 +6,7 @@ KDUMP_COMMANDLINE=""
KEXEC_ARGS=""
KDUMP_CONFIG_FILE="/etc/kdump.conf"
MKDUMPRD="/sbin/mkdumprd -f"
+DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
SAVE_PATH=/var/crash
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
@@ -693,6 +694,7 @@ check_system_modified()
check_rebuild()
{
local extra_modules
+ local capture_capable_initrd="1"
local _force_rebuild force_rebuild="0"
local _force_no_rebuild force_no_rebuild="0"
local ret system_modified="0"
@@ -747,6 +749,12 @@ check_rebuild()
#since last build of the image file
if [ -f $TARGET_INITRD ]; then
image_time=`stat -c "%Y" $TARGET_INITRD 2>/dev/null`
+
+ #in case of fadump mode, check whether the default/target
+ #initrd is already built with dump capture capability
+ if [ "$DEFAULT_DUMP_MODE" == "fadump" ]; then
+ capture_capable_initrd=$(lsinitrd -f $DRACUT_MODULES_FILE $TARGET_INITRD | grep ^kdumpbase$ | wc -l)
+ fi
fi
check_system_modified
@@ -761,6 +769,8 @@ check_rebuild()
if [ $image_time -eq 0 ]; then
echo -n "No kdump initial ramdisk found."; echo
+ elif [ "$capture_capable_initrd" == "0" ]; then
+ echo -n "Rebuild $TARGET_INITRD with dump capture support"; echo
elif [ "$force_rebuild" != "0" ]; then
echo -n "Force rebuild $TARGET_INITRD"; echo
elif [ "$system_modified" != "0" ]; then
6 years, 3 months
[PATCH RESEND 0/8] apply "--hostonly-cmdline" and "--no-hostonly-default-device"
by Xunlei Pang
With the help of dracut "--no-hostonly-default-device", we can have only
one device being recognized (dump target) in most cases under kdump.
Now that we use a different(simpler and better) approach, it's time to
revert the old approach(Patch 1~4).
This patch series has passed my tests about LUKS, iscsi, lvm, nfs, etc.
Xunlei Pang (8):
Revert "mkdumprd: omit dracut modules in case of network dumping"
Revert "mkdumprd: omit dracut modules in case of no dm target"
Revert "mkdumprd: omit crypt when there is no crypt kdump target"
Revert "kdumpctl: use generated rd.lvm.lv=X"
kdumpctl: move is_fadump_capable() to kdump-lib.sh
mkdumprd: apply dracut "--hostonly-cmdline" and
"--no-hostonly-default-device"
kdumpctl: remove some cmdline inheritage from 1st kernel
module-setup: remove software iscsi cmdline generated by dracut
dracut-module-setup.sh | 5 +++++
kdump-lib.sh | 25 +++++++++++----------
kdumpctl | 56 +++++++---------------------------------------
mkdumprd | 60 +++++++-------------------------------------------
4 files changed, 34 insertions(+), 112 deletions(-)
--
1.8.3.1
6 years, 3 months
[PATCH 0/8] apply "--hostonly-cmdline" and "--no-hostonly-default-device"
by Xunlei Pang
With the help of dracut "--no-hostonly-default-device", we can have only
one device being recognized (dump target) in most cases under kdump.
Now that we use a different(and simpler) approach, it's time to revert
the old approach(Patch 1~4).
Xunlei Pang (8):
Revert "mkdumprd: omit dracut modules in case of network dumping"
Revert "mkdumprd: omit dracut modules in case of no dm target"
Revert "mkdumprd: omit crypt when there is no crypt kdump target"
Revert "kdumpctl: use generated rd.lvm.lv=X"
kdumpctl: move is_fadump_capable() to kdump-lib.sh
mkdumprd: apply dracut "--hostonly-cmdline" and
"--no-hostonly-default-device"
kdumpctl: remove some cmdline inheritage from 1st kernel
module-setup: remove software iscsi cmdline generated by dracut
dracut-module-setup.sh | 5 +++++
kdump-lib.sh | 25 +++++++++++----------
kdumpctl | 56 +++++++---------------------------------------
mkdumprd | 60 +++++++-------------------------------------------
4 files changed, 34 insertions(+), 112 deletions(-)
--
1.8.3.1
6 years, 3 months
[PATCH v2] kdumpctl: Error out in case there are white spaces before an option name
by Bhupesh Sharma
Resolves: BZ1484945
https://bugzilla.redhat.com/show_bug.cgi?id=1484945
Currently the kdumpctl script doesn't handle
whitespaces (including TABs) which might be there before
an option name in the kdump.conf
This patch addresses this issue, by ensuring that the
kdumpctl errors out in case it finds any stray space(s)
or tab(s) before a option name.
Reported-by: Kenneth D'souza <kdsouza(a)redhat.com>
Signed-off-by: Bhupesh Sharma <bhsharma(a)redhat.com>
---
Changes since v1:
-----------------
- Addressed review comments from Dave:
- Removed redundant documentation from man page.
- Used [:blank:] regex instead of [:space:] to capture
leading whitespaces in front of the option names.
kdumpctl | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index b7a3105026eb..98eb89b919ed 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -406,6 +406,13 @@ check_config()
return 1
}
+ # Check if we have any leading spaces (or tabs) before the
+ # variable name in the kdump conf file
+ if grep '^[[:blank:]]' $KDUMP_CONFIG_FILE; then
+ echo "No whitespaces are allowed before a kdump option name."
+ return 1
+ fi
+
while read config_opt config_val; do
case "$config_opt" in
\#* | "")
--
2.7.4
6 years, 3 months
[PATCH] kdumpctl: Error out in case there are white spaces before an option name
by Bhupesh Sharma
Resolves: BZ1484945
https://bugzilla.redhat.com/show_bug.cgi?id=1484945
Currently the kdumpctl script doesn't handle
whitespaces (including TABs) which might be there before
an option name in the kdump.conf
This patch addresses this issue, by ensuring that the
kdumpctl errors out in case it finds any stray whitespaces
before a option name.
While at it, we also add a relevant note in the
kdump.conf man page to explain this error case.
Reported-by: Kenneth Dsouzak <kdsouza(a)redhat.com>
Signed-off-by: Bhupesh Sharma <bhsharma(a)redhat.com>
---
kdump.conf.5 | 4 ++++
kdumpctl | 9 ++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/kdump.conf.5 b/kdump.conf.5
index 11b1fad559b4..a68e6e8f426a 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -339,6 +339,10 @@ scp /proc/vmcore <user@host>:path/vmcore
examples for other options please see
.I /etc/kdump.conf
+.PP
+.B
+NOTE: No whitespaces are allowed before a kdump OPTION name.
+
.SH SEE ALSO
kexec(8) mkdumprd(8) dracut.cmdline(7)
diff --git a/kdumpctl b/kdumpctl
index b7a3105026eb..b4340840453b 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -406,6 +406,13 @@ check_config()
return 1
}
+ # Check if we have any leading spaces before the
+ # variable name in the kdump conf file
+ if grep '^[[:space:]]' $KDUMP_CONFIG_FILE; then
+ echo "No whitespaces are allowed before a kdump OPTION name. Refer to kdump.conf manpage for details"
+ return 1
+ fi
+
while read config_opt config_val; do
case "$config_opt" in
\#* | "")
@@ -432,7 +439,7 @@ check_config()
check_default_config || return 1
check_fence_kdump_config || return 1
-
+
return 0
}
--
2.7.4
6 years, 3 months