Question: is there any automated way of building rpm package?
by HATAYAMA Daisuke
Hello,
Is there any automated way of building rpm package?
That is, installing files such eppic, kexec-tools-po, makedumpfile and kexec-tools with expected file names necessary for installation, place them proper file path location and then execute rpmbuild command.
I first found out there's no Makefile and INSTALL file, and then I tried preparing them manually in an ad-hoc way, but faced build failure several times and gave up.
--
Thanks.
HATAYAMA, Daisuke
7 years, 12 months
[PATCH] dracut-module-setup.sh: recognize the IPADDR[0-3] in ifcfg-xx
by Baoquan He
User complained they set static ip address in ifcfg-xx with IPADDR0,
but that ip address is not set successfully. That's because the
IPADDRn can not be recognized by dracut-module-setup.sh. Even though
in initscript, ifup-eth can recognize IPADDDR[0-255], and if 2 IPADDRxx
missed the latter will be skipped, that's enough to only respect
IPADDR[0-3].
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
dracut-module-setup.sh | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index bdadf7c..738d304 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -70,11 +70,18 @@ kdump_setup_dns() {
#checking /etc/sysconfig/network-scripts/ifcfg-$1,
#if it use static ip echo it, or echo null
kdump_static_ip() {
+ local _ipaddr
+
. /etc/sysconfig/network-scripts/ifcfg-$1
- if [ -n "$IPADDR" ]; then
+ _ipaddr=${IPADDR:-$IPADDR0}
+ _ipaddr=${_ipaddr:-$IPADDR1}
+ _ipaddr=${_ipaddr:-$IPADDR2}
+ _ipaddr=${_ipaddr:-$IPADDR3}
+
+ if [ -n "$_ipaddr" ]; then
[ -z "$NETMASK" -a -n "$PREFIX" ] && \
- NETMASK=$(ipcalc -m $IPADDR/$PREFIX | cut -d'=' -f2)
- echo -n "${IPADDR}::${GATEWAY}:${NETMASK}::"
+ NETMASK=$(ipcalc -m $_ipaddr/$PREFIX | cut -d'=' -f2)
+ echo -n "${_ipaddr}::${GATEWAY}:${NETMASK}::"
fi
}
--
1.8.5.3
9 years
[PATCH] Add some missing variables to default sysconfig and kdumpctl
by Dave Young
When I testing arm kdump, the kdump start failed with several missing variables
Copy them from x86 sysconfig to general sysconfig so at least user can set
the right value in sysconfig
Also It's better to add them to the beggining of kdumpctl and initilize them
as nul, later sourcing sysconfig will overwite them.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
kdump.sysconfig | 9 +++++++++
kdumpctl | 3 +++
2 files changed, 12 insertions(+)
--- kexec-tools.orig/kdump.sysconfig
+++ kexec-tools/kdump.sysconfig
@@ -24,3 +24,12 @@ KDUMP_COMMANDLINE_APPEND="irqpoll maxcpu
# Example:
# KEXEC_ARGS="--elf32-core-headers"
KEXEC_ARGS=""
+
+#Where to find the boot image
+KDUMP_BOOTDIR="/boot"
+
+#What is the image type used for kdump
+KDUMP_IMG=""
+
+#What is the images extension. Relocatable kernels don't have one
+KDUMP_IMG_EXT=""
--- kexec-tools.orig/kdumpctl
+++ kexec-tools/kdumpctl
@@ -9,6 +9,9 @@ MKDUMPRD="/sbin/mkdumprd -f"
SAVE_PATH=/var/crash
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
DUMP_TARGET=""
+KDUMP_BOOTDIR=""
+KDUMP_IMG=""
+KDUMP_IMG_EXT=""
. /lib/kdump/kdump-lib.sh
9 years
[PATCH v3 0/8] kdump: Modify kdump init script to support firmware-assisted dump
by Hari Bathini
This patch set implements firmware-assisted dump support for kdump
service. Firmware-assisted dump support depends on existing kdump
infrastructure (kdump scripts) present in userland to save dump
to the disk. Though existing kdump script will work seemlessly, it
still needs to modified to make it aware of presense of firmware-
assisted dump feature during service start and stop. These changes
are tested successfully on a power box with fedora19.
Changes in v3:
1. Split few functions for readability.
2. Added a cleanup patch to remove unnecessay "function" keyword.
---
Hari Bathini (8):
kdump: Modify status routine to check for firmware-assisted dump
kdump: Modify kdump script to start the firmware assisted dump.
kdump: Modify kdump script to stop firmware assisted dump
kdump: Take a backup of original default initrd before rebuilding.
kdump: Rebuild default initrd for firmware assisted dump
kdump: Get rid of "function" keyword from all functions
kdump: Check for /proc/vmcore existence before capturing the vmcore.
kdump: Add firmware-assisted dump howto document
dracut-kdump.sh | 3
fadump-howto.txt | 428 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
kdumpctl | 308 +++++++++++++++++++++++++++++++++------
3 files changed, 691 insertions(+), 48 deletions(-)
create mode 100644 fadump-howto.txt
--
- Hari
9 years, 1 month
[Patch v5 1/6] introduce several basic utility function
by Baoquan He
These utility function will be shared by several files, they are all
operation related to mount stuff.
Meantime define DEFAULT_PATH="/var/crash".
Signed-off-by: Baoquan He <bhe(a)redhat.com>
Acked-by: Vivek Goyal <vgoyal(a)redhat.com>
---
kdump-lib.sh | 21 +++++++++++++++++++++
mkdumprd | 2 +-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index de32650..bf57a91 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -3,6 +3,7 @@
# Kdump common variables and functions
#
+DEFAULT_PATH="/var/crash/"
FENCE_KDUMP_CONFIG="/etc/sysconfig/fence_kdump"
FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
FENCE_KDUMP_NODES="/etc/fence_kdump_nodes"
@@ -75,3 +76,23 @@ get_root_fs_device()
return
}
+get_mntpoint_from_path()
+{
+ echo $(df $1 | tail -1 | awk '{print $NF}')
+}
+
+get_target_from_path()
+{
+ echo $(df $1 | tail -1 | awk '{print $1}')
+}
+
+get_fs_type_from_target()
+{
+ echo $(findmnt -k -f -n -r -o FSTYPE $1)
+}
+
+get_mntpoint_from_target()
+{
+ echo $(findmnt -k -f -n -r -o TARGET $1)
+}
+
diff --git a/mkdumprd b/mkdumprd
index 84f1e18..3849866 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -12,7 +12,7 @@ export IN_KDUMP=1
conf_file="/etc/kdump.conf"
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
SAVE_PATH=$(grep ^path $conf_file| cut -d' ' -f2)
-[ -z "$SAVE_PATH" ] && SAVE_PATH="/var/crash"
+[ -z "$SAVE_PATH" ] && SAVE_PATH=$DEFAULT_PATH
extra_modules=""
dracut_args=("--hostonly" "-o" "plymouth dash resume")
OVERRIDE_RESETTABLE=0
--
1.8.5.3
9 years, 1 month
[RFC][PATCH] Add --split support for dump on filesystem
by HATAYAMA Daisuke
Hello,
This is an RFC patch intended to first review basic design of --split option support.
This version automatically appends --split option if more than 1 cpu is available on kdump 2nd kernel. I guess someone propably doesn't like the situation that multiple vmcores are generated implicitly without any explicit user operation. So, I'd like comments on this design first.
Another idea is to introduce a new directive to specify the number of vmcores into which we split /proc/vmcore, and then we append --split option if and only if the directive is specified with the value more than 1 cpu.
>From e6afa242829768ee0b9e58637444acf3fed4b442 Mon Sep 17 00:00:00 2001
From: HATAYAMA Daisuke <d.hatayama(a)jp.fujitsu.com>
Date: Tue, 25 Mar 2014 17:09:42 +0900
Subject: [PATCH] Add --split support for dump on filesystem
This commit implement makedumpfile --split option support, allowing
filtering and compression in paralell.
In this design, --split option is automatically appended if more than
1 cpu is available. Also, the number of generated dump files are
automatically decided to the number of online cpus.
To support --split option for dump on network, it's necessary to add
new feature in makedumpfile to make it possible to specify --split
option and -F option at the same time. This is going to be done
separately.
Signed-off-by: HATAYAMA Daisuke <d.hatayama(a)jp.fujitsu.com>
---
dracut-kdump.sh | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index d9e65ac..76494ab 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -88,6 +88,8 @@ dump_fs()
{
local _dev=$(findmnt -k -f -n -r -o SOURCE $1)
local _mp=$(findmnt -k -f -n -r -o TARGET $1)
+ local _savedir="$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR"
+ local _nr_cpus=$(grep processor /proc/cpuinfo | wc -l)
echo "kdump: dump target is $_dev"
@@ -100,16 +102,23 @@ dump_fs()
# Remove -F in makedumpfile case. We don't want a flat format dump here.
[[ $CORE_COLLECTOR = *makedumpfile* ]] && CORE_COLLECTOR=`echo $CORE_COLLECTOR | sed -e "s/-F//g"`
- echo "kdump: saving to $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/"
+ echo "kdump: saving to $_savedir"
mount -o remount,rw $_mp || return 1
- mkdir -p $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR || return 1
+ mkdir -p $_savedir || return 1
- save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/"
+ save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_savedir"
echo "kdump: saving vmcore"
- $CORE_COLLECTOR /proc/vmcore $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete || return 1
- mv $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore
+ if [[ $CORE_COLLECTOR = *makedumpfile* && $_nr_cpus > 1 ]] ; then
+ $CORE_COLLECTOR --split /proc/vmcore $(seq -s " " -f "$_savedir/vmcore-incomplete-%g" $_nr_cpus) || return 1
+ for i in $(seq $_nr_cpus); do
+ mv $_savedir/vmcore-incomplete-$i $_savedir/vmcore-$i
+ done
+ else
+ $CORE_COLLECTOR /proc/vmcore $_savedir/vmcore-incomplete || return 1
+ mv $_savedir/vmcore-incomplete $_savedir/vmcore
+ fi
sync
echo "kdump: saving vmcore complete"
--
1.8.5.3
9 years, 1 month
[PATCH] README: Add a README file
by Vivek Goyal
Add a README file which explains what's the process for kexec-tools patch
inclusion and where one should post patches for review. This should help
with removing some confusion.
Signed-off-by: Vivek Goyal <vgoyal(a)redhat.com>
---
README | 12 ++++++++++++
1 file changed, 12 insertions(+)
Index: kexec-tools-fedora/README
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-fedora/README 2014-03-27 14:44:38.210938613 -0400
@@ -0,0 +1,12 @@
+Adding a patch to kexec-tools
+=============================
+There is a mailing list kexec(a)lists.fedoraproject.org where all the dicussion
+related to fedora kexec-tools happen. All the patches are posted there for
+inclusion and committed to kexec-tools after review.
+
+So if you want your patches to be included in fedora kexec-tools package,
+post these to kexec(a)lists.fedoraproject.org.
+
+One can subscribe to list and browse through archives here.
+
+https://admin.fedoraproject.org/mailman/listinfo/kexec
9 years, 2 months
[PATCH 1/6] fence_kdump for generic clusters v3: Rename FENCE_KDUMP_CONFIG to FENCE_KDUMP_CONFIG_FILE
by mperina@redhat.com
Bug-Url: https://bugzilla.redhat.com/1079821
Signed-off-by: Martin Perina <mperina(a)redhat.com>
---
dracut-kdump.sh | 4 ++--
dracut-module-setup.sh | 2 +-
kdump-lib.sh | 2 +-
kdumpctl | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index d9e65ac..06e41bc 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -292,8 +292,8 @@ fence_kdump_notify()
local nodes
if [ -f $FENCE_KDUMP_NODES ]; then
- if [ -f $FENCE_KDUMP_CONFIG ]; then
- . $FENCE_KDUMP_CONFIG
+ if [ -f $FENCE_KDUMP_CONFIG_FILE ]; then
+ . $FENCE_KDUMP_CONFIG_FILE
fi
read nodes < $FENCE_KDUMP_NODES
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index bdadf7c..cd60cf1 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -444,7 +444,7 @@ kdump_check_fence_kdump () {
echo "$nodes" > ${initdir}/$FENCE_KDUMP_NODES
dracut_install $FENCE_KDUMP_SEND
- dracut_install -o $FENCE_KDUMP_CONFIG
+ dracut_install -o $FENCE_KDUMP_CONFIG_FILE
}
# Install a random seed used to feed /dev/urandom
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 384f7b4..db0615f 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -3,7 +3,7 @@
# Kdump common variables and functions
#
-FENCE_KDUMP_CONFIG="/etc/sysconfig/fence_kdump"
+FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
FENCE_KDUMP_NODES="/etc/fence_kdump_nodes"
diff --git a/kdumpctl b/kdumpctl
index 8d5498a..24fb988 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -249,8 +249,8 @@ function check_rebuild()
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
files="$KDUMP_CONFIG_FILE $kdump_kernel $EXTRA_BINS"
- if [ -f $FENCE_KDUMP_CONFIG ]; then
- files="$files $FENCE_KDUMP_CONFIG"
+ if [ -f $FENCE_KDUMP_CONFIG_FILE ]; then
+ files="$files $FENCE_KDUMP_CONFIG_FILE"
fi
check_exist "$files" && check_executable "$EXTRA_BINS"
--
1.8.3.1
9 years, 2 months
[Patch v4 1/6] introduce several basic utility function
by Baoquan He
These utility function will be shared by several files, they are all
operation related to mount stuff.
Meantime define DEFAULT_PATH="/var/crash".
Signed-off-by: Baoquan He <bhe(a)redhat.com>
Acked-by: Vivek Goyal <vgoyal(a)redhat.com>
---
kdump-lib.sh | 21 +++++++++++++++++++++
mkdumprd | 2 +-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 384f7b4..fdcde83 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -3,6 +3,7 @@
# Kdump common variables and functions
#
+DEFAULT_PATH="/var/crash/"
FENCE_KDUMP_CONFIG="/etc/sysconfig/fence_kdump"
FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
FENCE_KDUMP_NODES="/etc/fence_kdump_nodes"
@@ -61,3 +62,23 @@ get_root_fs_device()
return
}
+get_mntpoint_from_path()
+{
+ echo $(df $1 | tail -1 | awk '{print $NF}')
+}
+
+get_target_from_path()
+{
+ echo $(df $1 | tail -1 | awk '{print $1}')
+}
+
+get_fs_type_from_target()
+{
+ echo $(findmnt -k -f -n -r -o FSTYPE $1)
+}
+
+get_mntpoint_from_target()
+{
+ echo $(findmnt -k -f -n -r -o TARGET $1)
+}
+
diff --git a/mkdumprd b/mkdumprd
index bb1e01e..0295009 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -12,7 +12,7 @@ export IN_KDUMP=1
conf_file="/etc/kdump.conf"
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
SAVE_PATH=$(grep ^path $conf_file| cut -d' ' -f2)
-[ -z "$SAVE_PATH" ] && SAVE_PATH="/var/crash"
+[ -z "$SAVE_PATH" ] && SAVE_PATH=$DEFAULT_PATH
extra_modules=""
dracut_args=("--hostonly" "-o" "plymouth dash resume")
OVERRIDE_RESETTABLE=0
--
1.8.5.3
9 years, 2 months
Add fence_kdump support for generic cluster v3
by mperina@redhat.com
Hi,
After long discussion about fence_kdump config files (where those files
should be located and which packages should own them) I propose this
solution to support fence_kdump configuration for generic clusters:
- Add two new options to kdump.conf
fence_kdump_nodes
- List of hosts separated by space to send fence_kdump
notification to (this option is mandatory to enable
fence_kdump)
fence_kdump_args
- Command line arguments for fence_kdump_send (it can
contain all valid arguments except hosts to send
notification to)
- Modify kdump behavior due to new options
1) If fence_kdump_nodes option is set and fence_kdump_send
is found and executable -> configure network for kdump
and execute fence_kdump_send with those nodes (and also
with args specified in fence_kdump_args if not empty)
2) If fence_kdump_nodes is not set, try to configure fence_kdump
using cluster settings (current behavior). This should stay
in kexec-tools not to break compatibility and can be removed
after Pacemaker will start using new options.
Do you agree?
Martin Perina
9 years, 2 months