Updating kdump.init and mkdumprd to equiv. of -163.el5
This commit is contained in:
parent
47e2f22d82
commit
88c0ba0f32
@ -44,7 +44,8 @@
|
||||
# initramfs will wait before attempting to transmit
|
||||
# user data.
|
||||
# default <reboot | shell>
|
||||
# if all of the above fail, do the default action.
|
||||
# Action to preform instead of mounting root fs and
|
||||
# running init process
|
||||
# reboot: If the default action is reboot simply reboot
|
||||
# the system and loose the core that you are
|
||||
# trying to retrieve.
|
||||
|
@ -154,6 +154,13 @@ function load_kdump()
|
||||
KDUMP_COMMANDLINE=`cat /proc/cmdline`
|
||||
fi
|
||||
|
||||
MEM_RESERVED=`echo $KDUMP_COMMANDLINE | grep "crashkernel=[0-9]\+[MmKkGg]@[0-9]\+[MmGgKk]"`
|
||||
if [ -z "$MEM_RESERVED" ]
|
||||
then
|
||||
$LOGGER "No crashkernel parameter specified for running kernel"
|
||||
return 1
|
||||
fi
|
||||
|
||||
ARCH=`uname -m`
|
||||
if [ "$ARCH" == "i686" -o "$ARCH" == "i386" ]
|
||||
then
|
||||
@ -179,7 +186,7 @@ function load_kdump()
|
||||
fi
|
||||
fi
|
||||
|
||||
KDUMP_COMMANDLINE=`echo $KDUMP_COMMANDLINE | sed -e 's/crashkernel=[0-9]\+M@[0-9]\+M//g'`
|
||||
KDUMP_COMMANDLINE=`echo $KDUMP_COMMANDLINE | sed -e 's/crashkernel=[0-9]\+[MmKkGg]@[0-9]\+[MmGgKk]//'`
|
||||
KDUMP_COMMANDLINE="${KDUMP_COMMANDLINE} ${KDUMP_COMMANDLINE_APPEND}"
|
||||
|
||||
$KEXEC $KEXEC_ARGS $standard_kexec_args \
|
||||
|
@ -1,6 +1,6 @@
|
||||
Name: kexec-tools
|
||||
Version: 1.101
|
||||
Release: 56%{?dist}
|
||||
Release: 57%{?dist}
|
||||
License: GPL
|
||||
Group: Applications/System
|
||||
Summary: The kexec/kdump userspace component.
|
||||
@ -224,6 +224,9 @@ rm -f %{_datadir}/firstboot/modules/firstboot_kdump.py
|
||||
%doc kexec-kdump-howto.txt
|
||||
|
||||
%changelog
|
||||
* Wed Jan 25 2007 Neil Horman <nhorman@redhat.com> - 1.101-55%{dist}
|
||||
- Updating kdump.init and mkdumprd with most recent RHEL5 fixes
|
||||
|
||||
* Thu Jan 04 2007 Neil Horman <nhorman@redhat.com> - 1.101-56%{dist}
|
||||
- Fix option parsing problem for bzImage files (bz 221272)
|
||||
|
||||
|
51
mkdumprd
51
mkdumprd
@ -45,8 +45,6 @@ DMRAIDS=""
|
||||
MPATHS=""
|
||||
|
||||
|
||||
[ -e /etc/sysconfig/mkinitrd ] && . /etc/sysconfig/mkinitrd
|
||||
|
||||
CONFMODS="$MODULES"
|
||||
MODULES=""
|
||||
|
||||
@ -68,7 +66,7 @@ fstab="/etc/fstab"
|
||||
|
||||
vg_list=""
|
||||
net_list=""
|
||||
USING_METHOD="local_fs"
|
||||
USING_METHOD=""
|
||||
SAVE_PATH=/var/crash
|
||||
|
||||
vecho()
|
||||
@ -406,6 +404,11 @@ handlenetdev() {
|
||||
then
|
||||
echo " " netmask $NETMASK >> $MNTIMAGE/etc/network/interfaces
|
||||
fi
|
||||
if [ -z "$GATEWAY" ]
|
||||
then
|
||||
GATEWAY=`/sbin/ip route show | awk '/^default/ {print $3}'`
|
||||
fi
|
||||
echo " " gateway $GATEWAY >> $MNTIMAGE/etc/network/interfaces
|
||||
fi
|
||||
|
||||
#This lets us recursively handle stacked devices
|
||||
@ -909,6 +912,7 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then
|
||||
#don't process comments or blank line
|
||||
continue
|
||||
fi
|
||||
USING_METHOD="filesystem"
|
||||
if (echo $location | egrep -q "^(LABEL|UUID)="); then
|
||||
location=$(findfs $location)
|
||||
fi
|
||||
@ -925,7 +929,14 @@ if [ -n "$CORE_COLLECTOR" ]; then
|
||||
rm -rf $MNTIMAGE
|
||||
rm -rf $IMAGE
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$USING_METHOD" ]
|
||||
then
|
||||
echo "Warning! Lack of dump target specification means core_collector option is ignored!"
|
||||
CORE_COLLECTOR=""
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
@ -1459,12 +1470,17 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then
|
||||
#test raw partition
|
||||
kdump_chk "dd if=$location count=1 of=/dev/null > /dev/null 2>&1" \
|
||||
"Bad raw partition $location"
|
||||
#TODO check for available size is greater than $memtotal
|
||||
#check for available size is greater than $memtotal
|
||||
available_size=$(fdisk -s $location)
|
||||
if [ $available_size -lt $memtotal ]; then
|
||||
echo "Warning: There is not space enough to save a vmcore."
|
||||
echo " The size of $location should be much greater than $memtotal bytes."
|
||||
fi
|
||||
|
||||
#setup raw case
|
||||
emit "echo Saving to partition $location"
|
||||
emit "dd if=/proc/vmcore of=$location"
|
||||
emit "if [ $? == 0 ]"
|
||||
emit "if [ \$? == 0 ]"
|
||||
emit "then"
|
||||
emit " reboot -f"
|
||||
emit "fi"
|
||||
@ -1526,6 +1542,7 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then
|
||||
"Bad NFS mount $location"
|
||||
mkdir -p $tmnt/$SAVE_PATH
|
||||
tdir=`mktemp -dqp $tmnt/$SAVE_PATH`
|
||||
available_size=$(df $tdir | tail -1 | tr -s ' ' ':' | cut -d: -f4)
|
||||
|
||||
rc=$? && rm -rf $tdir
|
||||
umount $tmnt
|
||||
@ -1543,7 +1560,11 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then
|
||||
CORE_COLLECTOR="cp"
|
||||
fi
|
||||
|
||||
#TODO check for available size is greater than $memtotal
|
||||
#check for available size is greater than $memtotal
|
||||
if [ $available_size -lt $memtotal ]; then
|
||||
echo "Warning: There is not space enough to save a vmcore."
|
||||
echo " The size of $location should be much greater than $memtotal bytes."
|
||||
fi
|
||||
|
||||
#setup nfs case
|
||||
mkdir -p $MNTIMAGE/mnt
|
||||
@ -1571,6 +1592,14 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then
|
||||
echo "$KDUMP_CONFIG_FILE: Could not create temp directory in $location:$SAVE_PATH"
|
||||
exit 1
|
||||
fi
|
||||
remote_df=`ssh -q $s_opts $rlocation df $tdir`
|
||||
available_size=$(echo $remote_df | tail -1 | tr -s ' ' '|' | cut -d\| -f10)
|
||||
|
||||
#check for available size is greater than $memtotal
|
||||
if [ $available_size -lt $memtotal ]; then
|
||||
echo "Warning: There is not space enough to save a vmcore."
|
||||
echo " The size of $rlocation:$tdir should be much greater than $memtotal bytes."
|
||||
fi
|
||||
#We do this to remove the temp directory from above
|
||||
ssh -q $s_opts $rlocation rmdir $tdir
|
||||
|
||||
@ -1606,12 +1635,18 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then
|
||||
kdump_chk "mount -t $type $location /mnt" "Bad mount point $location"
|
||||
mkdir -p /mnt/$SAVE_PATH
|
||||
tdir=`mktemp -dqp /mnt/$SAVE_PATH`
|
||||
available_size=$(df $tdir | tail -1 | tr -s ' ' ':' | cut -d: -f4)
|
||||
rc=$? && rm -rf $tdir && umount /mnt
|
||||
if [ $rc != "0" ]; then
|
||||
echo "Cannot create directory in $location: $SAVE_PATH"
|
||||
exit 1
|
||||
fi
|
||||
#TODO check for available size is greater than $memtotal
|
||||
#check for available size is greater than $memtotal
|
||||
if [ $available_size -lt $memtotal ]; then
|
||||
echo "Warning: There is not space enough to save a vmcore."
|
||||
echo " The size of $location should be much greater than $memtotal bytes."
|
||||
fi
|
||||
|
||||
|
||||
#setup filesystem case
|
||||
mkdir -p $MNTIMAGE/mnt
|
||||
|
Loading…
Reference in New Issue
Block a user