Update Linux kernel on PYNQ

Hi,

I’m trying to update an user-compiled Linux kernel on my PYNQ-ZU board.
The PYNQ image version is v2.7, with the “5.4.0-xilinx-v2020.2” kernel version as default.
I followed this tutorial: Confluence.
I cloned ~canonical-kernel/ubuntu/+source/linux-xilinx-zynqmp/+git/focal - [no description] and cross-compiled “5.4.0-1021” branch successfully.
But I faced this when installing the new kernel:

xilinx@pynq:~/linux-kernel_5.4.0-1021$ sudo dpkg -i ./*.deb
# ...
Setting up linux-buildinfo-5.4.0-1021-xilinx-zynqmp (5.4.0-1021.25) ...
Setting up linux-modules-5.4.0-1021-xilinx-zynqmp (5.4.0-1021.25) ...
Setting up linux-xilinx-zynqmp-headers-5.4.0-1021 (5.4.0-1021.25) ...
Setting up linux-headers-5.4.0-1021-xilinx-zynqmp (5.4.0-1021.25) ...
Setting up linux-image-5.4.0-1021-xilinx-zynqmp (5.4.0-1021.25) ...
Failed to create symlink to vmlinuz-5.4.0-1021-xilinx-zynqmp: Operation not permitted at /usr/bin/linux-update-symlinks line 64.
dpkg: error processing package linux-image-5.4.0-1021-xilinx-zynqmp (--install):
 installed linux-image-5.4.0-1021-xilinx-zynqmp package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-5.4.0-1021-xilinx-zynqmp

I checked the /boot partition, it’s in FAT32 format which does not allow symbolic links.
What should I do next? Or is there any more properly way to install the kernel on PYNQ?

Thank you in advance.

1 Like

Hi @haipnh,

I would hope there is a way to disable the use of symlinks, maybe a flag you can set while cross-compiling or installing? You might be able to use the workaround discussed in this stackoverflow post Issue with installing the latest linux image in lubuntu 20.04 - Ask Ubuntu

Thanks
Shawn

1 Like

Hi @skalade ,

Thank you for your response. I tried your suggestion and it passed the installation.
However, the warning message was:

Setting up linux-image-5.4.0-1021-xilinx-zynqmp (5.4.0-1021.25) ...
/etc/kernel-img.conf: W: ignoring no_symlinks; only symlinks are supported
Processing triggers for linux-image-5.4.0-1021-xilinx-zynqmp (5.4.0-1021.25) ...

After reboot, the old kernel is still being used.

1 Like

Hi @haipnh, apologies for late reply. I looked over the tutorial you’re following and this seems like it’s targeted more towards other Ubuntu OS’s that ship with Kria or the Canonical ZCU102/104/etc. Linux images.

The boot processes are slightly different from PYNQ, those images will have a /boot/firmware and vmlinuz. To update the PYNQ kernel you might be better off using the petalinux flow to generate new bootfiles and a new uImage. Or adapting your current workflow to spit out a uImage instead of the .deb.

Thanks
Shawn

3 Likes

Thank you @skalade . I understood.
I am checking the boot sequence from source PYNQ/sdbuild/boot.
I see that there are 3 files in /boot partition need to be updated: BOOT.BIN, boot.scr, image.ub. Is that correct?

Yes, that’s correct, uimage is where your kernel image will be living. If you look at the sdbuild makefile these files are generated by the boot_files target.

Thanks
Shawn