DESCRIPTION = "NILRT linux kernel debug build"
NI_RELEASE_VERSION = "master"
LINUX_VERSION = "5.10"
LINUX_VERSION_xilinx-zynq = "4.14"
LINUX_KERNEL_TYPE = "debug"

require linux-nilrt-alternate.inc

SRC_URI += "\
	file://debug.cfg \
"

# This is the place to overwrite the source AUTOREV from linux-nilrt.inc, if
# the kernel recipe requires a particular ref.
#SRCREV = ""

DESCRIPTION = "NILRT linux kernel debug build"
NI_RELEASE_VERSION = "master"
LINUX_VERSION = "5.10"
LINUX_VERSION_xilinx-zynq = "4.14"
LINUX_KERNEL_TYPE = "debug"

require linux-nilrt-alternate.inc

SRC_URI += "\
	file://debug.cfg \
"

# This is the place to overwrite the source AUTOREV from linux-nilrt.inc, if
# the kernel recipe requires a particular ref.
#SRCREV = ""

# Move vmlinux-${KERNEL_VERSION_NAME} from /boot to /lib/modules/${KERNEL_VERSION}/build/
# to avoid filling the /boot partition.
FILES_${KERNEL_PACKAGE_NAME}-vmlinux_remove = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
FILES_${KERNEL_PACKAGE_NAME}-vmlinux += "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build/vmlinux-${KERNEL_VERSION_NAME}"

do_install_append(){
    install -d "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
    mv ${D}/boot/vmlinux-${KERNEL_VERSION} "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build/"
}


Move debug vmlinux out of /boot
linux-nilrt-debug: Move debug vmlinux out of /boot

The debug vmlinux file is significantly larger than the entire boot
partition. As a result, installing it was causing errors.

This file is not actually used by the target, but is intended to be
copied to a host machine running gdb. Therefore it does not need to be
installed on the boot partition. This change moves it out of the boot
partition and into /lib/modules/<kernel-version>/build.

Signed-off-by: Jeffrey Pautler <2ddd7b2680b5263513f437e51322d455fd4f5f03@ni.com>
(cherry picked from commit 8a5018ee01d0971c418fc139e5e28c8047ca5e02)
Signed-off-by: Jeffrey Pautler <2ddd7b2680b5263513f437e51322d455fd4f5f03@ni.com>
