[PATCH RFC] module-setup.sh: install usb serial driver for ttyUSB0
by Dave Young
In case one want to use usb serial console, we need to pack the usb serial
driver into kdump initramfs so that one can see the console output on the usb
console.
I only handled ttyUSB0, this is like a hard code, but it should be enough for
most cases. Also only install the driver for the ttyUSB0 device.
Tested with adding "console=ttyUSB0" in 2nd kernel commandline.
Tested latest F22 kernel, there's CONFIG_USB_SERIAL_CONSOLE=y, kdump work ok.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
dracut-module-setup.sh | 8 ++++++++
1 file changed, 8 insertions(+)
--- kexec-tools.orig/dracut-module-setup.sh
+++ kexec-tools/dracut-module-setup.sh
@@ -626,4 +626,12 @@ installkernel() {
[ "$wdt" = "iTCO_wdt" ] && instmods lpc_ich
instmods $wdt
fi
+
+ if [ -c /dev/ttyUSB0 ]; then
+ _majmin=$(get_maj_min /dev/ttyUSB0)
+
+ _driver=$(readlink /sys/dev/char/$_majmin/device/driver)
+ _driver=$(basename $_driver)
+ instmods $_driver
+ fi
}
7 years
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] mkdumprd: Fix the bug to get persistent device correctly
by Minfei Huang
One filesystem has an unique uuid to detect itself. For btrfs, several
diskes can have the same uuid, and the soft link /dev/disk/by-uuid/$uuid
points the only one disk which is contained in the btrfs.
It may fails to filter out the disk by uuid, although there is a
filesystem on the disk, like btrfs.
In order to get the persistent device, we can use command "blkid".
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
mkdumprd | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd
index 4d251ba..5fb578b 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -27,14 +27,14 @@ perror() {
}
get_persistent_dev() {
- local i _tmp _dev
+ local i _tmp _dev _uuid
_dev=$(udevadm info --query=name --name="$1" 2>/dev/null)
[ -z "$_dev" ] && {
perror_exit "Kernel dev name of $1 is not found."
}
- for i in /dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*; do
+ for i in /dev/mapper/* /dev/disk/by-id/*; do
_tmp=$(udevadm info --query=name --name="$i" 2>/dev/null)
if [ "$_tmp" = "$_dev" ]; then
echo $i
@@ -42,6 +42,18 @@ get_persistent_dev() {
fi
done
+ if [ "x" != "x""$(blkid $1 | grep "UUID")" ]; then
+ _uuid=`blkid $1 | grep "UUID" | awk '{print $2}'`
+ _uuid=${_uuid#*\"}
+ _uuid=${_uuid%\"*}
+ _dev=/dev/disk/by-uuid/$_uuid
+ _tmp=$(udevadm info --query=name --name=$_dev 2>/dev/null)
+ if [ "x" != "x"$_tmp ]; then
+ echo $_dev
+ return
+ fi
+ fi
+
perror "WARNING: Persistent device name of $1 not found. Using $1 as dump target name"
echo $1
}
--
1.9.3
8 years
[PATCH V2] remove "noauto" options in 2nd kernel fstab.
by Qiao Zhao
Configure kdump.conf for nfs: "nfs 192.168.4.1:/mnt/remotenfs", and
use fs option "noauot" in fstab, i.e. "192.168.4.1:/mnt/remotenfs /mnt/nfs nfs noauto 0 0",
then mount the nfs report "mount /mnt/nfs".
Rebuild kdumpinitrd and trigger crash: "echo c > /proc/sysrq-tirgger", kdump fail.
In non-root disk dump, it has the same problem. Root dump is ok.
Because "noauot" option will fail kdump.
Check rebuild kdumpinitrd file:
"lsinitrd /boot/initramfs-$(uname -r)kdump.img /etc/fstab", and will
got "192.168.122.4.1:/mnt/remotenfs /kdumproot//mnt/nfs nfs4 noauto 0 2".
According to Baoquan He and Minfei Huang suggestions, remove "noauto"
option in 2nd kernel fstab. And I have test patch in my kvm guest, the patch works well.
Signed-off-by: Qiao Zhao <qzhao(a)dhcp-12-144.nay.redhat.com>
---
mkdumprd | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index 4d251ba..385998d 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -114,6 +114,8 @@ to_mount() {
_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)
+ #noauto options will fail nfs dump, remove "noauto" in 2nd kernel fstab.
+ [[ $_options =~ "noauto" ]] && _options=$(echo $_options | sed 's/noauto//')
_options=${_options/#ro/rw} #mount fs target as rw in 2nd kernel
# "x-initrd.mount" mount failure will trigger isolate emergency service
# W/o this, systemd won't isolate, thus we won't get to emergency.
--
1.9.3
8 years
[PATCH] remove "noauto" options in 2nd kernel fstab
by Qiao Zhao
Configure kdump.conf for nfs: "nfs 192.168.4.1:/mnt/remotenfs", and
use fs option "noauot" in fstab, i.e. "192.168.4.1:/mnt/remotenfs /mnt/nfs nfs noauto 0 0",
then mount the nfs report "mount /mnt/nfs".
Rebuild kdumpinitrd and trigger crash: "echo c > /proc/sysrq-tirgger", kdump fail.
Because "noauot" option will fail kdump nfs dump.
Check rebuild kdumpinitrd file:
"lsinitrd /boot/initramfs-$(uname -r)kdump.img /etc/fstab", and will
got "192.168.122.4.1:/mnt/remotenfs /kdumproot//mnt/nfs nfs4 noauto 0 2".
According to Baoquan He and Minfei Huang suggestions, remove "noauto"
option in 2nd kernel fstab. And I have test patch in my kvm guest,
Signed-off-by: Qiao Zhao <qzhao(a)redhat.com>
---
mkdumprd | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index 4d251ba..385998d 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -114,6 +114,8 @@ to_mount() {
_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)
+ #noauto options will fail nfs dump, remove "noauto" in 2nd kernel fstab.
+ [[ $_options =~ "noauto" ]] && _options=$(echo $_options | sed 's/noauto//')
_options=${_options/#ro/rw} #mount fs target as rw in 2nd kernel
# "x-initrd.mount" mount failure will trigger isolate emergency service
# W/o this, systemd won't isolate, thus we won't get to emergency.
--
1.9.3
8 years, 1 month
[PATCH] remove "noauto" options in 2nd kernel fstab
by Qiao Zhao
"noauto" will fail nfs dump, remove "noauto" in 2nd kernel fstab.
---
mkdumprd | 1 +
1 file changed, 1 insertion(+)
diff --git a/mkdumprd b/mkdumprd
index 4d251ba..82e06b0 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -114,6 +114,7 @@ to_mount() {
_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)
+ [[ $_options =~ "noauto" ]] && _options=$(echo $_options | sed 's/noauto//') #noauto will fail dump nfs dump, remove "noauto" in 2nd kernel fstab.
_options=${_options/#ro/rw} #mount fs target as rw in 2nd kernel
# "x-initrd.mount" mount failure will trigger isolate emergency service
# W/o this, systemd won't isolate, thus we won't get to emergency.
--
1.9.3
8 years, 1 month
[PATCH RFC 0/6] Various fixes for purgatory and ARM64
by Pratyush Anand
These patches can be applied on top of Geoff's Kexec [1] and Takahiro's
Kdump [2] patches and are available in my tree [3].
First two patches are for purgatory. 1st patch is a very important fix
for sha verification. 2nd patch is good to have.
Rest all patches are fixes and addon for ARM64.
These patchset adds three extra command line options for ARM64.
--page-offset: Needed for binary image only. Default value is
0xfffffe0000000000.
--port-lsr: It is UART's Line status register address. Normally for a
UART based on 8250, 16450 or 16550 should have value as --port's value +
0x14.
--port-lsr-val: It is the SET value of LSR register for TX buffer to be
empty. Normally for above UARTs it should be 0x60
[1] git://git.kernel.org/pub/scm/linux/kernel/git/geoff/kexec-tools.git
: master
[2] git://git.linaro.org/people/takahiro.akashi/kexec-tools.git :
kdump/v0.10
[3] https://github.com/pratyushanand/kexec-tools.git : master
(6c8a63f701e9)
Pratyush Anand (6):
purgatory: Fix memcmp for src address increment
purgatory: No need to sha256 update if ptr->len is zero
arm64: allocate memory for other segments after kernel
arm64: support reuse-cmdline option
arm64: Add support for binary image
arm64: wait for transmit completion before next character transmission
kexec/arch/arm64/crashdump-arm64.c | 3 +-
kexec/arch/arm64/crashdump-arm64.h | 1 +
kexec/arch/arm64/include/arch/options.h | 21 +++++++++++--
kexec/arch/arm64/kexec-arm64.c | 28 ++++++++++++++++-
kexec/arch/arm64/kexec-arm64.h | 2 ++
kexec/arch/arm64/kexec-image-arm64.c | 54 ++++++++++++++++++++++++++++++---
purgatory/arch/arm64/entry.S | 10 ++++++
purgatory/arch/arm64/purgatory-arm64.c | 22 +++++++++++++-
purgatory/purgatory.c | 2 ++
purgatory/string.c | 2 ++
10 files changed, 135 insertions(+), 10 deletions(-)
--
2.1.0
8 years, 1 month
[PATCH] Revert: dracut-kdump: Use proper the known hosts entry in the file known_hosts
by Minfei Huang
This revert commit 63476302aa09b7844ac0fff5aa3878bcc9a5bc0d
Since the ipv6 is not supported by Kdump, revert this patch to avoid the
code conflicting.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-kdump.sh | 23 -----------------------
dracut-module-setup.sh | 16 ++++++++++++++++
kdump-lib.sh | 51 --------------------------------------------------
3 files changed, 16 insertions(+), 74 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index e062665..dc948d1 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -131,27 +131,6 @@ get_host_ip()
return 0
}
-# kdump will change the ethernet device name in the 2nd using prefix "kdump-",
-# the link scope of ipv6 has the format like fe80::5054:ff:fe48:ca80%eth0,
-# So we should correct the known hosts
-correct_known_hosts()
-{
- if is_ipv6_target && is_ssh_dump_target; then
- local _ipv6 _netdev _pre_netdev
- local _known_hosts="/root/.ssh/known_hosts"
- local _srcaddr=$(get_option_value ssh)
-
- [ "x" = "x""$_srcaddr" ] && return 1
-
- if `echo $_srcaddr | grep -q "%"`; then
- _ipv6=`get_remote_host $_srcaddr`
- _netdev=${_srcaddr#*-}
- _pre_netdev=$(kdump_setup_ifname $_netdev)
- sed -i "s#$_ipv6\%$_netdev#$_ipv6\%$_pre_netdev#" $_known_hosts
- fi
- fi
-}
-
read_kdump_conf()
{
if [ ! -f "$KDUMP_CONF" ]; then
@@ -196,8 +175,6 @@ if [ $? -ne 0 ]; then
exit 1
fi
-correct_known_hosts
-
if [ -z "$DUMP_INSTRUCTION" ]; then
add_dump_code "dump_fs $NEWROOT"
fi
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 73ab938..228fae2 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -101,6 +101,22 @@ kdump_get_perm_addr() {
fi
}
+# Prefix kernel assigned names with "kdump-". EX: eth0 -> kdump-eth0
+# Because kernel assigned names are not persistent between 1st and 2nd
+# kernel. We could probably end up with eth0 being eth1, eth0 being
+# eth1, and naming conflict happens.
+kdump_setup_ifname() {
+ local _ifname
+
+ if [[ $1 =~ eth* ]]; then
+ _ifname="kdump-$1"
+ else
+ _ifname="$1"
+ fi
+
+ echo "$_ifname"
+}
+
kdump_setup_bridge() {
local _netdev=$1
local _brif _dev _mac _kdumpdev
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 2abb513..e62b4e2 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -197,57 +197,6 @@ check_save_path_fs()
fi
}
-
-# Prefix kernel assigned names with "kdump-". EX: eth0 -> kdump-eth0
-# Because kernel assigned names are not persistent between 1st and 2nd
-# kernel. We could probably end up with eth0 being eth1, eth0 being
-# eth1, and naming conflict happens.
-kdump_setup_ifname() {
- local _ifname
-
- if [[ $1 =~ eth* ]]; then
- _ifname="kdump-$1"
- else
- _ifname="$1"
- fi
-
- echo "$_ifname"
-}
-
-# 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 ":"
-}
-
is_atomic()
{
grep -q "ostree" /proc/cmdline
--
1.9.3
8 years, 1 month
[PATCH] add fPIC to makefumpfile CFLAGS to support hardening
by Baoquan He
Beginning from f23 program hardening become the defaults for all packages.
Details can be check from below link:
https://fedoraproject.org/wiki/Changes/Harden_All_Packages
Adding this to makedumpfile CFLAGS, otherwise makedumpfile building will
fail on koji.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
kexec-tools.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 5896269..cf2b0f5 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -128,7 +128,7 @@ cp %{SOURCE21} .
make
%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 LINKTYPE=dynamic USELZO=on USESNAPPY=on LDFLAGS="-fPIC"
make -C makedumpfile-1.5.7 LDFLAGS="-I../eppic/libeppic -L../eppic/libeppic" eppic_makedumpfile.so
%endif
make -C kdump-anaconda-addon/po
--
1.9.3
8 years, 1 month
[PATCH 0/5 v4] Dump core correctly to the bind mounted target in Atomic
by Minfei Huang
Enhance kdump to support bind mounted target, since kdump cann't parse
the bind mounted path.
Following is the testcases which kdump can generate the core sucessfully.
1) rootfs, default path / specified path
2) rootfs with bind mounted path which is in the rootfs device
# cat /etc/kdump | grep ^path
path /var/crash
# mount -o bind /var/crash /mnt/crash
4) rootfs with bind mounted path which is not in the rootfs device
# cat /etc/kdump | grep ^path
path /var/crash
# mount /dev/vdb /mnt
# mount -o bind /var/crash /mnt/crash
5) no-rootfs
6) no-rootfs with bind mounted path which is in the same device
7) no-rootfs with bind mounted path which is not in the same device
8) nfs
9) nfs with bind mounted path which is under the nfs mount point path
# cat /etc/kdump | grep ^nfs
nfs 192.168.122.134:/opt/crash
# cat /etc/kdump | grep ^path
path /var/crash
# mount.nfs 192.168.122.134:/opt/crash /mnt/nfs
# mount -o bind /mnt/nfs/var/crash /mnt/nfs/dump
10) nfs with bind mounted path which is not under the nfs mount point path
# cat /etc/kdump | grep ^nfs
nfs 192.168.122.134:/opt/crash
# cat /etc/kdump | grep ^path
path /var/crash
# mount.nfs 192.168.122.134:/opt/crash /mnt/nfs
# mount -o bind /mnt/nfs/var/crash /mnt/dump
11) nfs which don't specify the nfs option in the /etc/kdump, with bind mounted path which is under the nfs mount point path
# cat /etc/kdump | grep ^nfs
# mount.nfs 192.168.122.134:/opt/crash /mnt/nfs
# cat /etc/kdump | grep ^path
path /mnt/nfs/var/crash
# mount -o bind /mnt/nfs/var/crash /mnt/nfs/dump
12) nfs which don't specify the nfs option in the /etc/kdump, with bind mounted path which is not under the nfs mount point path
# cat /etc/kdump | grep ^nfs
# mount.nfs 192.168.122.134:/opt/crash /mnt/nfs
# cat /etc/kdump | grep ^path
path /mnt/nfs/var/crash
# mount -o bind /mnt/nfs/var/crash /mnt/dump
13) ext4
14) ext4 with bind mounted path which is under the ext4 mount point path
15) ext4 with bind mounted path which is not under the ext4 mount point path
16) btrfs
17) btrfs with subvolume which mounts under mount point path
18) btrfs with subvolume which does not mount under mount point path
---
changelog:
v3:
- modify the commit log and annotation properly
- use function is_atomic as the judgement in check_boot_dir
v2:
- bisect the patch to make it clear to be reviewed
- add the necessary function decription
v1:
- add the judgment to make it work only in Atomic
---
Minfei Huang (5):
kdump-lib: Add the new function to enhance bind mounted judgement
kdump-lib: Add new function to judge the system is Atomic or not
Get the mount point correctly, if the device has several mount point
Fix the warning if the target path is bind mount in Atomic
dracut-module-setup: Enhance kdump to support the bind mounted feature
in Atomic
dracut-module-setup.sh | 43 +++++++++++++++++++++++++++++--
kdump-lib.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++++++--
kdumpctl | 4 +--
mkdumprd | 30 ++++++++++++++++------
4 files changed, 131 insertions(+), 14 deletions(-)
--
1.9.3
8 years, 1 month