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 v2 1/2] dracut-module-setup.sh: make some clean up
by Baoquan He
Chao pointed out that it's better to use get_option_value to get
get a specific config_val.
And also there's a potential risk when use below sed command to
do the replacement.
sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
Say user configure kdump.conf like the following. Then sed may
replace "/var/crash/post.sh" with something else, depanding on
mount point.
kdump_post /var/crash/post.sh
path /var/crash
So in this patch clean them up.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
dracut-module-setup.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index d65c8c0..793495a 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -313,7 +313,7 @@ default_dump_target_install_conf()
is_user_configured_dump_target && return
- _save_path=$(grep ^path "/etc/kdump.conf"| cut -d' ' -f2)
+ _save_path=$(get_option_value "path")
[ -z "$_save_path" ] && _save_path=$DEFAULT_PATH
_mntpoint=$(get_mntpoint_from_path $_save_path)
@@ -331,7 +331,7 @@ default_dump_target_install_conf()
echo "$_fstype $_target" >> /tmp/$$-kdump.conf
_path=${_save_path##"$_mntpoint"}
- sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
+ sed -i -e "s#^path[[:space:]]\+$_save_path#path $_path#" /tmp/$$-kdump.conf
fi
}
@@ -346,7 +346,7 @@ kdump_install_conf() {
config_val=$(strip_comments $config_val)
case "$config_opt" in
ext[234]|xfs|btrfs|minix|raw)
- sed -i -e "s#$config_val#$(kdump_to_udev_name $config_val)#" /tmp/$$-kdump.conf
+ sed -i -e "s#^$config_opt[[:space:]]\+$config_val#$config_opt $(kdump_to_udev_name $config_val)#" /tmp/$$-kdump.conf
;;
ssh|nfs)
kdump_install_net "$config_val"
--
1.9.0
8 years, 4 months
[PATCH] mount fail if its mount point doesn't exist in /sysroot
by Baoquan He
Jerry Hoemann reported a bug that a mount will fail when he installed
a system with separate "/" "/var" and "/var/crash". That means root
disk /dev/a mounted on /, and another disk /dev/b is mounted on /var,
then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail
since mount will fail.
This is because the mount information will be written into
/$mntimage/etc/fstab like below. And the dump target is /dev/c. However
/dev/b is not related in kdump, its mount info is not necessary and not
saved. So when go into kdump kernel, it will find there's not a crash
dir under /sysroot/var. And in current implementation, if not a root
disk dump, sysroot is a read-only mount, no dir can be created in this
situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump
target is a root disk, mount point is /sysroot. If dump target is not
root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
mkdumprd | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index a30d9ca..6ade88a 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -102,7 +102,13 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev)
_target=$(findmnt -k -f -n -r -o TARGET $_dev)
# mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
- _target="/sysroot$_target"
+
+ if [ $_target = "/" ];then
+ _target="/sysroot"
+ else
+ _target="/kdumproot/$_target"
+ fi
+
_fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev)
_options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev)
[ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
@@ -368,6 +374,7 @@ handle_default_dump_target()
fi
}
+
get_default_action_target()
{
local _target
--
1.8.5.3
8 years, 5 months
[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 0/4 v6] Enhance kdump to support ipv6
by Minfei Huang
v6:
- construct the patches, split more small patches
- wrap the similar functional code to make it more clearly
v5:
- modify the get_route function
v4:
- consistent the netdevice name to add the prefix "kdump-" before the ethX
v3:
- Support the static route
v2:
- Fix some bugs
Minfei Huang (4):
mkdumprd: Add proper prefix "kdump-" before ethX in 2nd kernel
kdump-lib: Add new lib to identify the ipv6 address or not
dracut-module-setup: Wrap the similar functional code to the function
ipv6: Enhance kdump to support ipv6
dracut-kdump.sh | 8 +-
dracut-module-setup.sh | 204 ++++++++++++++++++++++++++++++++++---------------
kdump-lib.sh | 26 +++++--
mkdumprd | 17 ++++-
4 files changed, 185 insertions(+), 70 deletions(-)
--
1.8.3.1
8 years, 5 months
[PATCH] kexec, remove panic_on_warn kernel parameter from kdump situations
by Prarit Bhargava
panic_on_warn kernel parameter will cause the kernel to panic when a
WARN() is hit in the kernel. This is not a good situation for the kdump
kernel because then it would be possible for the kdump kernel to panic in
a non-fatal WARN().
This patch removes panic_on_warn as a kernel parameter for the kdump
kernel.
Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
Cc: Dave Young <dyoung(a)redhat.com>
Cc: Vivek Goyal <vgoyal(a)redhat.com>
Cc: WANG Chao <chaowang(a)redhat.com>
---
kexec/kexec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kexec/kexec.c b/kexec/kexec.c
index b088916..323cafb 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1048,8 +1048,10 @@ char *get_command_line(void)
line[strlen(line) - 1] = '\0';
remove_parameter(line, "BOOT_IMAGE");
- if (kexec_flags & KEXEC_ON_CRASH)
+ if (kexec_flags & KEXEC_ON_CRASH) {
remove_parameter(line, "crashkernel");
+ remove_parameter(line, "panic_on_warn");
+ }
return line;
}
--
1.7.9.3
8 years, 5 months
[PATCH] Rebuild initrd dependency during kdump restart
by Jerry Hoemann
kdumpctl now parses mount points in determining the partition to
save the dump to. So /etc/fstab can be considered a configuration
file for kdump.
Change adds an additional depenedency check on /etc/fstab when
kdump is restarted.
Signed-off-by: Jerry Hoemann <jerry.hoemann(a)hp.com>
---
kdumpctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index a9e5d2e..1c97405 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -352,7 +352,7 @@ check_rebuild()
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
CHECK_FILES=`grep ^extra_bins $KDUMP_CONFIG_FILE | cut -d\ -f2-`
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
- files="$KDUMP_CONFIG_FILE $kdump_kernel $EXTRA_BINS"
+ files="$KDUMP_CONFIG_FILE $kdump_kernel $EXTRA_BINS /etc/fstab"
check_exist "$files" && check_executable "$EXTRA_BINS"
[ $? -ne 0 ] && return 1
--
1.9.3
8 years, 5 months
[PATCH] adding the parsed path to etc/kdump.conf of kdump initrd
by Baoquan He
Steve found a bug. When mount a disk in /var and not specify path
in /etc/kdump.conf, the vmcore will be dumped into /var/crash of
that disk, but not /crash on that disk.
This is because when write the parsed path into /tmp/$$-kdump.conf
in default_dump_target_install_conf() of mkdumprd, it uses below
sed command. So if no path specified at all, this sed command won't
add it to /tmp/$$-kdump.conf. Then in 2nd kernel it will take default
path, namely "/var/crash" as path if no path in /etc/kdump.conf in
2nd kernel.
sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
In this patch add a judgement, if user specified path let's use sed
command to replace it with parsed path. Otherwise execute a echo
command to add the path:
echo "path $_path" >> /tmp/$$-kdump.conf
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
dracut-module-setup.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 9299b5d..19792ea 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -342,7 +342,12 @@ default_dump_target_install_conf()
echo "$_fstype $_target" >> /tmp/$$-kdump.conf
_path=${_save_path##"$_mntpoint"}
- sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
+
+ if [ -n "$(grep ^path "/etc/kdump.conf"| cut -d' ' -f2)" ]; then
+ sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
+ else
+ echo "path $_path" >> /tmp/$$-kdump.conf
+ fi
fi
}
--
1.9.0
8 years, 5 months
[PATCH] cleanup: change name of get_kdump_confs to get_kdump_conf
by Baoquan He
The old name of function get_kdump_conf is confusing. When I took
the first glance at if, I thought it's about con fs handling.
Especially it's nearby a pile of functions like dump_fs, dump_ro_rotofs.
So make this minor change to remove the confusion.
Signed-off-by: Baoquan He <bhe(a)redaht.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 57b8304..186da74 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -19,7 +19,7 @@ KDUMP_PRE=""
KDUMP_POST=""
NEWROOT="/sysroot"
-get_kdump_confs()
+get_kdump_conf()
{
local config_opt config_val
--
1.9.0
8 years, 5 months