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, 5 months
[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
9 years, 1 month
[PATCH] kdumpctl: Add the command "kdumpctl showmem" to show the reserved memory
by Minfei Huang
If the grub kernel commandline is set to crashkernel=auto, it will not
expand the crashkernel=auto in the /proc/cmdline. It still says
crashkernel=auto.
Using /sys to determines crashkernel actual size is confusing since
there is no unit of measure.
Add a new command "kdumpctl showmem" to show the reserved memory kindly.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
kdumpctl | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 70d30fa..6f27669 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -526,6 +526,17 @@ propagate_ssh_key()
fi
}
+show_reserved_mem()
+{
+ MEM_RESERVED=$(cat /sys/kernel/kexec_crash_size)
+ if [ $MEM_RESERVED -eq 0 ]
+ then
+ echo "No memory reserved for crash kernel."
+ return
+ fi
+ echo "The kdump service reserved memory is `expr $MEM_RESERVED / 1024 / 1024`MB"
+}
+
is_fadump_capable()
{
# Check if firmware-assisted dump is enabled
@@ -899,8 +910,11 @@ main ()
propagate)
propagate_ssh_key
;;
+ showmem)
+ show_reserved_mem
+ ;;
*)
- echo $"Usage: $0 {start|stop|status|restart|propagate}"
+ echo $"Usage: $0 {start|stop|status|restart|propagate|showmem}"
exit 1
esac
}
--
1.8.3.1
9 years, 1 month
Devices that can be used as raw kdump target
by Martin Milata
system-config-kdump has hardcoded whitelist of major numbers for block
devices that can be used as raw kdump targets. With the current list it
does not show virtio disks [1] as possible targets. The major device
number for virtio is assigned dynamically, thus I cannot simply add a
new number.
I have no idea how the major numbers in the list were chosen. I see
these possibilities for fixing the bug:
* Do not try to outsmart the user, throw away the list, and offer all
devices that are listed in /proc/partitions.
* Add all the numbers that can be used for dynamic assignment to the
whitelist.
* Determine whether a device is suitable by some other means. For
example, /sys/dev/block/MAJOR:MINOR/ro should contain 1 if the device
is read-only. However it contains 0 for my optical drive, so using
this is probably not as useful.
I'll be grateful for any suggestions,
Martin
[0] https://git.fedorahosted.org/cgit/system-config-kdump.git/tree/src/system...
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1077470
9 years, 2 months
[PATCH] ppc64, ppc64le: disable kvm CMA reservation in kdump kernel
by WANG Chao
By default on powerpc platform, kvm will reserve a relatively large CMA
(128M aligned) at early boot. In kdump kernel, even KVM sounds useless
but still it reserves 128M and makes kdump kernel fail to boot.
Now fix this by adding the following to kernel command line:
"kvm_cma_resv_ratio=0"
which disable the CMA reservation.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kdump.sysconfig.ppc64 | 2 +-
kdump.sysconfig.ppc64le | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
index ca7e1d8..923aa26 100644
--- a/kdump.sysconfig.ppc64
+++ b/kdump.sysconfig.ppc64
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail"
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
index ca7e1d8..923aa26 100644
--- a/kdump.sysconfig.ppc64le
+++ b/kdump.sysconfig.ppc64le
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail"
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0"
# Any additional kexec arguments required. In most situations, this should
# be left empty
--
1.9.3
9 years, 2 months
[PATCH v2] module-setup: do not add duplicate ip=xxx
by WANG Chao
In case of iscsi boot, kernel cmdline will contain ip=xxx kernel
parameter for dracut setting up iscsi root in initramfs. For example:
"root=xxx ip=192.168.3.26:::255.255.255.0:localhost.localdomain:eno19:none ..."
dracut doesn't allow duplicate ip conf for the same network card. dracut
will not ignore the either of the duplicate. Instead, it refuses to
continue:
[ 15.876306] dracut: FATAL: For argument 'ip=192.168.3.26:::255.255.255.0:localhost.localdomain:eno19:none'\n
Duplication configurations for 'eno19'
[ 16.055513] dracut: Refusing to continue ev argument for multiple ip= lines
That's why in our code we don't add a duplicate ip conf when handling
the same network card the second time. But we never consider the case
that ip conf is already added in kernel cmdline for some special
purpose, for example, iscsi boot.
Now we also look up /proc/cmdline for ip conf. If it exists, we use the
existing one. The existing one should work out of box because dracut
will handle it in second kernel like it does for first kernel. That
said, the network card will be brought up and root disk will be mounted
under /sysroot.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-module-setup.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 02a0557..38801de 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -234,7 +234,10 @@ kdump_setup_netdev() {
# dracut doesn't allow duplicated configuration for same NIC, even they're exactly the same.
# so we have to avoid adding duplicates
- if [ ! -f $_ip_conf ] || ! grep -q $_ip_opts $_ip_conf; then
+ # We should also check /proc/cmdline for existing ip=xx arg.
+ # For example, iscsi boot will specify ip=xxx arg in cmdline.
+ if [ ! -f $_ip_conf ] || ! grep -q $_ip_opts $_ip_conf &&\
+ ! grep -q "ip=[^[:space:]]*$_netdev" /proc/cmdline; then
echo "$_ip_opts" >> $_ip_conf
fi
--
1.9.3
9 years, 2 months
[PATCH] spec: fix ppc64le build failure
by WANG Chao
kexec-tools expects "powerpc64le" to pass to configure.ac, while we
passed ppc64le. Otherwise the build fails. Now fix it like we did for
ppc64.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kexec-tools.spec | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 969dfa6..ca67ede 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -134,6 +134,10 @@ tar -z -x -v -f %{SOURCE23}
--host=powerpc64-redhat-linux-gnu \
--build=powerpc64-redhat-linux-gnu \
%endif
+%ifarch ppc64le
+ --host=powerpc64le-redhat-linux-gnu \
+ --build=powerpc64le-redhat-linux-gnu \
+%endif
--sbindir=/sbin
rm -f kexec-tools.spec.in
# setup the docs
--
1.9.3
9 years, 2 months
[PATCH] module-setup: do not add duplicate ip=xxx
by WANG Chao
In case of iscsi boot, kernel cmdline will contain ip=xxx kernel
parameter for dracut setting up iscsi root in initramfs. For example:
"root=xxx ip=192.168.3.26:::255.255.255.0:localhost.localdomain:eno19:none ..."
dracut doesn't allow duplicate ip conf for the same network card. That's
why in our code we don't add a duplicate ip conf when handling the same
network card the second time. But we never consider the case that ip
conf is already added in kernel cmdline for some special purpose, for
example, iscsi boot.
Now we also look up /proc/cmdline for ip conf. If it exists, we use the
existing one. The existing one should work out of box because dracut
will handle it in second kernel like it does for first kernel. That
said, the network card will be brought up and root disk will be mounted
under /sysroot.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-module-setup.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 02a0557..4feeef5 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -234,7 +234,10 @@ kdump_setup_netdev() {
# dracut doesn't allow duplicated configuration for same NIC, even they're exactly the same.
# so we have to avoid adding duplicates
- if [ ! -f $_ip_conf ] || ! grep -q $_ip_opts $_ip_conf; then
+ if [ ! -f $_ip_conf ] || ! grep -q $_ip_opts $_ip_conf &&\
+ # We should also check /proc/cmdline for existing ip=xx arg.
+ # For example, iscsi boot will specify ip=xxx arg in cmdline.
+ ! grep -q "ip=[^[:space:]]*$_netdev" /proc/cmdline; then
echo "$_ip_opts" >> $_ip_conf
fi
--
1.9.3
9 years, 2 months
[PATCH] spec: build makedumpfile on ppc64le
by WANG Chao
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kexec-tools.spec | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 0a92b3b..49054b1 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -47,7 +47,7 @@ Requires: dracut, dracut-network, ethtool
BuildRequires: zlib-devel zlib zlib-static elfutils-devel-static glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel
BuildRequires: pkgconfig intltool gettext
BuildRequires: systemd-units
-%ifarch %{ix86} x86_64 ppc64 ppc s390x
+%ifarch %{ix86} x86_64 ppc64 ppc s390x ppc64le
Obsoletes: diskdumputils netdump
%endif
@@ -90,7 +90,7 @@ normal or a panic reboot. This package contains the /sbin/kexec
binary and ancillary utilities that together form the userspace
component of the kernel's kexec feature.
-%ifarch %{ix86} x86_64 ppc64 s390x
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
%package eppic
Requires: %{name} = %{version}-%{release}
Summary: Additional eppic_makedumpfile.so shared object
@@ -141,7 +141,7 @@ cp %{SOURCE10} .
cp %{SOURCE21} .
make
-%ifarch %{ix86} x86_64 ppc64 s390x
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
make -C eppic/libeppic
make -C makedumpfile-1.5.7 LINKTYPE=dynamic USELZO=on USESNAPPY=on
make -C makedumpfile-1.5.7 LDFLAGS="-I../eppic/libeppic -L../eppic/libeppic" eppic_makedumpfile.so
@@ -185,7 +185,7 @@ install -m 755 -D %{SOURCE22} $RPM_BUILD_ROOT%{_prefix}/lib/systemd/system-gener
mkdir -p $RPM_BUILD_ROOT/usr/sbin
install -m 755 %{SOURCE17} $RPM_BUILD_ROOT/usr/sbin/rhcrashkernel-param
-%ifarch %{ix86} x86_64 ppc64 s390x
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
install -m 755 makedumpfile-1.5.7/makedumpfile $RPM_BUILD_ROOT/sbin/makedumpfile
install -m 644 makedumpfile-1.5.7/makedumpfile.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz
install -m 644 makedumpfile-1.5.7/makedumpfile.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5.gz
@@ -291,7 +291,7 @@ done
%{_bindir}/*
%{_datadir}/kdump
%{_prefix}/lib/kdump
-%ifarch %{ix86} x86_64 ppc64 s390x
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
%{_sysconfdir}/makedumpfile.conf.sample
%endif
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/kdump
@@ -311,7 +311,7 @@ done
%doc kexec-kdump-howto.txt
%doc kdump-in-cluster-environment.txt
-%ifarch %{ix86} x86_64 ppc64 s390x
+%ifarch %{ix86} x86_64 ppc64 s390x ppc64le
%files eppic
%{_libdir}/eppic_makedumpfile.so
/usr/share/makedumpfile/eppic_scripts/
--
1.9.3
9 years, 2 months
[PATCH] ppc64le: Add arch specific sysconfig
by WANG Chao
kdump.sysconfig.ppc64le is copied from kdump.sysconfig.ppc64. The
default sysconfig won't work for ppc64le.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kdump.sysconfig.ppc64le | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 kdump.sysconfig.ppc64le
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
new file mode 100644
index 0000000..ca7e1d8
--- /dev/null
+++ b/kdump.sysconfig.ppc64le
@@ -0,0 +1,37 @@
+# Kernel Version string for the -kdump kernel, such as 2.6.13-1544.FC5kdump
+# If no version is specified, then the init script will try to find a
+# kdump kernel with the same version number as the running kernel.
+KDUMP_KERNELVER=""
+
+# The kdump commandline is the command line that needs to be passed off to
+# the kdump kernel. This will likely match the contents of the grub kernel
+# line. For example:
+# KDUMP_COMMANDLINE="ro root=LABEL=/"
+# Dracut depends on proper root= options, so please make sure that appropriate
+# root= options are copied from /proc/cmdline. In general it is best to append
+# command line options using "KDUMP_COMMANDLINE_APPEND=".
+# If a command line is not specified, the default will be taken from
+# /proc/cmdline
+KDUMP_COMMANDLINE=""
+
+# This variable lets us append arguments to the current kdump commandline
+# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail"
+
+# Any additional kexec arguments required. In most situations, this should
+# be left empty
+#
+# 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="vmlinuz"
+
+#What is the images extension. Relocatable kernels don't have one
+KDUMP_IMG_EXT=""
+
+#Specify the action after failure
--
1.9.3
9 years, 2 months