Yes, we are building the module on the target, common for chip vendors supplying Linux drivers that depend on a running target, evidenced in the call to 'uname -r' of section 2.1 in the how to build an external kernel module above.
Similarly, for cross compilation, reference in section 2.2, also depends on a valid $KDIR.
I don't see where/how the LSDK has or can generate this directory.
I've tried following the docs/flexbuild_usage.txt section 'Build Distro Root Filesystem'
sudo chroot build/rfs/rootfs_lsdk_19.03_LS_arm64/ apt install linux-headers-4.19.26
[sudo] password for username:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-4.19.26
E: Couldn't find any package by glob 'linux-headers-4.19.26'
E: Couldn't find any package by regex 'linux-headers-4.19.26'
Also,
LSDK/build/Linux/Linux/arm64/LS/output/LSDK-19.03-V4.19
and
LSDK/package/Linux/Linux
,neither are to be a valid $KDIR as needed for section 2.2.
What directory should be used for $KDIR?