How to switch back to my previous kernel?

Hi,

I am using Jetson tx2 with custom kernel of L4T 28.1.0 (4.4.38+), however I accidentally installed a normal kernel L4T 28.1.0 (4.4.38). How can I switch back to kernel 4.4.38+ and delete kernel 4.4.38 without re-flashing my whole system as I have load quite a bit of stuff in it already.

Thanks!

“4.4.38+” indicates you have a modified kernel. “4.4.38-tegra” is what you would see from “uname -r” if it were unmodified. The “4.4.38” is the source code version, and any suffix after that is from configuration steps. So it is hard to say from what you have said what kernel you are trying to go to since both of those are non-stock for the TX2 under any R28.x release. More details on which kernel you want would help, and verify that “head -n 1 /etc/nv_tegra_release” shows R28.1.

You are in luck in terms of not needing to flash if your system is bootable. What is your current situation so far as the system being able to boot?

Even if not bootable you could make a rescue SD card, or you could clone, correct the clone, and flash the clone back in. All of this is basically some combination of updating the Image file in “/boot” and/or the extlinux.conf file in “/boot/extlinux/extlinux.conf”. Knowing what needs to be done might depend on above questions.

The default kernel is located in ‘64_TX2/Linux_for_Tegra/kernel/Image’ on your host system. If your Tx2 is bootable you can copy that to /boot.

It’s always a good idea to modify /boot/extlinux/extlinux.conf to keep a working kernel accessible…with that said I sometimes forget to do that!

Hi linuxdev,

Sorry for the late reply, I am able to boot my machine and both the modified kernel and unmodified kernel happen to be R28.1.0. In the end, I reflashed my machine as I am not able to find any solution to it.

You might consider saving a copy of the running system’s “/proc/config.gz” and a note of the output of “uname -r”. Together those two will give you the ability to recreate that exact kernel at any future date if you have the kernel source.

As D3_growe mentioned, when experimenting it is also better to leave the original “/boot/Image” in place and add an alternately named Image (e.g., “Image-custom”) and alternate entry in “/boot/extlinux/extlinux.conf”. Then reverting is a simple text file edit or serial console pick at boot.