OBS User unknown 2007-02-15 17:13:06 +00:00 committed by Git OBS Bridge
parent 0c7f273c50
commit 0ff96a3778
5 changed files with 96 additions and 14 deletions

View File

@ -288,6 +288,17 @@ forces the dumper to dump without checking the size. The default value
is "64".
- KDUMP_VERBOSE
Determines if kdump uses verbose output. This value is a bitmask:
1: kdump command line is written to system log when executing
/etc/init.d/kdump
2: progress is written to stdout while dumping
4: kdump command line is written so standard output when executing
/etc/init.d/kdump
Dump Analysis
-------------

48
kdump
View File

@ -65,6 +65,12 @@ get_mem_size()
expr \( $s + 1048575 \) / 1048576
}
get_size_mb()
{
s=`stat -c '%s' $1 2> /dev/null || echo 0`
expr \( $s + 1048575 \) / 1048576
}
# The default dumper
#
# Clean up old stuff if necessary, check the free size
@ -75,10 +81,11 @@ save_core()
purge_old_dumps
fi
dumpsize=`get_mem_size`
if [ $KDUMP_FREE_DISK_SIZE -gt 0 ]; then
restsize=`parse_rest_size "$KDUMP_SAVEDIR"`
needsize=`get_mem_size`
needsize=`expr $needsize + $KDUMP_FREE_DISK_SIZE`
needsize=`expr $dumpsize + $KDUMP_FREE_DISK_SIZE`
if [ $restsize -lt $needsize ]; then
echo -n " No enough space left on dump device ($restsize MB)"
rc_status -s
@ -89,8 +96,24 @@ save_core()
coredir="${KDUMP_SAVEDIR}/`date +"%Y-%m-%d-%H:%M"`"
mkdir -p $coredir
echo -n "Saving crash dump to $coredir"
cp --sparse=always /proc/vmcore $coredir/vmcore
echo -n "Saving $dumpsize MB crash dump to $coredir"
if [ $(($KDUMP_VERBOSE & 2)) -gt 0 ] ; then
echo " ..."
/bin/cp --sparse=always /proc/vmcore $coredir/vmcore &
pid=$!
sleep 5
while true; do
copied=`get_size_mb $coredir/vmcore`
printf "Copied %'10llu (%3d%%) \r" \
$copied $(($copied * 100 / $dumpsize))
test -z "$pid" && break
test -d "/proc/$pid" || pid=""
sleep 15
done
else
/bin/cp --sparse=always /proc/vmcore $coredir/vmcore
fi
rc_status -v
}
@ -197,10 +220,17 @@ load_kdump()
echo 1 > /proc/sys/kernel/panic_on_oops
$KEXEC -p $kdump_kernel \
--append="$KDUMP_COMMANDLINE" \
--initrd=$kdump_initrd \
$KEXEC_OPTIONS
KEXEC_CALL="$KEXEC -p $kdump_kernel --append=\"$KDUMP_COMMANDLINE\""
KEXEC_CALL="$KEXEC_CALL --initrd=$kdump_initrd $KEXEC_OPTIONS"
if [ $(($KDUMP_VERBOSE & 1)) -gt 0 ] ; then
logger -i -t kdump "Loading kdump kernel: $KEXEC_CALL"
fi
if [ $(($KDUMP_VERBOSE & 4)) -gt 0 ] ; then
echo "Loading kdump kernel: $KEXEC_CALL"
fi
eval "$KEXEC_CALL"
rc_status -v
}
@ -325,3 +355,5 @@ case "$1" in
esac
exit $?
# vim: set ts=8 sw=4 sts=4 noet:

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Thu Feb 15 13:44:01 CET 2007 - bwalle@suse.de
- added setting to print the kdump command line to standard output
- small improvement for the outut message while dumping: last
message always prints 100% if it was sucessful
-------------------------------------------------------------------
Wed Feb 14 17:16:33 CET 2007 - bwalle@suse.de
- added KDUMP_VERBOSE option to print progress output while
dumping and to add the kexec call to system log
- added maxcpus=1 as default for KDUMP_COMMANDLINE_APPEND on IA64
- added --noio as default for KEXEC_OPTIONS on IA64
-------------------------------------------------------------------
Tue Feb 13 18:38:52 CET 2007 - bwalle@suse.de

View File

@ -19,7 +19,7 @@ Requires: %insserv_prereq %fillup_prereq
Autoreqprov: on
Summary: Tools for fast kernel loading
Version: 1.101
Release: 77
Release: 79
Source: %{name}-%{package_version}.tar.bz2
Source1: kdump
Source2: sysconfig.kdump
@ -83,7 +83,10 @@ sed -i 's@^\(KEXEC_OPTIONS="\)\(.*"[[:blank:]]*$\)@\1--args-linux \2@' $RPM_BUIL
%endif
%ifarch ia64
# empty string for kdump kernel version (to indicate the same kernel)
sed -i 's@^\(KDUMP_KERNELVER=\).*$@\1""@' $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.kdump
sed -i -e 's@^\(KDUMP_KERNELVER=\).*$@\1""@' \
-e 's@^\(KEXEC_OPTIONS="\)\(.*"[[:blank:]]*$\)@\1--noio \2@' \
-e 's@^\(KDUMP_COMMANDLINE_APPEND="\)\(.*"[[:blank:]]*$\)@\1maxcpus=1 \2@' \
$RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.kdump
%endif
# install gdb helpers
mkdir -p $RPM_BUILD_ROOT%{_datadir}
@ -125,6 +128,15 @@ true # ignore errors
%{_sbindir}/kdump-helper
%changelog -n kexec-tools
* Thu Feb 15 2007 - bwalle@suse.de
- added setting to print the kdump command line to standard output
- small improvement for the outut message while dumping: last
message always prints 100%% if it was sucessful
* Wed Feb 14 2007 - bwalle@suse.de
- added KDUMP_VERBOSE option to print progress output while
dumping and to add the kexec call to system log
- added maxcpus=1 as default for KDUMP_COMMANDLINE_APPEND on IA64
- added --noio as default for KEXEC_OPTIONS on IA64
* Tue Feb 13 2007 - bwalle@suse.de
- align the both start and end address of the ELF core header
to EFI_PAGE_SIZE (4096) to fix wrong EFI memory maps

View File

@ -117,12 +117,24 @@ KDUMP_FREE_DISK_SIZE=64
# written to KDUMP_SAVEDIR when booting from the kdump kernel.
#
# If KDUMP_DUMPDEV points to a device file, the dump is written to that device
# when booting from the kdump kernel. The advantage over is that you don't have to
# mount the root file system (which may be corrupted!) just to write the
# dump. On the first normal boot which is able to successfully mount the
# root file system, the dump is saved to KDUMP_SAVEDIR as usual.
# when booting from the kdump kernel. The advantage over is that you don't have
# to mount the root file system (which may be corrupted!) just to write the
# dump. On the first normal boot which is able to successfully mount the root
# file system, the dump is saved to KDUMP_SAVEDIR as usual.
#
# Important: The KDUMP_DUMPDEV is overwritten by kdump, so don't use it for
# saving any data. Also don't use the currently used swap partition.
#
KDUMP_DUMPDEV=""
## Type: integer
## Default: 3
#
# Determines if kdump uses verbose output. This value is a bitmask:
#
# 1: kdump command line is written to system log when executing
# /etc/init.d/kdump
# 2: progress is written to stdout while dumping
# 4: kdump command line is written so standard output when executing
# /etc/init.d/kdump
KDUMP_VERBOSE=3