Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] kdump: don't set default values for KDUMP_CMDLINE and KDUMP_KIMAGE
@ 2016-07-22  6:45 kai.kang
  2016-07-22  6:45 ` [PATCH 1/1] " kai.kang
  0 siblings, 1 reply; 2+ messages in thread
From: kai.kang @ 2016-07-22  6:45 UTC (permalink / raw)
  To: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

The following changes since commit 36feb38045b7a2af86ece147fec54b0db3bf491f:

  linux-yocto: Update genericx86* SRCREVs for linux-yocto 4.4 (2016-07-21 07:48:53 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib kangkai/kdump
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/kdump

Roy Li (1):
  kdump: don't set default values for KDUMP_CMDLINE and KDUMP_KIMAGE

 meta/recipes-kernel/kexec/kexec-tools/kdump      | 52 ++++++++----------------
 meta/recipes-kernel/kexec/kexec-tools/kdump.conf |  6 +--
 2 files changed, 18 insertions(+), 40 deletions(-)

-- 
2.9.2.368.g08bb350



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] kdump: don't set default values for KDUMP_CMDLINE and KDUMP_KIMAGE
  2016-07-22  6:45 [PATCH 0/1] kdump: don't set default values for KDUMP_CMDLINE and KDUMP_KIMAGE kai.kang
@ 2016-07-22  6:45 ` kai.kang
  0 siblings, 0 replies; 2+ messages in thread
From: kai.kang @ 2016-07-22  6:45 UTC (permalink / raw)
  To: openembedded-core

From: Roy Li <rongqing.li@windriver.com>

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

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/recipes-kernel/kexec/kexec-tools/kdump      | 52 ++++++++----------------
 meta/recipes-kernel/kexec/kexec-tools/kdump.conf |  6 +--
 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 3fb133f..2347205 100755
--- a/meta/recipes-kernel/kexec/kexec-tools/kdump
+++ b/meta/recipes-kernel/kexec/kexec-tools/kdump
@@ -8,23 +8,7 @@
 #
 
 #default
-KDUMP_KVER="`uname -r`"
-KDUMP_KIMAGE="/boot/bzImage-${KDUMP_KVER}"
-KDUMP_CMDLINE="`cat /proc/cmdline`"
-KDUMP_CMDLINE_APPEND="kdump_needed maxcpus=1 irqpoll reset_devices"
-KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`"
-
-#get right kernel image
-march="`uname -m`"
-case ${march} in
-	x86*|i?86)
-		;;
-		*)
-		KDUMP_KIMAGE="/boot/uImage-${KDUMP_KVER}"
-		;;
-esac
-
-KEXEC=usr/sbin/kexec
+KEXEC=/usr/sbin/kexec
 KEXEC_ARGS="-p"
 
 MAKEDUMPFILE=/usr/bin/makedumpfile
@@ -34,6 +18,9 @@ LOGGER="logger -p info -t kdump"
 
 if [ -f /etc/sysconfig/kdump.conf ]; then
 	. /etc/sysconfig/kdump.conf
+else
+	echo "no /etc/sysconfig/kdump.conf"
+	exit 1;
 fi
 
 do_check()
@@ -41,24 +28,33 @@ do_check()
 	#check makedumpfile
 	if [ ! -e ${MAKEDUMPFILE} -o ! -x ${MAKEDUMPFILE} ] ;then
 		echo "No makedumpfile found."
-		return 1;
+		exit 0
 	fi
 
 	#check kexec
 	if [ ! -e ${KEXEC} -o ! -x ${KEXEC} ] ;then
 		echo "No kexec found."
-		return 1;
+		exit 0
 	fi
 
 	#check whether kdump kernel image exists on the system
-	if [ ! -f ${KDUMP_KIMAGE} ]; then
+	if [ -z "${KDUMP_KIMAGE}" -o ! -f "${KDUMP_KIMAGE}" ]; then
 		echo "No kdump kernel image found."
-		return 1
+		exit 0
+	fi
+
+	if [ "${KDUMP_CMDLINE}"x = "x" ] ; then
+		echo "KDUMP_CMDLINE is not configured"
+		exit 0
 	fi
 }
 
 do_save_vmcore()
 {
+	if [ ${KDUMP_VMCORE_PATH}x = x ]; then
+		KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`"
+	fi
+
 	mkdir -p ${KDUMP_VMCORE_PATH}
 	echo "Saving a vmcore to ${KDUMP_VMCORE_PATH}."
 
@@ -101,20 +97,6 @@ do_start()
 		return 1
 	fi
 
-	#handle kdump cmdline parameters, remove some useless options
-	kcmdline=""
-	for x in `cat /proc/cmdline`; do
-		case $x in
-			crashkernel*)
-				;;
-			*)
-				kcmdline="${kcmdline} $x"
-				;;
-		esac
-	done
-
-	KDUMP_CMDLINE="${kcmdline} ${KDUMP_CMDLINE_APPEND}"
-
 	#Load the kdump kernel image
 	${KEXEC} ${KEXEC_ARGS} "${KDUMP_KIMAGE}" --append="${KDUMP_CMDLINE}"
 	if [ $? != 0 ]; then
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kdump.conf b/meta/recipes-kernel/kexec/kexec-tools/kdump.conf
index 42a2435..38190d2 100644
--- a/meta/recipes-kernel/kexec/kexec-tools/kdump.conf
+++ b/meta/recipes-kernel/kexec/kexec-tools/kdump.conf
@@ -1,13 +1,9 @@
 #the kdump kernel version string.
 #KDUMP_KVER="`uname -r`"
 
-#this will be passed to the kdump kernel as kdump kernel command line, it
-#usually comes from /proc/cmdline
+#this will be passed to the kdump kernel as kdump kernel command line
 #KDUMP_CMDLINE="`cat /proc/cmdline`"
 
-# append arguments to the kdump commandline
-#KDUMP_CMDLINE_APPEND="kdump_needed maxcpus=1 irqpoll reset_devices"
-
 #the kernel image for kdump
 #KDUMP_KIMAGE="/boot/bzImage-${KDUMP_KVER}"
 
-- 
2.9.2.368.g08bb350



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-22  6:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-22  6:45 [PATCH 0/1] kdump: don't set default values for KDUMP_CMDLINE and KDUMP_KIMAGE kai.kang
2016-07-22  6:45 ` [PATCH 1/1] " kai.kang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox