diff --git a/kernel.spec b/kernel.spec index becbcf3..f2e9d7b 100644 --- a/kernel.spec +++ b/kernel.spec @@ -11,7 +11,7 @@ %define sublevel 6 # Release number. Increase this before a rebuild. -%define rpmrel 1 +%define rpmrel 3 %define fullrpmrel %{rpmrel} %define rpmtag %{disttag} @@ -966,6 +966,17 @@ cp arch/x86/configs/%{arch_suffix}_defconfig-%{flavour} .config # make sure EXTRAVERSION says what we want it to say LC_ALL=C sed -ri "s/^EXTRAVERSION.*/EXTRAVERSION = -%{flavour}-%{buildrpmrel}/" Makefile +# Print debug messages when loglevel=7 in cmdline. +# Those messages can be caught by debugfs without -DDEBUG. +# but sometimes it is required to see them via a serial port when booting the kernel. +# '#ifdef DEBUG' is used in different places for different purposes, +# so change DEBUG to PRINTK_DEBUG in one specific place. +%if %build_debug +sed -i %{src_dir}/include/linux/printk.h \ + -e 's,^#ifdef DEBUG$,#if defined(DEBUG) || defined(PRINTK_DEBUG),g' +export KCPPFLAGS="-DPRINTK_DEBUG" +%endif + # build the kernel echo "Building kernel %{kver_full}"