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
8 years, 4 months
[PATCH v4 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 v4:
1. Using a global variable DUMP_MODE to store current dump mode.
2. Updated the fadump-howto.txt doc based on review comments.
---
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 | 250 +++++++++++++++++++++++++++++++++++++++++++
kdumpctl | 312 ++++++++++++++++++++++++++++++++++++++++++++++--------
3 files changed, 516 insertions(+), 49 deletions(-)
create mode 100644 fadump-howto.txt
--
-Hari
9 years, 4 months
[Patch v7 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".
v5-> v6:
Since in rhel7 nfs4 becomes default nfs version, and its fstype is
nfs4. So change the implementation of get_fs_type_from_target(),
whatever fstype returned from findmount, just echo nfs as fstype for all
nfs version.
v6->v7:
Introduce is_fs_type_nfs to check if fstype is nfs or nfs4 per Vivek's
idea.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
kdump-lib.sh | 28 ++++++++++++++++++++++++++++
mkdumprd | 2 +-
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 831d063..e20197e 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_FILE="/etc/sysconfig/fence_kdump"
FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
@@ -21,6 +22,13 @@ is_raw_dump_target()
grep -q "^raw" /etc/kdump.conf
}
+is_fs_type_nfs()
+{
+ local _fstype=$1
+ [ $_fstype = "nfs" ] || [ $_fstype = "nfs4" ] && return 0
+ return 1
+}
+
strip_comments()
{
echo $@ | sed -e 's/\(.*\)#.*/\1/'
@@ -82,6 +90,26 @@ 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)
+}
+
# get_option_value <option_name>
# retrieves value of option defined in kdump.conf
get_option_value() {
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, 4 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, 4 months
[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, 5 months
[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, 5 months
[PATCH] add static route support if target address is not local
by Baoquan He
If configuration for a network interface is static, and one target
address is not local and the gateway field is not provided, the static
route need be added.
In this patch, get that route and write it into /etc/route-$netif, it
looks like below:
192.168.200.222 via 192.168.100.222 dev eth0
---
dracut-module-setup.sh | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 2a16900..3467d35 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -70,11 +70,20 @@ kdump_setup_dns() {
#checking /etc/sysconfig/network-scripts/ifcfg-$1,
#if it use static ip echo it, or echo null
kdump_static_ip() {
+ local _gateway
+ local _target=$2 _f="/etc/sysconfig/network-scripts/route-$1"
+
. /etc/sysconfig/network-scripts/ifcfg-$1
if [ -n "$IPADDR" ]; then
- [ -z "$NETMASK" -a -n "$PREFIX" ] && \
- NETMASK=$(ipcalc -m $IPADDR/$PREFIX | cut -d'=' -f2)
- echo -n "${IPADDR}::${GATEWAY}:${NETMASK}::"
+ if [ -z "$GATEWAY" ]; then
+ [ -n "$_target" ] && _gateway=$(ip route get to $_target|grep via|cut -d' ' -f1,2,3,4,5)
+ #[ -n "$_gateway" ] && echo $_gateway > ${initdir}/etc/route-$1
+ [ -n "$_gateway" ] && [ -e "$_f" ]&& cp $_f ${initdir}/etc/route-$1
+ fi
+
+ [ -z "$NETMASK" -a -n "$PREFIX" ] && \
+ NETMASK=$(ipcalc -m $IPADDR/$PREFIX | cut -d'=' -f2)
+ echo -n "${IPADDR}::${GATEWAY}:${NETMASK}::"
fi
}
@@ -183,13 +192,14 @@ kdump_setup_znet() {
kdump_setup_netdev() {
local _netdev=$1
local _static _proto _ip_conf _ip_opts _ifname_opts
+ local _target=$2
if [ "$(uname -m)" = "s390x" ]; then
kdump_setup_znet $_netdev
fi
_netmac=$(kdump_get_mac_addr $_netdev)
- _static=$(kdump_static_ip $_netdev)
+ _static=$(kdump_static_ip $_netdev $_target)
if [ -n "$_static" ]; then
_proto=none
else
@@ -245,7 +255,7 @@ kdump_install_net() {
_netdev=`echo $_netdev|awk '{print $3}'|head -n 1`
fi
- kdump_setup_netdev "${_netdev}"
+ kdump_setup_netdev "${_netdev}" "${_server}"
#save netdev used for kdump as cmdline
# Whoever calling kdump_install_net() is setting up the default gateway,
@@ -400,7 +410,7 @@ kdump_setup_iscsi_device() {
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \
sed 's|.*dev \(.*\).*|\1|g' | awk '{ print $1; exit }')
- kdump_setup_netdev $netdev
+ kdump_setup_netdev $netdev ${tgt_ipaddr}
# prepare netroot= command line
# FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr
--
1.9.0
9 years, 5 months
[PATCH 0/2] clean up git repo and spec file
by WANG Chao
Hi, All
A while a ago, Vivek found the dead file, kdump.init is still in our fedora git
repo. I decide to remove it along with some cleanup of ia64 build in
kexec-tools rpm spec.
I think I will push these changes unless you guys have problem with it.
Thanks
WANG Chao
WANG Chao (2):
remove dead file kdump.init
kexec-tools.spec: remove ia64 architecture
kdump.init | 380 -------------------------------------------------------
kexec-tools.spec | 34 +----
2 files changed, 7 insertions(+), 407 deletions(-)
delete mode 100644 kdump.init
--
1.9.0
9 years, 5 months
[PATCH] mkdumprd: stop passing nofail mount option
by WANG Chao
In current systemd implementation, nofail mount will not block
local-fs.target, which means our kdump.sh (in dracut-pre-pivot.service)
can't wait for nofail mount. And kdump.sh could run early than nofail
mount happens.
For short term, let's stop passing nofail to mount. As for
sysroot.mount, since we have explicitly specify to wait for it, "nofail"
isn't a problem.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
mkdumprd | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index 84f1e18..6e9dc47 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -103,7 +103,9 @@ to_mount() {
_t=$(findmnt -k -f -n -r -o TARGET,FSTYPE $_dev)
_o=$(findmnt -k -f -n -r -o OPTIONS $_dev)
_o=${_o/#ro/rw} #mount fs target as rw in 2nd kernel
- _o="${_o},nofail" #with nofail set, systemd won't block for mount failure
+ # "nofail" mount could be run later than kdump.sh. So we don't pass nofail
+ # for short term.
+ #_o="${_o},nofail" #with nofail set, systemd won't block for mount failure
_mntopts="$_t $_o"
#for non-nfs _dev converting to use udev persistent name
if [ -b "$_s" ]; then
--
1.8.5.3
9 years, 5 months