I have a driver that requires a kernel version below 5.8. Apparently something changed in the kernel above that version, causing the driver not to work with later versions.
I can build the kernel version 5.8 on the device (which is NanoPi NEO3). The problem I ran into is installing and having the DietPi boot with that kernel version (so that I can use the driver).
When i use the dpkg -i to install the newly built kernel image package, nothing happens. The unit still boots with the original kernel version.
How do I install the new kernel version, so that the DietPi boots with that version?
Just to avoid a misunderstanding. DietPi do not have own kernel versions. We use the kernel provided by the base image. And this depends on base image used.
I can recompile the driver (in fact, it needs compiling as it uses kernel headers) but it doesn’t work properly… It’s a known problem, that it doesn’t work properly with kernel versions above 5.8.
And I have the kernel version 5.8 compiled on the device, but I can’t install it the regular way… Apparently DietPi uses different boot scripts/technique, so my question is what do I need to do (edit) to have the DietPi use my compiled kernel image?
as Joulinar said…stock kernels are used…so there should be a way to downgrade to an older kernel…it might cause other apps to have issues if they were designed/built for the newer kernels however
@WarHawk The problem is that it’s not enough. The last step (grub update) updates grub with new images, but the DietPi doesn’t boot from them. The DietPi boot scripts are different than on standard Debian, so there’s more to be done, but I don’t know what exactly…
I’m sure you’re right and possibly one of the reasons why the procedure suggested by WarHawk, or installing compiled kernel image with dpkg -i, doesn’t work… DietPi still boots with the original kernel version.
I just searched a little bit, since I’m interested in the topic, but I have no armbian device to test nor experience with downgrading kernel at all.
“Normally” armbian-config is recommended to downgrade the kernel, at least this is the common answer in armbian forums. But I have no clue how this will interact with DietPi.
It should be available via apt on armbian systems, I think.,
I believe if you build Armbian server [non desktop] for your board with the bullseye distro/kernel (not sure how to build with the last 5.8.18 kernel[last 5.8 version before they moved to 5.9]) then run the dietpi if it would convert it without issues…I know it did work with a few of the orange pi images I made a while back
I did just compile the latest Armbian for Orange Pi R1+ LTS tonight on my laptop in Virtualbox at work…it does compile, but I pretty much did stock everything across the board, like I said, didn’t try to change it to an older kernel
I believe if you build Armbian server [non desktop] for your board with the bullseye distro/kernel (not sure how to build with the last 5.8.18 kernel[last 5.8 version before they moved to 5.9]) then run the dietpi if it would convert it without issues…
I tried that already, but in the process it either upgraded the kernel or downloaded the new one…
ls -l /boot
cat /boot/armbianEnv.txt
cat /boot/boot.cmd
The paths to the Linux image, device tree and initramfs need to be changed in /boot/boot.cmd, and everything related to device tree overlays needs to be removed (unless your kernel build contains some). Then it needs to be compiled to /boot/boot.scr.
In case something goes wrong, do you have another system where you can access this systems ext4 filesystem to restore the original state?