From ba0aa24316918d7fcc40f22bd9ac45762c4eead1 Mon Sep 17 00:00:00 2001 From: Dave Young Date: Wed, 22 Feb 2012 11:16:09 +0800 Subject: [PATCH 01/11] Add ssh dump support Add ssh dump support changes including below items: 1. sshkey option 2. sshkey propagate 3. fix a bug of _server ip calculation for dump target string 4. change the prefix of kdump hook from 93 to 01 to avoid dhclient and other cleanups happening before us 5. enable network with dracut cmdline rd.neednet=1 when there's network target config [v1 - v2]: Only check_ssh_target when there's ssh dump target in kdump config file [v2 -> v3] style fixes: trailing spaces and space before tab indent remove set -x simply check_ssh_target use awk to get sshkey option value change pivot hook order to 0000 Signed-off-by: Dave Young --- kdump.conf | 1 + kdump_dracut_modules/99kdumpbase/kdump.sh | 63 +++++++++----- .../99kdumpbase/module-setup.sh | 8 +- kdumpctl | 82 +++++++++++++------ kexec-tools.spec | 5 +- mkdumprd | 13 +++ 6 files changed, 124 insertions(+), 48 deletions(-) diff --git a/kdump.conf b/kdump.conf index 2d05493..0b8aea2 100644 --- a/kdump.conf +++ b/kdump.conf @@ -102,6 +102,7 @@ #ext4 UUID=03138356-5e61-4ab3-b58e-27507ac41937 #net my.server.com:/export/tmp #net user@my.server.com +#sshkey /root/.ssh/kdump_id_rsa #path /var/crash #core_collector makedumpfile -c #link_delay 60 diff --git a/kdump_dracut_modules/99kdumpbase/kdump.sh b/kdump_dracut_modules/99kdumpbase/kdump.sh index 78127ed..b2087dc 100755 --- a/kdump_dracut_modules/99kdumpbase/kdump.sh +++ b/kdump_dracut_modules/99kdumpbase/kdump.sh @@ -8,6 +8,15 @@ CORE_COLLECTOR="makedumpfile -d 31 -c" DEFAULT_ACTION="dump_rootfs" DATEDIR=`date +%d.%m.%y-%T` DUMP_INSTRUCTION="" +SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa" + +# we use manual setup nics in udev rules, +# so we need to test network is really ok +wait_for_net_ok() { + local ip=$(getarg ip) + local iface=`echo $ip|cut -d':' -f1` + return $(wait_for_route_ok $iface) +} do_default_action() { @@ -96,8 +105,8 @@ dump_nfs() dump_ssh() { - ssh -q -o BatchMode=yes -o StrictHostKeyChecking=yes $1 mkdir -p $KDUMP_PATH/$DATEDIR || return 1 - scp -q -o BatchMode=yes -o StrictHostKeyChecking=yes /proc/vmcore "$1:$KDUMP_PATH/$DATEDIR" || return 1 + ssh -q -i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes $2 mkdir -p $KDUMP_PATH/$DATEDIR || return 1 + scp -q -i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes /proc/vmcore "$2:$KDUMP_PATH/$DATEDIR" || return 1 return 0 } @@ -105,26 +114,19 @@ read_kdump_conf() { local conf_file="/etc/kdump.conf" if [ -f "$conf_file" ]; then + # first get the necessary variables while read config_opt config_val; do - case "$config_opt" in - ext[234]|xfs|btrfs|minix) - add_dump_code "dump_localfs $config_val || do_default_action" - ;; - raw) - add_dump_code "dump_raw $config_val || do_default_action" - ;; - path) + case "$config_opt" in + path) KDUMP_PATH="$config_val" - ;; - core_collector) - CORE_COLLECTOR="$config_val" ;; - net) - if [[ "$config_val" =~ "@" ]]; then - add_dump_code "dump_ssh $config_val || do_default_action" - else - add_dump_code "dump_nfs $config_val || do_default_action" + core_collector) + CORE_COLLECTOR="$config_val" + ;; + sshkey) + if [ -f "$config_val" ]; then + SSH_KEY_LOCATION=$config_val fi ;; default) @@ -142,8 +144,29 @@ read_kdump_conf() DEFAULT_ACTION="poweroff -f" ;; esac - ;; - esac + ;; + esac + done < $conf_file + + # rescan for add code for dump target + while read config_opt config_val; + do + case "$config_opt" in + ext[234]|xfs|btrfs|minix) + add_dump_code "dump_localfs $config_val || do_default_action" + ;; + raw) + add_dump_code "dump_raw $config_val || do_default_action" + ;; + net) + wait_for_net_ok + if [[ "$config_val" =~ "@" ]]; then + add_dump_code "dump_ssh $SSH_KEY_LOCATION $config_val || do_default_action" + else + add_dump_code "dump_nfs $config_val || do_default_action" + fi + ;; + esac done < $conf_file fi } diff --git a/kdump_dracut_modules/99kdumpbase/module-setup.sh b/kdump_dracut_modules/99kdumpbase/module-setup.sh index 713f968..09b76f4 100755 --- a/kdump_dracut_modules/99kdumpbase/module-setup.sh +++ b/kdump_dracut_modules/99kdumpbase/module-setup.sh @@ -52,7 +52,7 @@ install() { ;; net) if strstr "$config_val" "@"; then - _server=$(echo $config_val | sed -e 's#.*@\(.*\):.*#\1#') + _server=`echo $config_val | sed 's/.*@//' | cut -d':' -f1` else _server=$(echo $config_val | sed -e 's#\(.*\):.*#\1#') fi @@ -68,7 +68,7 @@ install() { # we are on the same subnet _netdev=`echo $_netdev|awk '{print $3}'|head -n 1` fi - echo " ip=$_netdev:dhcp" > ${initdir}/etc/cmdline.d/40ip.conf + echo " ip=$_netdev:dhcp rd.neednet=1" > ${initdir}/etc/cmdline.d/40ip.conf if is_bridge "$_netdev"; then echo " bridge=$_netdev:$(cd /sys/class/net/$_netdev/brif/; echo *)" > ${initdir}/etc/cmdline.d/41bridge.conf elif is_bond "$_netdev"; then @@ -84,8 +84,8 @@ install() { inst "/bin/date" "/bin/date" inst "/bin/sync" "/bin/sync" + inst "/bin/cut" "/bin/cut" inst "/sbin/makedumpfile" "/sbin/makedumpfile" inst "/tmp/$$-kdump.conf" "/etc/kdump.conf" - inst_hook pre-pivot 93 "$moddir/kdump.sh" + inst_hook pre-pivot 0000 "$moddir/kdump.sh" } - diff --git a/kdumpctl b/kdumpctl index e37fd8d..ad5a488 100755 --- a/kdumpctl +++ b/kdumpctl @@ -10,6 +10,9 @@ KDUMP_COMMANDLINE="" KEXEC_ARGS="" KDUMP_CONFIG_FILE="/etc/kdump.conf" MKDUMPRD="/sbin/mkdumprd -d -f" +SAVE_PATH=/var/crash +SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa" +DUMP_TARGET="" LOGGER="/usr/bin/logger -p info -t kdump" @@ -171,8 +174,56 @@ function load_kdump() fi } +function check_ssh_config() +{ + while read config_opt config_val; do + case "$config_opt" in + sshkey) + if [ -f "$config_val" ]; then + # canonicalize the path + SSH_KEY_LOCATION=$(/usr/bin/readlink -m $config_val) + else + echo "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'" + fi + ;; + path) + SAVE_PATH=$config_val + ;; + net) + DUMP_TARGET=$config_val + ;; + *) + ;; + esac + done < $KDUMP_CONFIG_FILE + + #make sure they've configured kdump.conf for ssh dumps + local SSH_TARGET=`echo -n $DUMP_TARGET|sed '/.*@/p'` + if [ -z "$SSH_TARGET" ]; then + return 1 + fi + return 0 +} + +function check_ssh_target() +{ + ssh -q -i $SSH_KEY_LOCATION -o BatchMode=yes $DUMP_TARGET mkdir -p $SAVE_PATH + if [ $? -ne 0 ]; then + echo "Could not create $DUMP_TARGET:$SAVE_PATH, you probably need to run \"service kdump propagate\"" + exit $? + fi + return 0 +} + function propagate_ssh_key() { + check_ssh_config + if [ $? -ne 0 ]; then + echo "No ssh config specified in $KDUMP_CONFIG_FILE. Can't propagate" + $LOGGER "$errmsg, no ssh config specified in $KDUMP_CONFIG_FILE" + exit 1 + fi + #Check if selinux is on... must flip to permissive mode #for the moment to create key, then flip back... se_enforce=`/usr/sbin/sestatus | grep -c "^Current mode.*enforcing"` @@ -180,33 +231,15 @@ function propagate_ssh_key() /usr/sbin/setenforce 0 2>&1 > /dev/null fi - #Use dedicated key for kdump - if [ ! -d /root/.ssh ]; then - mkdir /root/.ssh - chmod 700 /root/.ssh - fi - if [ ! -e /root/.ssh/config ]; then - echo "IdentityFile ~/.ssh/kdump_id_rsa" >> /root/.ssh/config - elif [ `grep -c kdump_id_rsa /root/.ssh/config` -eq 0 ]; then - echo "IdentityFile ~/.ssh/kdump_id_rsa" >> /root/.ssh/config - fi - local KEYFILE=/root/.ssh/kdump_id_rsa.pub + local KEYFILE=$SSH_KEY_LOCATION local errmsg="Failed to propagate ssh key" - #make sure they've configured kdump.conf for ssh dumps - local SSH_TARGET=`awk '/^\ *net.*@.*$/ {print $0}' $KDUMP_CONFIG_FILE` - if [ -z "$SSH_TARGET" ]; then - echo "No ssh config specified in $KDUMP_CONFIG_FILE. Can't propagate" - $LOGGER "$errmsg, no ssh config specified in $KDUMP_CONFIG_FILE" - exit 1 - fi - #Check to see if we already created key, if not, create it. if [ -f $KEYFILE ]; then echo "Using existing keys..." else echo -n "Generating new ssh keys... " - /usr/bin/ssh-keygen -t rsa -f /root/.ssh/kdump_id_rsa -N "" 2>&1 > /dev/null + /usr/bin/ssh-keygen -t rsa -f $KEYFILE -N "" 2>&1 > /dev/null echo "done." fi @@ -216,11 +249,11 @@ function propagate_ssh_key() fi #now find the target ssh user and server to contact. - SSH_USER=`echo $SSH_TARGET | cut -d\ -f2 | cut -d@ -f1` - SSH_SERVER=`echo $SSH_TARGET | sed -e's/\(.*@\)\(.*$\)/\2/'` + SSH_USER=`echo $DUMP_TARGET | cut -d\ -f2 | cut -d@ -f1` + SSH_SERVER=`echo $DUMP_TARGET | sed -e's/\(.*@\)\(.*$\)/\2/'` #now send the found key to the found server - ssh-copy-id -i $KEYFILE $SSH_USER@$SSH_SERVER &>/dev/null + ssh-copy-id -i $KEYFILE $SSH_USER@$SSH_SERVER RET=$? if [ $RET == 0 ]; then echo $KEYFILE has been added to ~$SSH_USER/.ssh/authorized_keys on $SSH_SERVER @@ -262,6 +295,9 @@ function start() return 0 fi fi + + check_ssh_config && check_ssh_target + check_config if [ $? != 0 ]; then echo -n "Starting kdump:"; echo diff --git a/kexec-tools.spec b/kexec-tools.spec index 6937cf1..3e9ac56 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 2.0.3 -Release: 38%{?dist} +Release: 39%{?dist} License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component. @@ -287,6 +287,9 @@ done %changelog +* Wed Feb 22 2012 Dave Young - 2.0.2-39 +- Add ssh dump support, resolve bug 789253. + * Fri Jan 27 2012 Cong Wang - 2.0.2-38 - Pull the latest makedumpfile release, 1.4.2. diff --git a/mkdumprd b/mkdumprd index d7b71fd..384d0f9 100644 --- a/mkdumprd +++ b/mkdumprd @@ -9,6 +9,7 @@ export IN_KDUMP=1 conf_file="/etc/kdump.conf" +SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa" extra_modules="" dracut_args=("-m" "kdumpbase" "--add" "dash" "--add" "fstab-sys" "--add" "kernel-modules" "-c" "/dev/null" "-I" "/sbin/makedumpfile") @@ -28,6 +29,10 @@ add_dracut_mount() { add_dracut_arg "--mount" "$1" } +add_dracut_sshkey() { + add_dracut_arg "--sshkey" "$1" +} + while [ $# -gt 0 ]; do case $1 in -d) @@ -94,6 +99,13 @@ add_mount() { add_dracut_mount "$(to_mount "$(get_rootdev)")" if [ -n "$conf_file" ]; then + # firstly get right SSH_KEY_LOCATION + keyfile=$(awk '/sshkey/ {print $2}' $conf_file) + if [ -f "$keyfile" ]; then + # canonicalize the path + SSH_KEY_LOCATION=$(/usr/bin/readlink -m $keyfile) + fi + while read config_opt config_val; do case "$config_opt" in @@ -115,6 +127,7 @@ if [ -n "$conf_file" ]; then if strstr "$config_val" "@"; then add_dracut_module "ssh-client" + add_dracut_sshkey "$SSH_KEY_LOCATION" else add_dracut_module "nfs" add_mount "$config_val" From 6fdfc66acc6eba7fe1b94ffba4b67c737c7e599a Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Wed, 22 Feb 2012 14:33:53 +0800 Subject: [PATCH 02/11] Fixup sysytemd service file --- kdump.service | 4 ++-- kexec-tools.spec | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/kdump.service b/kdump.service index 0e1d103..07e97fa 100644 --- a/kdump.service +++ b/kdump.service @@ -8,5 +8,5 @@ ExecStart=/usr/bin/kdumpctl start ExecStop=/usr/bin/kdumpctl stop RemainAfterExit=yes - - +[Install] +WantedBy=multi-user.target diff --git a/kexec-tools.spec b/kexec-tools.spec index 3e9ac56..18551b7 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 2.0.3 -Release: 39%{?dist} +Release: 40%{?dist} License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component. @@ -123,7 +123,6 @@ make -C kexec-tools-po %install make install DESTDIR=$RPM_BUILD_ROOT -mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig mkdir -p -m755 $RPM_BUILD_ROOT%{_localstatedir}/crash mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man8/ @@ -131,7 +130,7 @@ mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man5/ mkdir -p -m755 $RPM_BUILD_ROOT%{_docdir} mkdir -p -m755 $RPM_BUILD_ROOT%{_datadir}/kdump mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d -mkdir -p $RPM_BUILD_ROOT/lib/systemd/system/ +mkdir -p $RPM_BUILD_ROOT%{_unitdir} mkdir -p -m755 $RPM_BUILD_ROOT%{_bindir} install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/kdumpctl @@ -175,7 +174,6 @@ if [ $1 -eq 1 ] ; then /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi touch /etc/kdump.conf -/sbin/chkconfig --add kdump # This portion of the script is temporary. Its only here # to fix up broken boxes that require special settings # in /etc/sysconfig/kdump. It will be removed when @@ -287,6 +285,9 @@ done %changelog +* Wed Feb 22 2012 Cong Wang - 2.0.2-40 +- Fixup sysytemd service file + * Wed Feb 22 2012 Dave Young - 2.0.2-39 - Add ssh dump support, resolve bug 789253. From c7bdac97237d8b7fad69b062f3877af61d3635df Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Mon, 27 Feb 2012 15:28:27 +0800 Subject: [PATCH 03/11] Upload new dracut module files --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 73a18e7..d2fd9b3 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ 3e802d638dce0080b910f15908c04a24 kexec-tools-po.tar.gz b3ced2097ce3981abba38ceedc84f939 kexec-tools-2.0.3.tar.bz2 -2132832b58a209c05192d5783031c79d dracut-files.tbz2 a98917a8dab5e590549bff9fe7b3a5c2 makedumpfile-1.4.2.tar.gz +051a32a91353f1b1dfd5cc2d8f8ffbdf dracut-files.tbz2 From 726d9319cbc539bb53ec4e5804a8eb69afd526b7 Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Mon, 27 Feb 2012 15:33:35 +0800 Subject: [PATCH 04/11] Bump this version --- kexec-tools.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kexec-tools.spec b/kexec-tools.spec index 18551b7..442fcc2 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 2.0.3 -Release: 40%{?dist} +Release: 41%{?dist} License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component. @@ -285,8 +285,11 @@ done %changelog +* Mon Feb 27 2012 Cong Wang - 2.0.2-41 +- Bump this version. + * Wed Feb 22 2012 Cong Wang - 2.0.2-40 -- Fixup sysytemd service file +- Fixup sysytemd service file. * Wed Feb 22 2012 Dave Young - 2.0.2-39 - Add ssh dump support, resolve bug 789253. From 985fcae6ec96e7a97c76923d185bbe8963f3ca14 Mon Sep 17 00:00:00 2001 From: Dave Young Date: Thu, 29 Mar 2012 14:56:06 +0800 Subject: [PATCH 05/11] get ip addr with getent Build kdump image will fail when kdump.conf has net option with a host name instead of ip address. Handle this just as what we do in rhel6: use getent to get the ip addr. Signed-off-by: Dave Young --- kdump_dracut_modules/99kdumpbase/module-setup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kdump_dracut_modules/99kdumpbase/module-setup.sh b/kdump_dracut_modules/99kdumpbase/module-setup.sh index 09b76f4..d891110 100755 --- a/kdump_dracut_modules/99kdumpbase/module-setup.sh +++ b/kdump_dracut_modules/99kdumpbase/module-setup.sh @@ -57,6 +57,9 @@ install() { _server=$(echo $config_val | sed -e 's#\(.*\):.*#\1#') fi + _need_dns=`echo $_server|grep "[a-zA-Z]"` + [ -n $need_dns ] && _server=`getent hosts $_server|cut -d' ' -f1` + _netdev=`/sbin/ip route get to $_server 2>&1` [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1 #the field in the ip output changes if we go to another subnet From f7b9767f8741bdac5ccd2c203192f3555d79b023 Mon Sep 17 00:00:00 2001 From: Dave Young Date: Thu, 29 Mar 2012 11:06:20 +0800 Subject: [PATCH 06/11] spec: depends on dracut-network Resolves: bz807286 kexec-tools should depend on dracut-network Signed-off-by: Dave Young --- kexec-tools.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kexec-tools.spec b/kexec-tools.spec index 442fcc2..3b80c10 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -32,7 +32,7 @@ Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units Requires(pre): coreutils sed zlib -Requires: busybox >= 1.2.0, dracut +Requires: busybox >= 1.2.0, dracut, dracut-network BuildRequires: dash BuildRequires: zlib-devel zlib zlib-static elfutils-devel-static glib2-devel bzip2-devel BuildRequires: pkgconfig intltool gettext From f590d235e06741ef8ddf4a5e2e60b7661eddb225 Mon Sep 17 00:00:00 2001 From: Chao Wang Date: Wed, 28 Mar 2012 16:23:38 +0800 Subject: [PATCH 07/11] Handle net option for nfs in kdump.conf correctly Resolve: bug 807521 The fix is easy. Command sed should be called with option -n to remain slience when DUMP_TARGET is a nfs server like 'nfs.server:/mnt/testarea/nfs'. Then nfs function check_ssh_config will return 1 to not to config nfs like a ssh dump Signed-off-by: Chao Wang --- kdumpctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdumpctl b/kdumpctl index ad5a488..842afa3 100755 --- a/kdumpctl +++ b/kdumpctl @@ -198,7 +198,7 @@ function check_ssh_config() done < $KDUMP_CONFIG_FILE #make sure they've configured kdump.conf for ssh dumps - local SSH_TARGET=`echo -n $DUMP_TARGET|sed '/.*@/p'` + local SSH_TARGET=`echo -n $DUMP_TARGET | sed -n '/.*@/p'` if [ -z "$SSH_TARGET" ]; then return 1 fi From 832c25f2d67757057b6d49b697fdd983044eea10 Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Fri, 30 Mar 2012 11:42:14 +0800 Subject: [PATCH 08/11] Release 2.0.3-42 --- kexec-tools.spec | 7 ++++++- sources | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/kexec-tools.spec b/kexec-tools.spec index 3b80c10..e09b678 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 2.0.3 -Release: 41%{?dist} +Release: 42%{?dist} License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component. @@ -285,6 +285,11 @@ done %changelog +* Fri Mar 30 2012 Cong Wang - 2.0.2-42 +- get ip addr with getent +- spec: depends on dracut-network +- Handle net option for nfs in kdump.conf correctly + * Mon Feb 27 2012 Cong Wang - 2.0.2-41 - Bump this version. diff --git a/sources b/sources index d2fd9b3..41914fe 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ 3e802d638dce0080b910f15908c04a24 kexec-tools-po.tar.gz b3ced2097ce3981abba38ceedc84f939 kexec-tools-2.0.3.tar.bz2 a98917a8dab5e590549bff9fe7b3a5c2 makedumpfile-1.4.2.tar.gz -051a32a91353f1b1dfd5cc2d8f8ffbdf dracut-files.tbz2 +8fcfe32b2f8b7d08424939e63a529125 dracut-files.tbz2 From 7a2ab0af8cab2407e6e1fbfca4585ccca0136a35 Mon Sep 17 00:00:00 2001 From: Dave Young Date: Wed, 11 Apr 2012 17:59:25 +0800 Subject: [PATCH 09/11] variable name fix Resolves: bz807649 $need_dns should be $_need_dns [v1->v2]: ChaoWang: quote "$_need_dns" --- kdump_dracut_modules/99kdumpbase/module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdump_dracut_modules/99kdumpbase/module-setup.sh b/kdump_dracut_modules/99kdumpbase/module-setup.sh index d891110..6eaa040 100755 --- a/kdump_dracut_modules/99kdumpbase/module-setup.sh +++ b/kdump_dracut_modules/99kdumpbase/module-setup.sh @@ -58,7 +58,7 @@ install() { fi _need_dns=`echo $_server|grep "[a-zA-Z]"` - [ -n $need_dns ] && _server=`getent hosts $_server|cut -d' ' -f1` + [ -n "$_need_dns" ] && _server=`getent hosts $_server|cut -d' ' -f1` _netdev=`/sbin/ip route get to $_server 2>&1` [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1 From 7f1816b6c16445f1efee95af59d5ad24c888f009 Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Wed, 11 Apr 2012 19:32:20 +0800 Subject: [PATCH 10/11] Release 2.0.2-43 --- kexec-tools.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kexec-tools.spec b/kexec-tools.spec index e09b678..6a053de 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 2.0.3 -Release: 42%{?dist} +Release: 43%{?dist} License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component. @@ -285,6 +285,9 @@ done %changelog +* Wed Apr 11 2012 Cong Wang - 2.0.2-43 +- variable name fix from Dave Young. + * Fri Mar 30 2012 Cong Wang - 2.0.2-42 - get ip addr with getent - spec: depends on dracut-network diff --git a/sources b/sources index 41914fe..d8552fb 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ 3e802d638dce0080b910f15908c04a24 kexec-tools-po.tar.gz b3ced2097ce3981abba38ceedc84f939 kexec-tools-2.0.3.tar.bz2 a98917a8dab5e590549bff9fe7b3a5c2 makedumpfile-1.4.2.tar.gz -8fcfe32b2f8b7d08424939e63a529125 dracut-files.tbz2 +46e5e863576723462b2d2b1b79e92423 dracut-files.tbz2 From 2347ccef79ba15ed61d807742e3f036f11f01910 Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Wed, 11 Apr 2012 19:36:29 +0800 Subject: [PATCH 11/11] fix version number in changelog --- kexec-tools.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kexec-tools.spec b/kexec-tools.spec index 6a053de..fd07eb1 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -285,15 +285,15 @@ done %changelog -* Wed Apr 11 2012 Cong Wang - 2.0.2-43 +* Wed Apr 11 2012 Cong Wang - 2.0.3-43 - variable name fix from Dave Young. -* Fri Mar 30 2012 Cong Wang - 2.0.2-42 +* Fri Mar 30 2012 Cong Wang - 2.0.3-42 - get ip addr with getent - spec: depends on dracut-network - Handle net option for nfs in kdump.conf correctly -* Mon Feb 27 2012 Cong Wang - 2.0.2-41 +* Mon Feb 27 2012 Cong Wang - 2.0.3-41 - Bump this version. * Wed Feb 22 2012 Cong Wang - 2.0.2-40