I want to debug kernel module using KDBG, i extracted kernel sources , ran xconfig on the tegra_defconfig generated .config using of course all the command line parameters as in the development guide.
after building the kernel, i copied the generated Image and dtb under the /kernel and also generated kernel_supplements and copied there as well.
i put the xavier to recovery mode and run the command:
sudo ./flash.sh -k kernel jetson-xavier mmcblk0p1
the script runs and seems to finish flashing, the xavier reboots to linux normally.
when i check if any configuration was changed:
zcat /proc/config.gz | egrep âCONFIG_KGDB|KDGB|CONFIG_FRAME_POINTER|CONFIG_WATCHDOG|IKCONFIGâ
having to flash entire filesystem and erase everything every time i need to make a small change to kernel is time consuming as well as unacceptable.
for a development kit,integrtation process is extermely convoluted.
with earlier versions this didnât seem to be a problem as far as i can remember, but still iâm not the only one having problems with the flash process.
Did you try to copy the Image to Xavier at /boot/Image?
it is my understanding that for the Xavier that directory is only a temporary one that reflects the boot partition but doesnât affect it at all, i know it works like that for the TX2 but with the xavier itâs different. iâll give it a try just to be sure
Someone correct me if I am wrongâŠ
Some parts of â/bootâ stopped working when earlier boot stages began using alternate methods which support secure boot, and then passed that data along as an argument to later boot stages (versus reading directly from â/bootâ content). Some of that content was still used (e.g., Image) even then.
Xavier does not use U-Boot at all. For more recent L4T releases of CBoot (especially on Xavier) U-Boot functionality has begun to be added directly into CBoot, but it changes depending on release (this is still being evolved, it is a moving target). As an example some content from extlinux.conf (traditionally the territory of U-Boot) is now actually read by more recent L4T releases on Xavier even though there is no U-Boot (new and evolving functionalityâŠearlier CBoot would have ignored some content which it now looks at in the same way as U-Boot).
So far as I know the â/boot/Imageâ file should be used directly even though specifying it through â/boot/extlinux/extlinux.confâ has changed over time.
The host PC side âLinux_for_Tegra/rootfs/boot/â content is edited before creating the flashed image. Content put directly there can be lost during a flash.
1 Like
Hi all
As I know Xavier support boot from the partition and file from the file.
If you have configure the extlinux.conf it will boot from this assign. And boot from partition when remove the boot lebel from extlinux.conf.
finally had a chance to check this out, just replaced the Image file at /boot and it worked
i also copied the newly created modules to /lib/modules
and the generated modules.symvers to usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64
those last steps are required in order to be able to compile kernel modules.
iâm really glad this functionality has been added in order to allow easy kernel changes.
i really do hope it WOULD BE PROPERLY DOCUMENTED!
are there any other options to do with the /boot partition or the now somewhat working extlinux.conf? ( as itâs hardly documented)?
Especially is there a way to change the kernel command line without flashing?
Yes, you can change kernel command line using the extlinux.conf file. Just add after â{cbootargs}â variable.
BTW, if you have serial console to the board (which I am assuming there is for KGDB to work), I would recommend creating another entry in /boot/extlinux/extlinux.conf instead of replacing the L4T âImageâ entry as it becomes easier to boot back to the original (working) kernel in case the new kernel Image doesnât work as expected.
2 Likes
is it also possible to change the device tree dtb the same way or does it require the flash tool?