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
[PATCH] kdump, remove panic_on_warn from 2nd kernel cmdline
by Prarit Bhargava
With the inclusion of 'panic_on_warn',
http://marc.info/?l=linux-api&m=141570937328528&w=2
and which is now staged in Andrew Morton's tree, we need to remove
'panic_on_warn' from the 2nd kernel's cmdline. If it is included it is
possible a non-fatal warning could panic the second kernel.
Before:
[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0+
root=/dev/mapper/rhel_intel--canoepass--05-root ro
rd.lvm.lv=rhel_intel-canoepass-05/root
rd.lvm.lv=rhel_intel-canoepass-05/swap console=ttyS0,115200n81
LANG=en_US.UTF-8 systemd.debug panic_on_warn=1 irqpoll nr_cpus=1
reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2
panic=10 rootflags=nofail acpi_no_memhotplug disable_cpu_apicid=0
elfcorehdr=839092K
After:
[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0+
root=/dev/mapper/rhel_intel--canoepass--05-root ro
rd.lvm.lv=rhel_intel-canoepass-05/root
rd.lvm.lv=rhel_intel-canoepass-05/swap console=ttyS0,115200n81
LANG=en_US.UTF-8 systemd.debug irqpoll nr_cpus=1 reset_devices
cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10
rootflags=nofail acpi_no_memhotplug disable_cpu_apicid=0
elfcorehdr=839092K
Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
---
kdumpctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index ee3214a..a9e5d2e 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -105,7 +105,7 @@ prepare_cmdline()
else
cmdline=${KDUMP_COMMANDLINE}
fi
- cmdline=`remove_cmdline_param "$cmdline" crashkernel hugepages hugepagesz`
+ cmdline=`remove_cmdline_param "$cmdline" crashkernel hugepages hugepagesz panic_on_warn`
cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
--
1.7.9.3
8 years, 5 months
[PATCH] kdump: fix OOM issue when vm.min_free_kbytes is set too high
by Hari Bathini
When the value of vm.min_free_kbytes is set too high in /etc/sysctl.conf,
kdump kernel fails with OOM. As min_free_kbytes may not be relevant for
kdump kernel, this patch tries to fix the issue by removing it from the
file sysctl.conf and thus forcing default value for vm.min_free_kbytes
parameter.
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
---
dracut-module-setup.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index dcebc47..6ada7d3 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -612,6 +612,11 @@ install() {
# Also redirect dracut-emergency to kdump error handler
ln_r "$systemdsystemunitdir/emergency.service" "$systemdsystemunitdir/dracut-emergency.service"
+ # While min_free_kbytes may not be relevant for kdump kernel,
+ # it leads to OOM in cases where this value is too high.
+ # Let's be paranoid and force it to default value calculated in kernel.
+ sed -e "/^$/d" -e "/^#/d" -e "/min_free_kbytes/d" /etc/sysctl.conf > "${initdir}/etc/sysctl.conf"
+
# Check for all the devices and if any device is iscsi, bring up iscsi
# target. Ideally all this should be pushed into dracut iscsi module
# at some point of time.
8 years, 6 months
[PATCH v2 1/2] module-setup: move kdump_setup_netdev early when handling iscsi
by WANG Chao
Move kdump_setup_netdev in iscsi handling path early. Because when we
detect ibft or firmware iscsi session, we will bail out early, but still
need to bring up network device in 2nd kernel.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-module-setup.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index dcebc47..b6218b3 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -434,8 +434,15 @@ kdump_setup_iscsi_device() {
return 1
fi
- tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn\[0\].address")
+ netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \
+ sed 's|.*dev \(.*\).*|\1|g')
+ srcaddr=$(echo $netdev | awk '{ print $3; exit }')
+ netdev=$(echo $netdev | awk '{ print $1; exit }')
+
+ kdump_setup_netdev $netdev $srcaddr $tgt_ipaddr
+
+ tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
# get and set username and password details
username=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.username")
@@ -452,13 +459,6 @@ kdump_setup_iscsi_device() {
[ -n "$username_in" ] && userpwd_in_str=":$username_in:$password_in"
- netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \
- sed 's|.*dev \(.*\).*|\1|g')
- srcaddr=$(echo $netdev | awk '{ print $3; exit }')
- netdev=$(echo $netdev | awk '{ print $1; exit }')
-
- kdump_setup_netdev $netdev $srcaddr $tgt_ipaddr
-
# prepare netroot= command line
# FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr
# FIXME: Do we need to parse and set other parameters like protocol, port
--
1.9.3
8 years, 6 months
[PATCH] kdump-initramfs-lib: Fix core_collector issue
by WANG Chao
In ssh or raw dump case, if user do not specify "core_collector" in
kdump.conf, kdump will fail. Because global DEFAULT_CORE_COLLECTOR
variable isn't applied to CORE_COLLECTOR. Now fix it.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kdump-lib-initramfs.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index f882b09..71986be 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -77,7 +77,7 @@ get_kdump_confs()
if is_ssh_dump_target || is_raw_dump_target; then
if [ -z "$user_specified_cc" ]; then
- CORE_COLLECTOR="$CORE_COLLECTOR -F"
+ CORE_COLLECTOR="$DEFAULT_CORE_COLLECTOR -F"
fi
fi
--
1.9.3
8 years, 6 months
Re: Fwd: Re: [PATCH 2/3] module-setup: add two functions to determine iBFT
by Chris Leech
On Mon, Nov 24, 2014 at 03:02:05PM -0800, Andy Grover wrote:
> iBFT-fu = you. Or I can take a stab.. -A
Hi, jumping in here without full context but ...
You can check the iSCSI node records node.discovery_type value for "fw"
(iBFT being the most common type of firmware discovery). Non-firmware
records will be set to something else like send_targets, static, isns.
- Chris
> -------- Forwarded Message --------
> Subject: Re: [PATCH 2/3] module-setup: add two functions to determine iBFT
> Date: Mon, 24 Nov 2014 17:35:13 -0500
> From: Vivek Goyal <vgoyal(a)redhat.com>
> To: WANG Chao <chaowang(a)redhat.com>
> CC: kexec(a)lists.fedoraproject.org, emilne(a)redhat.com, agrover(a)redhat.com
>
> On Thu, Nov 13, 2014 at 03:58:42PM +0800, WANG Chao wrote:
> >If iBFT (iscsi Boot Firmware Table) is configured, we don't have to pass the
> >setup information to 2nd kernel. Because with cmdline argument
> >"rd.iscsi.ibft", dracut will automatically retrieve the setup information
> >from BIOS's ROM or network device's optional-ROM (not from HBA's firmware)
> >
> >Add two functions to do the check. One is checking if we have
> >"rd.iscsi.ibft" or its equivalents specified in kernel cmdline. The other is
> >to check if the current iscsi session is iBFT.
> >
> >Because I don't find a reliable way to tell if an iscsi session is using the
> >configurations from iBFT, I marked the second functions as "FIXME" and it
> >always returns false. That means we don't handle iBFT yet. In the future,
> >if someone is asking iBFT support, we can gather some data and finish the
> >work.
>
> If we can't figure out if a connection is using iBFT or not, then we
> should not have this patch.
>
> I am Ccing Ewan and Andy Grover. May be they have an idea how to figure
> out if a particular session/connection is using iBFT or not.
>
> Thanks
> Vivek
>
> >
> >Signed-off-by: WANG Chao <chaowang(a)redhat.com>
> >---
> > dracut-module-setup.sh | 26 ++++++++++++++++++++++++++
> > 1 file changed, 26 insertions(+)
> >
> >diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
> >index bca21ea..780601a 100755
> >--- a/dracut-module-setup.sh
> >+++ b/dracut-module-setup.sh
> >@@ -422,6 +422,11 @@ kdump_is_iscsi_hw_session() {
> > return 0
> > }
> >
> >+# FIXME: determine iBFT
> >+kdump_is_iscsi_ibft_session() {
> >+ return 1
> >+}
> >+
> > # kernel cmdline must contain these either of the following arguments
> > # for booting off hardware iSCSI:
> > # rd.iscsi.firmware[=1], iscsi_firmware
> >@@ -443,6 +448,27 @@ kdump_is_iscsi_hw_cmdline() {
> > return 1
> > }
> >
> >+# kernel cmdline must contain these either of the following arguments
> >+# for booting off iBFT:
> >+# rd.iscsi.ibft[=1], ip=ibft
> >+kdump_is_iscsi_ibft_cmdline() {
> >+ local cmdline
> >+
> >+ cmdline="$(cat /proc/cmdline)"
> >+
> >+ for arg in $cmdline; do
> >+ case "$arg" in
> >+ "rd.iscsi.ibft" |\
> >+ "rd.iscsi.ibft=1" |\
> >+ "ip=ibft")
> >+ return 0
> >+ ;;
> >+ esac
> >+ done
> >+
> >+ return 1
> >+}
> >+
> > # No ibft handling yet.
> > kdump_setup_iscsi_device() {
> > local path=$1
> >--
> >1.9.3
> >
> >_______________________________________________
> >kexec mailing list
> >kexec(a)lists.fedoraproject.org
> >https://lists.fedoraproject.org/mailman/listinfo/kexec
>
>
8 years, 6 months
[PATCH 0/3] Hardware iSCSI support
by WANG Chao
This patchset adds support for hardware iscsi. It's previously one big patch,
and now I break it down to three.
Along with this patch, I add the infrastructure of determine iBFT, but it's not
complete yet, because I don't know how to determine it in a reliable way. Mark
this part as FIXME. Perhaps in the future someone ask for iBFT and we can
gather some data there, and finish this part.
WANG Chao (3):
module-setup: add two functions to determine hardware iscsi
module-setup: add two functions to determine iBFT
Hardware iSCSI support
dracut-module-setup.sh | 81 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 80 insertions(+), 1 deletion(-)
--
1.9.3
8 years, 6 months
Error message did not show up in journal
by Vivek Goyal
Hi Chao,
On my F21 laptop I tried to start kdump service "systemctl start kdump"
and it failed. I tried to figure out what's wrong and did "systemctl
status kdump" but I don't see any messages there.
[vgoyal@localhost ~]$ systemctl status kdump.service
● kdump.service - Crash recovery kernel arming
Loaded: loaded (/usr/lib/systemd/system/kdump.service; disabled)
Active: failed (Result: exit-code) since Wed 2014-11-19 11:49:43
EST; 4s ago
Process: 31725 ExecStart=/usr/bin/kdumpctl start (code=exited,
status=1/FAILURE)
Main PID: 31725 (code=exited, status=1/FAILURE)
When I ran "kdumpctl start" manually, It showed that no memory is
reserved.
I think this message should go to journal so that systemd can show it.
I am wondering what's the problem here.
Thanks
Vivek
8 years, 6 months
[PATCH v3] Enhance kdump to support ipv6
by Minfei Huang
Description:
Currently kdump doesn't support ipv6 nfs/ssh dump. Ipv6 is the latest version
of the Internet Protocal. so it is a significant feture for kdump to enhance
to support ipv6.
Solutions:
Since dracut has supported ipv6 now, it is easy to change the kdump code to
support ipv6. Just need pass the right _ip_opts to the second kernle. What is
the main difference in userspace bettwen ipv4 and ipv6 is the ip address format.
For ipv6 nfs dump:
if ipv6 address type is link scope, /etc/kdump.conf should be edited like
"nfs [fe80::5054:ff:fe48:ca80%eth0]:/mnt"
else /etc/kdump.conf should be edited like "nfs [2001:db8:0:f101::2]:/mnt"
For ipv6 ssh dump
if ipv6 address type is link scope, /etc/kdump.conf should be edited like
"ssh root at fe80::5054:ff:fe48:ca80%eth0"
else /etc/kdump.conf should be edited like "ssh root at 2001:db8:0:f101::2"
What this patch do is:
a): Add a function is_ipv6_target to tell what version of Internet Protocal
(ipv4/ipv6) kdump will use to dump to remote target.
b): Modify kdump_install_net to handle ipv6 configuration in /etc/kdump.conf
correctly. Get the ipv6 address from /etc/kdump.conf is more complicated
than ipv4 because the difference configuration format mentioned above.
c): Based on the ip address type, using corresponding ip address as HOST_IP
in second kernel.
It was tested for IPV6 and IPV4 address in beaker machine and passed.
Note:
1): Currntly only f19 support remount a nfs target in ipv6. detail in https:
//bugzilla.redhat.com/show_bug.cgi?id=1099761. If using in f20, you can
comment out "mount -o remount,rw $_mp || return 1" in kdump.sh line 105.
2): If Using static ipv6 address and configuring nfs/ssh with hostname of
remote target, MUST add a ipv6 DNS in ifcfg-devname.
How to create a ipv6 enviromnet.
1): Reserving two beaker machine with family fedora.
2): Choosing a beaker machine as a nfs/ssh server and delete it's ipv4 address
by "ip address del ipv4-address dev nicname"
3): Configuring the /etc/kdump.conf like mentioned above.
Signed-off-by: Arthur Zou <zzou(a)redhat.com>
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
Change in v3:
- using the command getenv ahost to get address information.
- suport static ipv6 route
Change in v2:
- modify patch format
dracut-kdump.sh | 8 +++--
dracut-module-setup.sh | 80 +++++++++++++++++++++++++++++++++++---------------
kdump-lib.sh | 33 +++++++++++++++++++++
3 files changed, 96 insertions(+), 25 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 600e84e..9f12084 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -121,9 +121,13 @@ get_host_ip()
then
kdumpnic=$(getarg kdumpnic=)
[ -z "$kdumpnic" ] && echo "kdump: failed to get kdumpnic!" && return 1
- _host=`ip addr show dev $kdumpnic|grep 'inet '`
+ if is_ipv6_target; then
+ _host=`ip addr show dev $kdumpnic|grep 'inet6'`
+ else
+ _host=`ip addr show dev $kdumpnic|grep 'inet '`
+ fi
[ $? -ne 0 ] && echo "kdump: wrong kdumpnic: $kdumpnic" && return 1
- _host="${_host##*inet }"
+ _host=`echo $_host | cut -d' ' -f2`
_host="${_host%%/*}"
[ -z "$_host" ] && echo "kdump: wrong kdumpnic: $kdumpnic" && return 1
HOST_IP=$_host
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 38801de..7fb3d96 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -70,20 +70,33 @@ kdump_setup_dns() {
#$2: srcaddr
#if it use static ip echo it, or echo null
kdump_static_ip() {
- local _netmask _gateway
+ local _netmask _gateway _ipaddr
local _netdev="$1" _srcaddr="$2"
- local _ipaddr=$(ip addr show dev $_netdev permanent | \
+
+ if is_ipv6_target; then
+ _ipaddr=$(ip addr show dev $_netdev permanent | \
+ awk "/ $_srcaddr\/.* /{print \$2}")
+ if [ -n "$_ipaddr" ]; then
+ _gateway=$(ip -6 route list dev $_netdev | awk '/^default /{print $3}')
+ echo -n "[${_srcaddr}]::[${_gateway}]:64::"
+ fi
+ /sbin/ip -6 route show | grep -v default | grep "^[1-9a-f].*via.* $_netdev "|\
+ while read line; do
+ echo $line | awk '{printf("rd.route=[%s]:[%s]:%s\n", $1, $3, $5)}'
+ done >> ${initdir}/etc/cmdline.d/45route-static.conf
+ else
+ _ipaddr=$(ip addr show dev $_netdev permanent | \
awk "/ $_srcaddr\/.* $_netdev\$/{print \$2}")
- if [ -n "$_ipaddr" ]; then
- _netmask=$(ipcalc -m $_ipaddr | cut -d'=' -f2)
- _gateway=$(ip route list dev $_netdev | awk '/^default /{print $3}')
- echo -n "${_srcaddr}::${_gateway}:${_netmask}::"
+ if [ -n "$_ipaddr" ]; then
+ _netmask=$(ipcalc -m $_ipaddr | cut -d'=' -f2)
+ _gateway=$(ip route list dev $_netdev | awk '/^default /{print $3}')
+ echo -n "${_srcaddr}::${_gateway}:${_netmask}::"
+ fi
+ /sbin/ip route show | grep -v default | grep "^[[:digit:]].*via.* $_netdev " |\
+ while read line; do
+ echo $line | awk '{printf("rd.route=%s:%s:%s\n", $1, $3, $5)}'
+ done >> ${initdir}/etc/cmdline.d/45route-static.conf
fi
-
- /sbin/ip route show | grep -v default | grep "^[[:digit:]].*via.* $_netdev " |\
- while read line; do
- echo $line | awk '{printf("rd.route=%s:%s:%s\n", $1, $3, $5)}'
- done >> ${initdir}/etc/cmdline.d/45route-static.conf
}
kdump_get_mac_addr() {
@@ -264,24 +277,43 @@ kdump_install_net() {
local _server _netdev _srcaddr
local config_val="$1"
- _server=`echo $config_val | sed 's/.*@//' | cut -d':' -f1`
+ _server=`get_remote_host $config_val`
- _need_dns=`echo $_server|grep "[a-zA-Z]"`
- [ -n "$_need_dns" ] && _server=`getent hosts $_server|cut -d' ' -f1`
+ if is_ipv6_target; then
+ _need_dns=`echo $_server|grep "[:]"`
+ [ -z "$_need_dns" ] && _server=`getent hosts $_server| head -n 1 | cut -d' ' -f1`
+ else
+ _need_dns=`echo $_server|grep "[a-zA-Z]"`
+ [ -n "$_need_dns" ] && _server=`getent hosts $_server| head -n 1 | cut -d' ' -f1`
+ fi
_netdev=`/sbin/ip route get to $_server 2>&1`
[ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
- #the field in the ip output changes if we go to another subnet
- if [ -n "`echo $_netdev | grep via`" ]
- then
- # we are going to a different subnet
- _srcaddr=`echo $_netdev|awk '{print $7}'|head -n 1`
- _netdev=`echo $_netdev|awk '{print $5;}'|head -n 1`
+ if is_ipv6_target; then
+ #the field in the ip output changes if we go to another subnet
+ if [ -n "`echo $_netdev | grep via`" ]
+ then
+ # we are going to a different subnet
+ _srcaddr=`echo $_netdev|awk '{print $9}'|head -n 1`
+ _netdev=`echo $_netdev|awk '{print $7;}'|head -n 1`
+ else
+ # we are on the same subnet
+ _srcaddr=`echo $_netdev|awk '{print $7}'|head -n 1`
+ _netdev=`echo $_netdev|awk '{print $5}'|head -n 1`
+ fi
else
- # we are on the same subnet
- _srcaddr=`echo $_netdev|awk '{print $5}'|head -n 1`
- _netdev=`echo $_netdev|awk '{print $3}'|head -n 1`
+ #the field in the ip output changes if we go to another subnet
+ if [ -n "`echo $_netdev | grep via`" ]
+ then
+ # we are going to a different subnet
+ _srcaddr=`echo $_netdev|awk '{print $7}'|head -n 1`
+ _netdev=`echo $_netdev|awk '{print $5;}'|head -n 1`
+ else
+ # we are on the same subnet
+ _srcaddr=`echo $_netdev|awk '{print $5}'|head -n 1`
+ _netdev=`echo $_netdev|awk '{print $3}'|head -n 1`
+ fi
fi
kdump_setup_netdev "${_netdev}" "${_srcaddr}"
@@ -583,6 +615,8 @@ install() {
inst "/bin/date" "/bin/date"
inst "/bin/sync" "/bin/sync"
inst "/bin/cut" "/bin/cut"
+ inst "/bin/getent" "/bin/getent"
+ inst "/bin/head" "/bin/head"
inst "/sbin/makedumpfile" "/sbin/makedumpfile"
inst "/sbin/vmcore-dmesg" "/sbin/vmcore-dmesg"
inst "/lib/kdump/kdump-lib.sh" "/lib/kdump-lib.sh"
diff --git a/kdump-lib.sh b/kdump-lib.sh
index a20c6e8..0ec810a 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -138,3 +138,36 @@ check_save_path_fs()
fi
}
+# get ip address or hostname from nfs/ssh config value
+get_remote_host()
+{
+ local _config_val=$1
+
+ # in ipv6, the _config_val format is [xxxx:xxxx::xxxx%eth0]:/mnt/nfs or
+ # username at xxxx:xxxx::xxxx%eth0. what we need is just xxxx:xxxx::xxxx
+ _config_val=${_config_val#*@}
+ _config_val=${_config_val%:/*}
+ _config_val=${_config_val#[}
+ _config_val=${_config_val%]}
+ _config_val=${_config_val%\%*}
+ echo $_config_val
+}
+
+# check the remote server ip address tpye
+is_ipv6_target()
+{
+ local _server _server_tmp
+
+ if is_ssh_dump_target; then
+ _server=`get_option_value ssh`
+ elif is_nfs_dump_target; then
+ _server=`get_option_value nfs`
+ fi
+
+ [ -z "$_server" ] && return 1
+ _server=`get_remote_host $_server`
+ _server_tmp=$_server
+ _server=`getent ahosts $_server | head -n 1 | cut -d' ' -f1`
+ _server=${_server:-$_server_tmp}
+ echo $_server | grep -q ":"
+}
--
1.8.3.1
8 years, 6 months