Hello community,
here is the log from the commit of package kdump for openSUSE:Factory checked in at 2014-06-02 07:00:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kdump (Old)
and /work/SRC/openSUSE:Factory/.kdump.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kdump"
Changes:
--------
--- /work/SRC/openSUSE:Factory/kdump/kdump.changes 2014-05-23 08:05:25.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.kdump.new/kdump.changes 2014-06-02 07:00:39.000000000 +0200
@@ -1,0 +2,13 @@
+Fri May 30 11:31:44 UTC 2014 - ptesarik@suse.cz
+
+- Update to 0.8.13
+ o Store current configuration if KDUMP_NETCONFIG is static
+ (bnc#876212).
+ o Modify kdump udev rules to work with systemd
+ (bnc#874992, bnc#809209).
+ o Support percent-encoded URLs for KDUMP_SAVEDIR (bnc#869590).
+
+- kdump-fix-udev-rules.patch: Dropped.
+- kdump-urldecode.patch: Dropped.
+
+-------------------------------------------------------------------
Old:
----
kdump-0.8.12-rpmlintrc
kdump-0.8.12.tar.bz2
kdump-fix-udev-rules.patch
kdump-urldecode.patch
New:
----
kdump-0.8.13-rpmlintrc
kdump-0.8.13.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kdump.spec ++++++
--- /var/tmp/diff_new_pack.XA4XLr/_old 2014-06-02 07:00:40.000000000 +0200
+++ /var/tmp/diff_new_pack.XA4XLr/_new 2014-06-02 07:00:40.000000000 +0200
@@ -31,7 +31,7 @@
Url: https://github.com/ptesarik/kdump
Name: kdump
-Version: 0.8.12
+Version: 0.8.13
Release: 0
Requires: curl
Requires: makedumpfile
@@ -59,8 +59,6 @@
Source: %{name}-%{version}.tar.bz2
Source2: %{name}-%{version}-rpmlintrc
Source3: kdump.service
-Patch1: %{name}-fix-udev-rules.patch
-Patch2: %{name}-urldecode.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# rename "kdump-helpers" (10.3) -> "kdump" (11.0/SP2)
Provides: kdump-helpers = %{version}
@@ -98,9 +96,6 @@
%prep
%setup
-%patch1 -p1
-%patch2 -p1
-chmod +x tests/testurldecode.sh
%build
export CFLAGS="%optflags"
++++++ kdump-0.8.12-rpmlintrc -> kdump-0.8.13-rpmlintrc ++++++
++++++ kdump-0.8.12.tar.bz2 -> kdump-0.8.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/70-kdump.rules new/kdump-0.8.13/70-kdump.rules
--- old/kdump-0.8.12/70-kdump.rules 2014-05-16 19:31:02.000000000 +0200
+++ new/kdump-0.8.13/70-kdump.rules 1970-01-01 01:00:00.000000000 +0100
@@ -1,12 +0,0 @@
-#
-# Kdump core headers needs to be regnerated if the CPUs or memory changes.
-# For this, reload kdump.
-#
-# Novell Bug #389658
-#
-
-SUBSYSTEM=="cpu", ACTION=="online", PROGRAM="/etc/init.d/boot.kdump try-restart"
-SUBSYSTEM=="cpu", ACTION=="offline", PROGRAM="/etc/init.d/boot.kdump try-restart"
-SUBSYSTEM=="memory", ACTION=="add", PROGRAM="/etc/init.d/boot.kdump try-restart"
-SUBSYSTEM=="memory", ACTION=="remove", PROGRAM="/etc/init.d/boot.kdump try-restart"
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/70-kdump.rules.in new/kdump-0.8.13/70-kdump.rules.in
--- old/kdump-0.8.12/70-kdump.rules.in 1970-01-01 01:00:00.000000000 +0100
+++ new/kdump-0.8.13/70-kdump.rules.in 2014-05-30 13:24:24.000000000 +0200
@@ -0,0 +1,37 @@
+@if @ARCH@ s390 s390x
+#
+# For s390x the ELF header is created in the kdump kernel and therefore
+# no kdump udev rules are required.
+#
+@else
+#
+# Kdump core headers needs to be regnerated if the CPUs or memory changes.
+# For this, reload kdump.
+#
+# Novell Bug #389658
+#
+
+TEST=="/usr/bin/systemctl", GOTO="kdump_systemd"
+
+@if @ARCH@ ppc ppc64 ppc64le
+SUBSYSTEM=="cpu", ACTION=="online", RUN+="/etc/init.d/boot.kdump try-restart"
+SUBSYSTEM=="cpu", ACTION=="offline", RUN+="/etc/init.d/boot.kdump try-restart"
+@endif
+SUBSYSTEM=="memory", ACTION=="add", RUN+="/etc/init.d/boot.kdump try-restart"
+SUBSYSTEM=="memory", ACTION=="remove", RUN+="/etc/init.d/boot.kdump try-restart"
+
+GOTO="kdump_end"
+
+# Systemd limits service start rate, so if udev events are emitted too
+# often, kdump will enter failed state, unless the counter is reset here.
+LABEL="kdump_systemd"
+
+@if @ARCH@ ppc ppc64 ppc64le
+SUBSYSTEM=="cpu", ACTION=="online", RUN+="/usr/bin/systemctl reset-failed kdump", RUN+="/usr/bin/systemctl try-restart kdump"
+SUBSYSTEM=="cpu", ACTION=="offline", RUN+="/usr/bin/systemctl reset-failed kdump", RUN+="/usr/bin/systemctl try-restart kdump"
+@endif
+SUBSYSTEM=="memory", ACTION=="add", RUN+="/usr/bin/systemctl reset-failed kdump", RUN+="/usr/bin/systemctl try-restart kdump"
+SUBSYSTEM=="memory", ACTION=="remove", RUN+="/usr/bin/systemctl reset-failed kdump", RUN+="/usr/bin/systemctl try-restart kdump"
+
+LABEL="kdump_end"
+@endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/CMakeLists.txt new/kdump-0.8.13/CMakeLists.txt
--- old/kdump-0.8.12/CMakeLists.txt 2014-05-16 19:31:02.000000000 +0200
+++ new/kdump-0.8.13/CMakeLists.txt 2014-05-30 13:24:24.000000000 +0200
@@ -26,7 +26,7 @@
cmake_minimum_required(VERSION 2.6.2)
set (PACKAGE_STRING "kdump")
-set (PACKAGE_VERSION "0.8.12")
+set (PACKAGE_VERSION "0.8.13")
include_directories("${PROJECT_BINARY_DIR}")
@@ -195,8 +195,26 @@
/var/adm/fillup-templates/
)
+ADD_CUSTOM_COMMAND(
+ OUTPUT
+ 70-kdump.rules
+ COMMAND
+ ARCH=${CMAKE_SYSTEM_PROCESSOR}
+ awk -f ${CMAKE_CURRENT_SOURCE_DIR}/process_cond.awk
+ ${CMAKE_CURRENT_SOURCE_DIR}/70-kdump.rules.in
+ > ${CMAKE_CURRENT_BINARY_DIR}/70-kdump.rules
+ DEPENDS
+ 70-kdump.rules.in
+)
+ADD_CUSTOM_TARGET(
+ kdump.rules
+ ALL
+ DEPENDS
+ 70-kdump.rules
+)
+
INSTALL(FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/70-kdump.rules
+ ${CMAKE_CURRENT_BINARY_DIR}/70-kdump.rules
DESTINATION
/etc/udev/rules.d
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/NEWS new/kdump-0.8.13/NEWS
--- old/kdump-0.8.12/NEWS 2014-05-16 19:31:02.000000000 +0200
+++ new/kdump-0.8.13/NEWS 2014-05-30 13:24:24.000000000 +0200
@@ -1,3 +1,9 @@
+0.8.13
+------
+ * Store current configuration if KDUMP_NETCONFIG is static
+ * Modify kdump udev rules to work with systemd (and clean them up)
+ * Support percent-encoded URLs for KDUMP_SAVEDIR
+
0.8.12
------
* Add "ssh" target protocol to transfer the file over the standard input
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/init/mkdumprd new/kdump-0.8.13/init/mkdumprd
--- old/kdump-0.8.12/init/mkdumprd 2014-05-16 19:31:02.000000000 +0200
+++ new/kdump-0.8.13/init/mkdumprd 2014-05-30 13:24:24.000000000 +0200
@@ -156,8 +156,8 @@
fi
if [ "$KDUMP_NETCONFIG" = "auto" ] ; then
status_message "Network: auto"
- DRACUT_ARGS+=" --kernel-cmdline 'rd.neednet=1 ip=any'"
if [ -n "$neednet" ]; then
+ DRACUT_ARGS+=" --kernel-cmdline 'rd.neednet=1 ip=any'"
modules="$modules network"
fi
elif [ -z "$KDUMP_NETCONFIG" ] ; then
@@ -166,10 +166,19 @@
interface=$(echo "$KDUMP_NETCONFIG" | cut -d ':' -f 1)
mode=$(echo "$KDUMP_NETCONFIG" | cut -d ':' -f 2)
- status_message "Network interface: $interface"
+ if [ "$interface" = "default" ] ; then
+ interface=$( kdump_default_netdev )
+ interface="${interface% *}"
+ status_message "Network interface: $interface (default)"
+ else
+ status_message "Network interface: $interface"
+ fi
+
if [ "$mode" = "static" ] ; then
+ ipcfg="$(kdump_ip_config "$interface")"
+ hwaddr=$(cat "/sys/class/net/$interface/address")
status_message "Network mode: Static IP"
- DRACUT_ARGS+=" --kernel-cmdline 'rd.neednet=1'"
+ DRACUT_ARGS+=" --kernel-cmdline 'rd.neednet=1 ip=$ipcfg::$hwaddr'"
else
status_message "Network mode: Automatic IP (DHCP)"
DRACUT_ARGS+=" --kernel-cmdline 'rd.neednet=1 ip=${interface}:dhcp'"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/init/module-setup.sh new/kdump-0.8.13/init/module-setup.sh
--- old/kdump-0.8.12/init/module-setup.sh 2014-05-16 19:31:02.000000000 +0200
+++ new/kdump-0.8.13/init/module-setup.sh 2014-05-30 13:24:24.000000000 +0200
@@ -18,7 +18,9 @@
kdump_setup_files "$initdir" "${!host_fs_types[*]}"
+ inst_hook mount 30 "$moddir/mount-kdump.sh"
inst_hook pre-pivot 90 /lib/kdump/save_dump.sh
inst_multiple makedumpfile makedumpfile-R.pl kdumptool \
$KDUMP_REQUIRED_PROGRAMS
+ inst_simple /etc/resolv.conf
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/init/mount-kdump.sh new/kdump-0.8.13/init/mount-kdump.sh
--- old/kdump-0.8.12/init/mount-kdump.sh 1970-01-01 01:00:00.000000000 +0100
+++ new/kdump-0.8.13/init/mount-kdump.sh 2014-05-30 13:24:24.000000000 +0200
@@ -0,0 +1,25 @@
+#!/bin/bash
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+#
+# mount-kdump.sh: fake successful mount without mounting anything
+#
+# The kdump module adds all necessary mount points under /kdump,
+# so there is no need to mount root separately. In fact, mounting
+# the root filesystem may not be needed at all, e.g. with FTP dump.
+#
+
+# override ismounted: pretend that "$NEWROOT" is mounted
+# since this function must return correct result for non-root fs,
+# let's modify the existing definition using sed:
+eval "$(
+ type ismounted |
+ sed -e '1,/^{/s/^{.*/&\n test "$1" != "$NEWROOT" || return 0/; 1d'
+)"
+
+# override usable_root: everything is "usable" for kdump
+usable_root()
+{
+ return 0
+}
+
+# vim: set sw=4 ts=4 et:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/init/setup-kdump.functions new/kdump-0.8.13/init/setup-kdump.functions
--- old/kdump-0.8.12/init/setup-kdump.functions 2014-05-16 19:31:02.000000000 +0200
+++ new/kdump-0.8.13/init/setup-kdump.functions 2014-05-30 13:24:24.000000000 +0200
@@ -46,6 +46,169 @@
)
} # }}}
+# Extract the device name from a route
+#
+# Input:
+# output of "route show"
+# Output:
+# device name (for each line of input)
+function kdump_route2dev() # {{{
+{
+ sed -n 's/.* dev \([^ ]*\) *.*/\1/p'
+} # }}}
+
+#
+# Determine the default network device.
+#
+# Output:
+# "$ifname $mode"
+# ifname default network interface name (or empty if none)
+# mode initialization mode ("static" or "dhcp")
+function kdump_default_netdev() # {{{
+{
+ local ifname BOOTPROTO
+ local inffile="/etc/install.inf"
+
+ # check current default routes
+ ifname=$(ip route show 0/0 | kdump_route2dev)
+ if [ -z "$ifname" ] ; then
+ ifname=$(ip -6 route show ::/0 | kdump_route2dev)
+ fi
+
+ # if not found, get info from install.inf
+ if [ -z "$ifname" -a -f "$inffile" ] ; then
+ local dev hwaddr hwaddr2
+ eval $( sed -ne '
+ s/^NetConfig: \(.*\)/BOOTPROTO=\1/p;
+ s/^Netdevice: \(.*\)/ifname=\1/p;
+ s/HWAddr: \(.*\)/hwaddr=\1/p'
+ "$inffile" )
+ if [ -n "$hwaddr" ] ; then
+ for dev in /sys/class/net/* ; do
+ read hwaddr2 < "$dev"/address
+ if [ "$hwaddr" = "$hwaddr2" ] ; then
+ ifname="${dev##*/}"
+ fi
+ done
+ fi
+ fi
+
+ # if still not found, there is no network
+ if [ -z "$ifname" ] ; then
+ return 0
+ fi
+
+ # get mode from config files
+ if [ -z "$BOOTPROTO" ] ; then
+ local cfg=/etc/sysconfig/network/ifcfg-"$ifname"
+ if [ -f "$cfg" ] ; then
+ eval $(grep '^[[:space:]]*BOOTPROTO=' "$cfg")
+ fi
+ fi
+
+ # if not found, look if there is a dhcp daemon for the interface
+ if [ -z "$BOOTPROTO" ] ; then
+ if [ -n "$(ps -C dhclient,dhclient6,dhcpcd -o cmd= |
+ sed -n '/.* \('"$ifname"'\)\( .*\|$\)/p' )" ] ; then
+ BOOTPROTO=dhcp
+ else
+ BOOTPROTO=static
+ fi
+ fi
+
+ # if the interface is a bridge, then try to use the underlying interface
+ # if it is the only non-virtual interface (not tap or vif)
+ if [ -d "/sys/class/net/$ifname/bridge" -a \
+ -d "/sys/class/net/$ifname/brif" ] ; then
+
+ local ifname2 res count=0
+ for ifname2 in "/sys/class/net/$ifname/brif"/*; do
+ case "$(readlink -f "$ifname2")" in
+ /sys/devices/virtual/*)
+ continue
+ esac
+ res="${ifname2##*/}"
+ count=$(( count+1 ))
+ done
+
+ if [ "$count" -ne 1 ] ; then
+ echo >&2 ">>> WARNING: $ifname is a bridge with more than one"
+ echo >&2 ">>> underlying interface. Please specify the device"
+ echo >&2 ">>> in KDUMP_NETCONFIG manually."
+ else
+ ifname="$res"
+ fi
+ fi
+
+ echo "$ifname $BOOTPROTO"
+} # }}}
+
+#
+# Convert a CIDR prefix to IPv4 netmask
+#
+# Parameters:
+# 1) prefix the CIDR prefix (default: 32)
+# Output:
+# Corresponding netmask
+kdump_prefix2netmask() { # {{{
+ local prefix="${1:-32}"
+ local netmask=
+ local i
+ for i in a b c d
+ do
+ netmask="$netmask.$(( 255 - (255 >> prefix) ))"
+ if [ "$prefix" -gt 8 ] ; then
+ prefix=$(( prefix - 8 ))
+ else
+ prefix=0
+ fi
+ done
+ echo "${netmask:1}"
+} # }}}
+
+#
+# Get the ip= parameter for a given device
+#
+# Parameters:
+# 1) device device name (use default if empty)
+# Output:
+# ip configuration string that can be used for the ip= initrd parameter
+function kdump_ip_config() # {{{
+{
+ local iface="$1"
+ if [ -z "$iface" ] ; then
+ iface=$( kdump_default_netdev )
+ iface="${iface% *}"
+ fi
+ [ -z "$iface" ] && return 1
+
+ local ipaddr peeraddr gwaddr netmask hostname iface
+ local family cidr rest
+ local prefix
+ while read family cidr rest
+ do
+ [ "$family" = "inet" ] || continue
+
+ ipaddr="${cidr%/*}"
+ prefix="${cidr:${#ipaddr}}"
+ set -- $rest
+
+ if [ "$1" == "peer" ] ; then
+ cidr="$2"
+ peeraddr=${cidr%/*}
+ prefix="${cidr:${#peeraddr}}"
+ shift 2
+ fi
+ netmask=$( kdump_prefix2netmask "${prefix:1}" )
+
+ done < <(ip -4 address show dev "$iface")
+
+ gwaddr=$(ip route show 0/0 | sed -n 's/.* via \([^ ]*\).*/\1/p')
+ hostname=$(hostname)
+
+ echo "$ipaddr:$peeraddr:$gwaddr:$netmask:$hostname:$iface:none"
+} # }}}
+
#
# Get the save directory and protocol.
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/kdumptool/CMakeLists.txt new/kdump-0.8.13/kdumptool/CMakeLists.txt
--- old/kdump-0.8.12/kdumptool/CMakeLists.txt 2014-05-16 19:31:02.000000000 +0200
+++ new/kdump-0.8.13/kdumptool/CMakeLists.txt 2014-05-30 13:24:24.000000000 +0200
@@ -142,3 +142,8 @@
testprocess.cc
)
target_link_libraries(testprocess common ${EXTRA_LIBS})
+
+add_executable(testurldecode
+ testurldecode.cc
+)
+target_link_libraries(testurldecode common ${EXTRA_LIBS})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/kdumptool/stringutil.cc new/kdump-0.8.13/kdumptool/stringutil.cc
--- old/kdump-0.8.12/kdumptool/stringutil.cc 2014-05-16 19:31:02.000000000 +0200
+++ new/kdump-0.8.13/kdumptool/stringutil.cc 2014-05-30 13:24:24.000000000 +0200
@@ -270,6 +270,19 @@
#endif // HAVE_LIBSSL
+// -----------------------------------------------------------------------------
+int Stringutil::hex2int(char c)
+ throw (KError)
+{
+ if (c >= '0' && c <= '9')
+ return c - '0';
+ if (c >= 'a' && c <= 'f')
+ return c - 'a' + 10;
+ if (c >= 'A' && c <= 'F')
+ return c - 'A' + 10;
+ throw KError(string("Stringutil::hex2int: '") + c + "' is not a hex digit");
+}
+
//}}}
//{{{ KString ------------------------------------------------------------------
@@ -333,6 +346,27 @@
return strcmp(c_str() + size() - part.size(), part.c_str()) == 0;
}
+// -----------------------------------------------------------------------------
+KString &KString::decodeURL(bool formenc)
+ throw()
+{
+ iterator src, dst;
+ for (src = dst = begin(); src != end(); ++src) {
+ char c1, c2;
+ if (*src == '%' && end() - src >= 2 &&
+ isxdigit(c1 = src[1]) && isxdigit(c2 = src[2])) {
+ *dst++ = (Stringutil::hex2int(c1) << 4) |
+ Stringutil::hex2int(c2);
+ src += 2;
+ } else if (formenc && *src == '+')
+ *dst++ = ' ';
+ else
+ *dst++ = *src;
+ }
+ resize(dst - begin());
+ return *this;
+}
+
//}}}
// vim: set sw=4 ts=4 fdm=marker et: :collapseFolds=1:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/kdumptool/stringutil.h new/kdump-0.8.13/kdumptool/stringutil.h
--- old/kdump-0.8.12/kdumptool/stringutil.h 2014-05-16 19:31:02.000000000 +0200
+++ new/kdump-0.8.13/kdumptool/stringutil.h 2014-05-30 13:24:24.000000000 +0200
@@ -200,6 +200,9 @@
throw (KError);
#endif // HAVE_LIBSSL
+
+ static int hex2int(char c)
+ throw (KError);
};
//}}}
@@ -289,6 +292,14 @@
bool endsWith(const std::string &part) const
throw ();
+ /**
+ * Perform URL decoding on the string.
+ *
+ * @param[in] formenc if @c true, translate '+' into spaces
+ * @return reference to this object (after decoding)
+ */
+ KString &decodeURL(bool formenc = false)
+ throw();
};
//}}}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdump-0.8.12/kdumptool/testurldecode.cc new/kdump-0.8.13/kdumptool/testurldecode.cc
--- old/kdump-0.8.12/kdumptool/testurldecode.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/kdump-0.8.13/kdumptool/testurldecode.cc 2014-05-30 13:24:24.000000000 +0200
@@ -0,0 +1,60 @@
+/*
+ * (c) 2014, Petr Tesarik