summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2016-07-22 14:45:10 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-26 08:56:30 +0100
commitab075b6fb859fbbda29c5b921a1fe2e1beb01379 (patch)
treead7059b0088c5736d28e2c26819d10ccca6c6c82 /meta/recipes-kernel
parent9b8b730d241d883884a42f5fb1c2fae4c4dd2da1 (diff)
downloadpoky-ab075b6fb859fbbda29c5b921a1fe2e1beb01379.tar.gz
kdump: don't set default values for KDUMP_CMDLINE and KDUMP_KIMAGE
Do not set default values of KDUMP_CMDLINE and KDUMP_KIMAGE, and leave them set by configure file since they are different for different architectures. Take KDUMP_KIMAGE kdump kernel image for example: x86 is bzImage mips64 is vmlinux ppc is uImage arm is zImage (From OE-Core rev: 05dcb054fcd0c80bb09612c3e15b6b1f0487aae8) Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rwxr-xr-xmeta/recipes-kernel/kexec/kexec-tools/kdump52
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools/kdump.conf6
2 files changed, 18 insertions, 40 deletions
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kdump b/meta/recipes-kernel/kexec/kexec-tools/kdump
index 3fb133fb35..2347205eda 100755
--- a/meta/recipes-kernel/kexec/kexec-tools/kdump
+++ b/meta/recipes-kernel/kexec/kexec-tools/kdump
@@ -8,23 +8,7 @@
8# 8#
9 9
10#default 10#default
11KDUMP_KVER="`uname -r`" 11KEXEC=/usr/sbin/kexec
12KDUMP_KIMAGE="/boot/bzImage-${KDUMP_KVER}"
13KDUMP_CMDLINE="`cat /proc/cmdline`"
14KDUMP_CMDLINE_APPEND="kdump_needed maxcpus=1 irqpoll reset_devices"
15KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`"
16
17#get right kernel image
18march="`uname -m`"
19case ${march} in
20 x86*|i?86)
21 ;;
22 *)
23 KDUMP_KIMAGE="/boot/uImage-${KDUMP_KVER}"
24 ;;
25esac
26
27KEXEC=usr/sbin/kexec
28KEXEC_ARGS="-p" 12KEXEC_ARGS="-p"
29 13
30MAKEDUMPFILE=/usr/bin/makedumpfile 14MAKEDUMPFILE=/usr/bin/makedumpfile
@@ -34,6 +18,9 @@ LOGGER="logger -p info -t kdump"
34 18
35if [ -f /etc/sysconfig/kdump.conf ]; then 19if [ -f /etc/sysconfig/kdump.conf ]; then
36 . /etc/sysconfig/kdump.conf 20 . /etc/sysconfig/kdump.conf
21else
22 echo "no /etc/sysconfig/kdump.conf"
23 exit 1;
37fi 24fi
38 25
39do_check() 26do_check()
@@ -41,24 +28,33 @@ do_check()
41 #check makedumpfile 28 #check makedumpfile
42 if [ ! -e ${MAKEDUMPFILE} -o ! -x ${MAKEDUMPFILE} ] ;then 29 if [ ! -e ${MAKEDUMPFILE} -o ! -x ${MAKEDUMPFILE} ] ;then
43 echo "No makedumpfile found." 30 echo "No makedumpfile found."
44 return 1; 31 exit 0
45 fi 32 fi
46 33
47 #check kexec 34 #check kexec
48 if [ ! -e ${KEXEC} -o ! -x ${KEXEC} ] ;then 35 if [ ! -e ${KEXEC} -o ! -x ${KEXEC} ] ;then
49 echo "No kexec found." 36 echo "No kexec found."
50 return 1; 37 exit 0
51 fi 38 fi
52 39
53 #check whether kdump kernel image exists on the system 40 #check whether kdump kernel image exists on the system
54 if [ ! -f ${KDUMP_KIMAGE} ]; then 41 if [ -z "${KDUMP_KIMAGE}" -o ! -f "${KDUMP_KIMAGE}" ]; then
55 echo "No kdump kernel image found." 42 echo "No kdump kernel image found."
56 return 1 43 exit 0
44 fi
45
46 if [ "${KDUMP_CMDLINE}"x = "x" ] ; then
47 echo "KDUMP_CMDLINE is not configured"
48 exit 0
57 fi 49 fi
58} 50}
59 51
60do_save_vmcore() 52do_save_vmcore()
61{ 53{
54 if [ ${KDUMP_VMCORE_PATH}x = x ]; then
55 KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`"
56 fi
57
62 mkdir -p ${KDUMP_VMCORE_PATH} 58 mkdir -p ${KDUMP_VMCORE_PATH}
63 echo "Saving a vmcore to ${KDUMP_VMCORE_PATH}." 59 echo "Saving a vmcore to ${KDUMP_VMCORE_PATH}."
64 60
@@ -101,20 +97,6 @@ do_start()
101 return 1 97 return 1
102 fi 98 fi
103 99
104 #handle kdump cmdline parameters, remove some useless options
105 kcmdline=""
106 for x in `cat /proc/cmdline`; do
107 case $x in
108 crashkernel*)
109 ;;
110 *)
111 kcmdline="${kcmdline} $x"
112 ;;
113 esac
114 done
115
116 KDUMP_CMDLINE="${kcmdline} ${KDUMP_CMDLINE_APPEND}"
117
118 #Load the kdump kernel image 100 #Load the kdump kernel image
119 ${KEXEC} ${KEXEC_ARGS} "${KDUMP_KIMAGE}" --append="${KDUMP_CMDLINE}" 101 ${KEXEC} ${KEXEC_ARGS} "${KDUMP_KIMAGE}" --append="${KDUMP_CMDLINE}"
120 if [ $? != 0 ]; then 102 if [ $? != 0 ]; then
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kdump.conf b/meta/recipes-kernel/kexec/kexec-tools/kdump.conf
index 42a2435b96..38190d207a 100644
--- a/meta/recipes-kernel/kexec/kexec-tools/kdump.conf
+++ b/meta/recipes-kernel/kexec/kexec-tools/kdump.conf
@@ -1,13 +1,9 @@
1#the kdump kernel version string. 1#the kdump kernel version string.
2#KDUMP_KVER="`uname -r`" 2#KDUMP_KVER="`uname -r`"
3 3
4#this will be passed to the kdump kernel as kdump kernel command line, it 4#this will be passed to the kdump kernel as kdump kernel command line
5#usually comes from /proc/cmdline
6#KDUMP_CMDLINE="`cat /proc/cmdline`" 5#KDUMP_CMDLINE="`cat /proc/cmdline`"
7 6
8# append arguments to the kdump commandline
9#KDUMP_CMDLINE_APPEND="kdump_needed maxcpus=1 irqpoll reset_devices"
10
11#the kernel image for kdump 7#the kernel image for kdump
12#KDUMP_KIMAGE="/boot/bzImage-${KDUMP_KVER}" 8#KDUMP_KIMAGE="/boot/bzImage-${KDUMP_KVER}"
13 9