Print debug messages to console/log

This commit is contained in:
Mikhail Novosyolov 2019-12-22 02:24:52 +03:00
parent 833fec59c1
commit 64d2bf03ae

View file

@ -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}"