From: Mauro Carvalho Chehab <mche...@osg.samsung.com>

The kernel debugger over console (kgdboc) parameter is being added
unconditionally to the kernel command line but this means that the
kernel will stop and wait for gdb to attach in case of a exception
or when sending a sysrq-g key. This behaviour may not be what most
users wants that are not remotely debugging the kernel over serial
console so make it optional by adding a ENABLE_KGDB config option.

Signed-off-by: Mauro Carvalho Chehab <mche...@osg.samsung.com>
[javier: Extended commit message and made it conditional]
Signed-off-by: Javier Martinez Canillas <jav...@osg.samsung.com>

---

 README                                     | 23 +++++++++++++++--------
 recipes-kernel/linux/linux-raspberrypi.inc |  5 ++++-
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/README b/README
index 3913f415bbc1..d70f21fe06ed 100644
--- a/README
+++ b/README
@@ -19,10 +19,11 @@ Contents:
     2.E. Set overclocking options
     2.F. Optional - Video camera support with V4L2 drivers
     2.G. Optional - Enable offline compositing support
-    2.H. Images
-    2.I. Boot to U-Boot
-    2.J. Image with Initramfs
-    2.K. Device tree support
+    2.H. Optional - Enable kgdb over console support
+    2.I. Images
+    2.J. Boot to U-Boot
+    2.K. Image with Initramfs
+    2.L. Device tree support
 3. Extra apps
     3.A. omxplayer
 4. Source code and mirrors
@@ -138,7 +139,13 @@ Heavily recommended for Wayland/Weston.
 
 See: http://wayland.freedesktop.org/raspberrypi.html
 
-2.H. Images
+2.H. Optional - Enable kgdb over console support
+================================================
+To add the kdbg over console (kgdboc) parameter to the kernel command line,
+set this variable in local.conf:
+ENABLE_KGDB = "1"
+
+2.I. Images
 ===========
 * rpi-hwup-image
     Hardware up image
@@ -148,7 +155,7 @@ See: http://wayland.freedesktop.org/raspberrypi.html
     Image based on rpi-basic-image which includes most of the packages in this
     layer and some media samples.
 
-2.I. Boot to U-Boot
+2.J. Boot to U-Boot
 ===================
 To have u-boot load kernel image, set in your local.conf
 KERNEL_IMAGETYPE = "uImage"
@@ -156,7 +163,7 @@ KERNEL_IMAGETYPE = "uImage"
 This will make kernel.img be u-boot image which will load uImage.
 By default, kernel.img is the actual kernel image (ex. Image).
 
-2.J. Image with Initramfs
+2.K. Image with Initramfs
 =========================
 To build an initramfs image :
     * Set this 3 kernel variables (in linux-raspberrypi.inc for example)
@@ -169,7 +176,7 @@ To build an initramfs image :
     * Set the meta-rasberrypi variable (in raspberrypi.conf for example)
         - KERNEL_INITRAMFS = "-initramfs"
 
-2.K. Device tree support
+2.L. Device tree support
 =========================
 Device tree for RPi is only supported when using linux-raspberrypi 3.18+
 kernels.
diff --git a/recipes-kernel/linux/linux-raspberrypi.inc 
b/recipes-kernel/linux/linux-raspberrypi.inc
index 7e36408ae071..d60a3e941027 100644
--- a/recipes-kernel/linux/linux-raspberrypi.inc
+++ b/recipes-kernel/linux/linux-raspberrypi.inc
@@ -19,7 +19,10 @@ KERNEL_DEFCONFIG_raspberrypi ?= "bcmrpi_defconfig"
 KERNEL_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig"
 
 # CMDLINE for raspberrypi
-CMDLINE = "dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
+CMDLINE = "dwc_otg.lpm_enable=0 console=ttyAMA0,115200 root=/dev/mmcblk0p2 
rootfstype=ext4 rootwait"
+
+# Add the kernel debugger over console kernel command line option if enabled
+CMDLINE_append = ' ${@base_conditional("ENABLE_KGDB", "1", 
"kgdboc=ttyAMA0,115200", "", d)}'
 
 UDEV_GE_141 ?= "1"
 
-- 
2.4.3

-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to