Hello community, here is the log from the commit of package kdump checked in at Mon Jul 28 15:52:14 CEST 2008. -------- --- kdump/kdump.changes 2008-07-24 22:41:39.000000000 +0200 +++ kdump/kdump.changes 2008-07-28 11:58:42.000000000 +0200 @@ -1,0 +2,9 @@ +Mon Jul 28 11:58:28 CEST 2008 - bwalle@suse.de + +- update to 0.5.2 + o copy required programs (KDUMP_REQUIRED_PROGRAMS) in initrd + o mount dump partition and boot partition in initrd + o don't exit with error code when the dump directory does not yet + exist in the 'delete_dumps' command + +------------------------------------------------------------------- Old: ---- kdump-0.5.1.tar.bz2 New: ---- kdump-0.5.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdump.spec ++++++ --- /var/tmp/diff_new_pack.A14070/_old 2008-07-28 15:47:06.000000000 +0200 +++ /var/tmp/diff_new_pack.A14070/_new 2008-07-28 15:47:06.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package kdump (Version 0.5.1) +# spec file for package kdump (Version 0.5.2) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -13,7 +13,7 @@ Name: kdump License: GPL v2 or later -Version: 0.5.1 +Version: 0.5.2 Release: 1 Requires: curl openssh makedumpfile Summary: Script for kdump @@ -89,6 +89,12 @@ %{_sysconfdir}/udev/rules.d/70-kdump.rules %changelog +* Mon Jul 28 2008 bwalle@suse.de +- update to 0.5.2 + o copy required programs (KDUMP_REQUIRED_PROGRAMS) in initrd + o mount dump partition and boot partition in initrd + o don't exit with error code when the dump directory does not yet + exist in the 'delete_dumps' command * Fri Jul 25 2008 bwalle@suse.de - update to 0.5.1 o add 'print_target' sub command ++++++ kdump-0.5.1.tar.bz2 -> kdump-0.5.2.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-0.5.1/ChangeLog new/kdump-0.5.2/ChangeLog --- old/kdump-0.5.1/ChangeLog 2008-07-24 22:39:34.000000000 +0200 +++ new/kdump-0.5.2/ChangeLog 2008-07-28 11:45:36.000000000 +0200 @@ -1,3 +1,11 @@ +2008-07-27 Bernhard Walle <bwalle@suse.de> + + * mount dump partition and boot partition in initrd + +2008-07-25 Bernhard Walle <bwalle@suse.de> + + * copy required programs (KDUMP_REQUIRED_PROGRAMS) in initrd + 2008-07-24 Bernhard Walle <bwalle@suse.de> * add 'print_target' sub command @@ -7,4 +15,4 @@ * redesign (version 0.5) -vim: set ts=8 sw=8 noet: + vim: set ts=8 sw=8 noet: diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-0.5.1/CMakeLists.txt new/kdump-0.5.2/CMakeLists.txt --- old/kdump-0.5.1/CMakeLists.txt 2008-07-24 22:39:34.000000000 +0200 +++ new/kdump-0.5.2/CMakeLists.txt 2008-07-28 11:45:36.000000000 +0200 @@ -26,7 +26,7 @@ cmake_minimum_required(VERSION 2.4) set (PACKAGE_STRING "kdump") -set (PACKAGE_VERSION "0.5.1") +set (PACKAGE_VERSION "0.5.2") include_directories("${PROJECT_BINARY_DIR}") diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-0.5.1/init/boot-kdump.sh new/kdump-0.5.2/init/boot-kdump.sh --- old/kdump-0.5.1/init/boot-kdump.sh 2008-07-24 22:39:34.000000000 +0200 +++ new/kdump-0.5.2/init/boot-kdump.sh 2008-07-28 11:45:36.000000000 +0200 @@ -17,9 +17,9 @@ # #%stage: setup #%depends: mount network -#%programs: /bin/makedumpfile /bin/grep /sbin/kdumptool /sbin/showmount /sbin/mount.cifs mount.nfs /bin/gdb +#%programs: /bin/makedumpfile /bin/awk /bin/gawk /bin/grep /sbin/kdumptool /sbin/showmount /sbin/mount.cifs mount.nfs /bin/gdb #%if: "$use_kdump" -#%udevmodules: cifs nls_utf8 +#%udevmodules: cifs nls_utf8 reiserfs xfs jfs ext2 ext3 # # If KDUMP_IMMEDIATE_REBOOT is false, then open a shell. If it's true, then @@ -78,6 +78,15 @@ eval "$KDUMP_TRANSFER" else + # get the target + target=$(kdumptool print_target) + protocol=$(echo "$target" | grep '^Protocol' | awk '{ print $2 }') + path=$(echo "$target" | grep '^Path' | awk '{ print $2 }') + + # mount all partitions in fstab + mv /etc/fstab.kdump /etc/fstab + mount -a + # # prescript if [ -n "$KDUMP_PRESCRIPT" ] ; then diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-0.5.1/init/boot-kdump.sh.orig new/kdump-0.5.2/init/boot-kdump.sh.orig --- old/kdump-0.5.1/init/boot-kdump.sh.orig 1970-01-01 01:00:00.000000000 +0100 +++ new/kdump-0.5.2/init/boot-kdump.sh.orig 2008-07-28 11:45:36.000000000 +0200 @@ -0,0 +1,147 @@ +#!/bin/bash +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. +# +#%stage: setup +#%depends: mount network +#%programs: /bin/makedumpfile /bin/grep /sbin/kdumptool /sbin/showmount /sbin/mount.cifs mount.nfs /bin/gdb /usr/bin/chroot +#%if: "$use_kdump" +#%udevmodules: cifs nls_utf8 reiserfs ext2 ext3 vfat xfs jfs + +# +# Prints debug message when enabled in KDUMP_VERBOSE. +# Parameters: 1) message +# Returns: nothing +function debug_msg() # {{{ +{ + local msg=$1 + + if (( "$KDUMP_VERBOSE" & 8 )) ; then + echo >&2 "$msg" + fi +} # }}} + +# +# If KDUMP_IMMEDIATE_REBOOT is false, then open a shell. If it's true, then +# reboot. +function handle_exit() # {{{ +{ + if [ $KDUMP_IMMEDIATE_REBOOT = "yes" \ + -o "$KDUMP_IMMEDIATE_REBOOT" = "YES" ] ; then + reboot -f + else + bash + fi +} # }}} + +# +# Checks the given parameter. If the status was non-zero, then it checks +# KDUMP_CONTINUE_ON_ERROR if it should reboot or just continue. +# In any case, it prints an error message. +function continue_error() # {{{ +{ + local status=$? + + if [ $status -eq 0 ] ; then + return + fi + + echo "Last command failed ($status)." + + if ! [ "$KDUMP_CONTINUE_ON_ERROR" = "true" -o \ + "$KDUMP_CONTINUE_ON_ERROR" = "TRUE" ] ; then + handle_exit + fi +} # }}} + +# +# Mounts the root partition in /root/boot. +# Parameters: no +# Return value: no +function mount_boot() # {{{ +{ + echo "Mounting boot partition" +} # }}} + +# +# sanity check +if ! grep elfcorehdr /proc/cmdline &>/dev/null ; then + echo "Kdump initrd booted in non-kdump kernel" + return 1 +fi + +. /etc/sysconfig/kdump + +ROOTDIR=/root + +# +# start LED blinking in background +kdumptool ledblink --background + +# +# create mountpoint for NFS/CIFS +mkdir /mnt + +if [ -n "$KDUMP_TRANSFER" ] ; then + echo "Running $KDUMP_TRANSFER" + eval "$KDUMP_TRANSFER" +else + + # get the target + target=$(kdumptool print_target) + protocol=$(echo "$target" | grep '^Protocol' | awk '{ print $2 }') + path=$(echo "$target" | grep '^Path' | awk '{ print $2 }') + + # mount all partitions in fstab + mount -a + + # + # prescript + if [ -n "$KDUMP_PRESCRIPT" ] ; then + echo "Running $KDUMP_PRESCRIPT" + eval "$KDUMP_PRESCRIPT" + continue_error $? + fi + + # + # mount boot partition if we try to save the kernel + if [ "$KDUMP_COPY_KERNEL" = "true" ] ; then + mount_boot + fi + + # + # delete old dumps + kdumptool delete_dumps $KDUMPTOOL_OPTIONS + continue_error $? + + # + # save the dump (HOME=/ to find the public/private key) + read hostname < /etc/hostname.kdump + HOME=/ kdumptool save_dump --root=$ROOTDIR \ + --fqdn=$hostname $KDUMPTOOL_OPTIONS + + # + # postscript + if [ -n "$KDUMP_POSTSCRIPT" ] ; then + echo "Running $KDUMP_POSTSCRIPT" + eval "$KDUMP_POSTSCRIPT" + continue_error $? + fi +fi + +handle_exit + +# vim: set sw=4 ts=4 fdm=marker et: diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-0.5.1/init/setup-kdump.sh new/kdump-0.5.2/init/setup-kdump.sh --- old/kdump-0.5.1/init/setup-kdump.sh 2008-07-24 22:39:34.000000000 +0200 +++ new/kdump-0.5.2/init/setup-kdump.sh 2008-07-28 11:45:36.000000000 +0200 @@ -19,16 +19,30 @@ #%provides: kdump # +# check if we are called with the -f kdump parameter +# +use_kdump= +if use_script kdump ; then + use_kdump=1 +fi + +if (( ! $use_kdump )) ; then + return 0 +fi + +# # copy /etc/sysconfig/kdump # +CONFIG=/etc/sysconfig/kdump -if [ ! -f /etc/sysconfig/kdump ] ; then +if [ ! -f "$CONFIG" ] ; then echo "kdump configuration not installed" return 1 fi +source "$CONFIG" mkdir -p ${tmp_mnt}/etc/sysconfig/ -cp /etc/sysconfig/kdump ${tmp_mnt}/etc/sysconfig/ +cp "$CONFIG" ${tmp_mnt}/etc/sysconfig/ # # remember the host name @@ -44,9 +58,57 @@ cp /root/.ssh/id_dsa.pub ${tmp_mnt}/.ssh fi -use_kdump= -if use_script kdump ; then - use_kdump=1 +# +# copy required programs +# +for program in "$KDUMP_REQUIRED_PROGRAMS" ; do + if [ ! -f "$program" ] ; then + echo >&2 ">>> $program does not exist. Skipping!" + continue + fi + + dir=$(dirname "$program") + mkdir -p "${tmp_mnt}/${dir}" + cp_bin "$program" "${tmp_mnt}/${dir}" +done + +# +# get the save directory and protocol +# +target=$(kdumptool print_target) +if [ -z "$target" ] ; then + echo >&2 "kdumptool print_target failed." + return 1 fi +protocol=$(echo "$target" | grep '^Protocol' | awk '{ print $2 }') +path=$(echo "$target" | grep '^Path' | awk '{ print $2 }') + + +# +# add mount points (below /root) +# + +while read line ; do + device=$(echo "$line" | awk '{ print $1 }') + mountpoint=$(echo "$line" | awk '{ print $2 }') + filesystem=$(echo "$line" | awk '{ print $3 }') + opts=$(echo "$line" | awk '{ print $4 }') + + # add the boot partition + if [ "$mountpoint" = "/boot" ] ; then + echo "$device /root$mountpoint $filesystem $opts 0 0" \ + >> ${tmp_mnt}/etc/fstab.kdump + fi + + # add the target file system + if [ "$protocol" = "file" ] && + [ "$mountpoint" != "/" ] && + echo "$path" | grep "$mountpoint" &> /dev/null ; then + echo "$device /root$mountpoint $filesystem $opts 0 0" \ + >> ${tmp_mnt}/etc/fstab.kdump + fi +done < /etc/mtab save_var use_kdump + +# vim: set sw=4 ts=4 et: diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-0.5.1/kdumptool/deletedumps.cc new/kdump-0.5.2/kdumptool/deletedumps.cc --- old/kdump-0.5.1/kdumptool/deletedumps.cc 2008-07-24 22:39:34.000000000 +0200 +++ new/kdump-0.5.2/kdumptool/deletedumps.cc 2008-07-28 11:45:36.000000000 +0200 @@ -117,6 +117,11 @@ string dir = FileUtil::pathconcat(m_rootdir, parser.getPath()); Debug::debug()->dbg("Using directory %s", dir.c_str()); + if (!FileUtil::exists(dir)) { + cerr << "Nothing to delete in " + dir + "." << endl; + return; + } + StringVector contents = FileUtil::listdir(dir, true); int deleteItems; if (oldDumps == -1) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/kdump-0.5.1/NEWS new/kdump-0.5.2/NEWS --- old/kdump-0.5.1/NEWS 2008-07-24 22:39:34.000000000 +0200 +++ new/kdump-0.5.2/NEWS 2008-07-28 11:45:36.000000000 +0200 @@ -1,3 +1,8 @@ +0.5.2 +----- + * copy required programs (KDUMP_REQUIRED_PROGRAMS) in initrd + * mount dump partition and boot partition in initrd + 0.5.1 ----- * add 'print_target' sub command ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de