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 v3] fix the corner case of static route
by Baoquan He
Previously for fixing the static route problem, all routes get through
a specific network interface will be saved and added in 2nd kernel.
Search pattern is used to get routes:
/sbin/ip route show | grep -v default | grep "^[[:digit:]].*via.* $_netdev"
An exception existed though, that is 2 machines connected directly and the
network interfaces wihch are configured as in different network subnets.
So in the v1 and v2, "ip route get to $target" command is executed and an
exact route to a target is saved and added in 2nd kernel. This works for
static route issue and can fix the corner case above.
v1:
Introduced the new way which get exact route to remote target.
v1->v2:
Since a grammer error which saved exact route, v2 is posted.
v2->v3:
Per Vivek's comment, route to target should not be related to
static ip issues. So in v3 introduced the get_routes function
and take it out of kdump_static_ip.
Baoquan He (1):
save exact route to remote target
dracut-module-setup.sh | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)
--
1.9.0
8 years, 7 months
[PATCH] kdump-emergency.service: executable uses absolute path
by WANG Chao
Bao noticed the following systemd warning:
systemd[1]: [/usr/lib/systemd/system/emergency.service:17] Executable path is
not absolute, ignoring: systemctl --no-block isolate kdump-error-handler.service
It turns out that now systemd doesn't allow relative path for an executable, we
must adapt that, make the change.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
Tested-by: Baoquan He <bhe(a)redhat.com>
---
dracut-kdump-emergency.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-kdump-emergency.service b/dracut-kdump-emergency.service
index a64610c..fb764f2 100644
--- a/dracut-kdump-emergency.service
+++ b/dracut-kdump-emergency.service
@@ -14,7 +14,7 @@ Description=Kdump Emergency
DefaultDependencies=no
[Service]
-ExecStart=systemctl --no-block isolate kdump-error-handler.service
+ExecStart=/usr/bin/systemctl --no-block isolate kdump-error-handler.service
Type=oneshot
StandardInput=tty-force
StandardOutput=inherit
--
1.9.3
8 years, 9 months
[PATCH] spec: install udev rules 98-kexec.rules to /usr/lib not /etc
by WANG Chao
Resolves: rhbz#1131169
Zbigniew (systemd developer) pointed out that our udev rules should
install to /usr/lib/ not /etc. Because /etc is supposed to be used by
sysadmins only and package should install by default into /usr/lib.
As advised here:
http://www.freedesktop.org/software/systemd/man/udev.html#Rules%20Files
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kexec-tools.spec | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 8207bbb..6e9429a 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -165,7 +165,7 @@ mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man8/
mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/man5/
mkdir -p -m755 $RPM_BUILD_ROOT%{_docdir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_datadir}/kdump
-mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d
+mkdir -p -m755 $RPM_BUILD_ROOT%{_udevrulesdir}
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_bindir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}
@@ -187,7 +187,7 @@ install -m 755 %{SOURCE24} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib-initram
%ifnarch s390x
# For s390x the ELF header is created in the kdump kernel and therefore kexec
# udev rules are not required
-install -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/98-kexec.rules
+install -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_udevrulesdir}/98-kexec.rules
%endif
install -m 644 %{SOURCE15} $RPM_BUILD_ROOT%{_mandir}/man5/kdump.conf.5
install -m 644 %{SOURCE16} $RPM_BUILD_ROOT%{_unitdir}/kdump.service
@@ -322,7 +322,7 @@ done
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/kdump
%config(noreplace,missingok) %{_sysconfdir}/kdump.conf
%ifnarch s390x
-%config %{_sysconfdir}/udev/rules.d/*
+%config %{_udevrulesdir}
%endif
%{dracutlibdir}/modules.d/*
%dir %{_localstatedir}/crash
--
1.9.3
8 years, 9 months
[PATCH] fix the corner case of static route
by Baoquan He
In static route handling, one corner case is ignored. That is 2 machines
are directly connected while IPs configured are in the different subnet.
Say the IP of NIC1 on machine A is 192.168.10.1/24, the IP of NIC2 on
machine B is 192.168.20.1/24. Then on machine A, a route need be specified:
192.168.20.0/24 dev NIC1
On machine B:
192.168.10.0/24 dev NIC2
Without these routes connection from NIC1 to NIC2 can't be setup.
So if in machine A the dump target is set as machine B, route
"192.168.20.0/24 dev NIC1" has to be added in kdump kernel. But this is ignored
in previous handling since we use below patch to find all routes:
/sbin/ip route show | grep -v default | grep "^[[:digit:]].*via.* $_netdev "
Now in this patch use "/sbin/ip route get to $_target" to get the exact route
to the target.
sh> ip route get to 192.168.20.2
192.168.20.2 via 192.168.10.2 dev ens10 src 192.168.10.1
192.168.10.1 -> 192.168.20.2 -> 192.168.20.1 -> 192.168.20.2
or
sh> ip route get to 192.168.20.2
192.168.20.2 dev ens10 src 192.168.10.1
192.168.10.1 -> 192.168.20.2
And write the static route to config file only if static ip address configured
on this network interface.
---
dracut-module-setup.sh | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 8fa59ca..fda50cd 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -75,15 +75,24 @@ kdump_static_ip() {
local _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}::"
+ _netmask=$(ipcalc -m $_ipaddr | cut -d'=' -f2)
+ _gateway=$(ip route list dev $_netdev | awk '/^default /{print $3}')
+ echo -n "${_srcaddr}::${_gateway}:${_netmask}::"
+
+
+ local _route
+ _route=`/sbin/ip route get to $_target 2>&1`
+ if [ -n "`echo $_route | grep via`" ]
+ then
+ # route going to a different subnet via a router
+ echo $_route | awk '{printf("rd.route=%s:%s:%s\n", $1, $3, $5)}' \
+ >> ${initdir}/etc/cmdline.d/45route-static.conf
+ else
+ # route going to a different subnet though directly connected
+ echo $_route | awk '{printf("rd.route=%s:%s:%s\n", $1, $3)}' \
+ >> ${initdir}/etc/cmdline.d/45route-static.conf
+ fi
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() {
--
1.9.0
8 years, 9 months
[PATCH] dracut-module-setup: allow short hostname in cluster configuration
by WANG Chao
Node could be referenced by short hostname (hostname -s) in cluster
configuration:
[root@virt-068 /]# pcs status nodes
Pacemaker Nodes:
Online: virt-066 virt-067 virt-068
Standby:
Offline:
We didn't know it before. Martin noticed the kdump failure, and provide
this fix. Thanks to Martin.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
Tested-by: Martin Juricek <mjuricek(a)redhat.com>
---
dracut-module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 8fa59ca..02a0557 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -502,7 +502,7 @@ get_pcs_fence_kdump_nodes() {
eval $node
nodename=$uname
# Skip its own node name
- if [ "$nodename" = `hostname` ]; then
+ if [ "$nodename" = `hostname` -o "$nodename" = `hostname -s` ]; then
continue
fi
nodes="$nodes $nodename"
--
1.9.3
8 years, 9 months
[Patch] Allow short nodenames in cluster configuration
by Martin Juricek
This patch fixes the kdump poblem with short nodenames used in cluster
configuration in RHEL7 (bz1126400).
git clone: git://pkgs.devel.redhat.com/rpms/kexec-tools
branch: rhel-7.1
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 87ad072..5db9b11 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -472,7 +472,7 @@ get_pcs_fence_kdump_nodes() {
eval $node
nodename=$uname
# Skip its own node name
- if [ "$nodename" = `hostname` ]; then
+ if [ "$nodename" = `hostname` -o "$nodename" = `hostname -s` ];
then
continue
fi
nodes="$nodes $nodename"
8 years, 10 months
kdump on F20 saving vmcore-dmesg.txt fails
by Vivek Goyal
Hi Chao,
Today I tried to take dump on my F20 virtual machine and saving
vmcore-dmesg.txt fails.
I had fixed it upstream. Do we need to backport fix to F20 kexec-tools
or is it something else.
Thanks
Vivek
8 years, 10 months
[PATCH 0/2] systemd takes care of shutdown
by WANG Chao
Hi,
This is about handling the shutdown path in kdump boot, including two small
pieces.
As Vivek suggested, systemd now will take care of the reboot/poweroff/halt and
also unmount everything (including dump target). It's like what a normal boot
does, and among all the advantanges, at least we don't have to worry about the
data sync issue any more. systemd would do all that for us.
Any objection to this switch?
WANG Chao (2):
do not force shutdown
Let systemd handle unmount
kdump-lib-initramfs.sh | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
--
1.9.3
8 years, 10 months
[PATCH v2] kdumpctl, fadump: only use lsinitrd when initramfs exists in fadump mode
by WANG Chao
When there's no kdump initramfs for lsinitrd to inspect with, there will
be an error:
# kdumpctl start
/boot/initramfs-3.16.0-rc7+kdump.img does not exist
Usage: lsinitrd [options] [<initramfs file> [<filename> [<filename> [...] ]]]
Usage: lsinitrd [options] -k <kernel version>
-h, --help print a help message and exit.
-s, --size sort the contents of the initramfs by size.
-m, --mod list modules.
-f, --file <filename> print the contents of <filename>.
-k, --kver <kernel version> inspect the initramfs of <kernel version>.
No kdump initial ramdisk found.
Rebuilding /boot/initramfs-3.16.0-rc7+kdump.img
[..]
In addition, lsinitrd is a slow operation. We only run it when it's
fadump mode, to speed up in kdump mode.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kdumpctl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 98de747..d4879da 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -364,7 +364,9 @@ check_rebuild()
done
#check if target initrd has fadump support
- initramfs_has_fadump=`lsinitrd -m $TARGET_INITRD | grep ^kdumpbase$ | wc -l`
+ if [ "$DEFAULT_DUMP_MODE" = "fadump" ] && [ -f "$TARGET_INITRD" ]; then
+ initramfs_has_fadump=`lsinitrd -m $TARGET_INITRD | grep ^kdumpbase$ | wc -l`
+ fi
if [ $image_time -eq 0 ]; then
echo -n "No kdump initial ramdisk found."; echo
--
1.9.3
8 years, 10 months