The tx2 kernel cannot be started normally,how to update the kernel?

I modified the kernel source code and recompiled to get Image, and replaced the /boot/Image file. Restart the system. The kernel cannot be started due to a problem with the modification.

  1. I used the following command to update the kernel partition, but the system still cannot be started.
    ./flash.sh -k kernel jetson-tx2 mmcblk0p1
    Check the log, you can confirm that the update has been successful.
  2. I think uboot uses /boot/Image to start, and flash.sh cannot update the /boot/Image file.
  3. I don’t want to use sdkmanager to re-flash, if I do this, it will take too long.
    Is there a solution to this problem?
    thinks!!!

hello qulei159,

both of above are correct approaches to update kernel image,
this boot failure should related to your modification, may I know what’s the error messages,
thanks

  1. I know why the kernel cannot run normally. I now need to re-update a normal kernel.
  2. Because the kernel cannot run normally, I cannot replace the /boot/Image file. Using flash.sh to update the kernel partition has no effect.
  3. When the kernel is abnormal,Is there a way to update the /boot/Image file from uboot . Or let uboot boot Image in the kernel partition?

hello qulei159,

it’s because kernel is loaded from /boot/Image by default; please check /boot/extlinux/extlinux.conf for the LINUX entry.
by using flash commands update the kernel image in the partition,
for example,

$ ls -al /dev/disk/by-partlabel
...
kernel -> ../../mmcblk0p28

please check Environment Configuration session,
you may have a try by modify scan_dev_for_extlinux variable, making u-boot not to use extlinux configuration files.
thanks

I modify scan_dev_for_extlinux variable, making u-boot not to use extlinux configuration files.

U-Boot 2016.07-gd917e08cec (Aug 12 2019 - 21:16:16 -0700)

TEGRA186
Model: NVIDIA P2771-0000-500
DRAM:  7.8 GiB
MC:   Tegra SD/MMC: 0, Tegra SD/MMC: 1
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@2490000
Hit any key to stop autoboot:  0 
MMC: no card present
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Unknown command 'mmc0' - try 'help'
Unknown command 'mmc0' - try 'help'
starting USB...
No controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No controllers found
ethernet@2490000 Waiting for PHY auto negotiation to complete....... done
BOOTP broadcast 1

How to configure uboot, let uboot boot Image in the kernel partition of mmc0?

hello qulei159,

you may set this script to an innocuous command, such as true for the boot process not using extlinux configuration files. then it’ll load kernel image via kernel partition.
thanks

I set scan_dev_for_extlinux to true, Still can’t load the kernel image via the kernel partition。

U-Boot 2016.07-gd917e08cec (Aug 12 2019 - 21:16:16 -0700)

TEGRA186
Model: NVIDIA P2771-0000-500
DRAM:  7.8 GiB
MC:   Tegra SD/MMC: 0, Tegra SD/MMC: 1
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@2490000
Hit any key to stop autoboot:  0 
MMC: no card present
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
starting USB...
No controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No controllers found
ethernet@2490000 Waiting for PHY auto negotiation to complete...... done
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3

Actually, I think you can just reflash the board.

The uboot is not able to read the image from partition. Only cboot can. To make cboot reads the partition, you can try to add USE_UBOOT=0 during flash, but that requires you to reflash the board again.

Or you can make other boot drive, let the uboot to use that boot drive to boot up. After it boot up, modify the kernel on /dev/mmcblk0p1 and fallback again to boot up with emmc.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/flashing.html#wwpID0E0HM0HA

I have solved the problem:

  1. Using the SD card, create the /boot/ directory in the SD card, and put the extlinux/extlinux.conf, Image and initrd files in the /boot directory.
  2. After plugging in the sd, restart the system. At this time uboot will first load /boot/Image in mmc1, and load the file system in mmc0 after the kernel starts normally.
  3. Replace /boot/Image in mmc0 with the normal Image.
  4. Unplug the sd card, restart, and the system returns to normal.
1 Like

Good. That is the method to use a second boot drive.