Linuxcnc 2.9.4 .iso on Rpi5: apt update does not build /boot/initrd.gz

  • rdtsc
  • rdtsc's Avatar Topic Author
  • Away
  • Senior Member
  • Senior Member
More
18 May 2025 02:19 - 18 May 2025 02:35 #328663 by rdtsc
Hi, have been using LinuxCNC since 2.9.0~pre1 on a Rpi4.  Now have 2.9.4 or an Rpi5 and things were working great, until I did a sudo apt dist-upgrade earlier today.  After, I cannot shut the Rpi5 off, because apt removed the /boot/initrd.gz file:
...
Setting up libmagickcore-6.q16-6-extra:arm64 (8:6.9.11.60+dfsg-1.6+deb12u3) ...
Setting up libpython3.11-stdlib:arm64 (3.11.2-6+deb12u6) ...
Setting up linux-headers-6.1.0-35-arm64 (6.1.137-1) ...
/etc/kernel/header_postinst.d/dkms:
dkms: running auto installation service for kernel 6.1.0-35-arm64.
Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
kernelver=6.1.0-35-arm64 ./dkms-make.sh.........................................
Signing module /var/lib/dkms/rtl8821cu/5.12.0.4/build/8821cu.ko
Cleaning build area...

8821cu.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-35-arm64/updates/dkms/
depmod...
dkms: autoinstall for kernel: 6.1.0-35-arm64.
Setting up python3.11 (3.11.2-6+deb12u6) ...
Setting up linux-headers-arm64 (6.1.137-1) ...
Setting up libpython3.11:arm64 (3.11.2-6+deb12u6) ...
Processing triggers for systemd (252.36-1~deb12u1) ...
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for cracklib-runtime (2.9.6-5+b1) ...
Processing triggers for mailcap (3.70+nmu1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for libc-bin (2.36-9+deb12u10) ...
Processing triggers for initramfs-tools (0.142+deb12u3) ...
update-initramfs: Generating /boot/initrd.img-6.12.12+bpo-rt-arm64
update-initramfs: Generating /boot/initrd.gz
cp: target '/boot/initrd.gz': No such file or directory
cp: target '/boot/broadcom/initrd.gz': No such file or directory
linuxcnc@linuxcncpi:~$ what the...

See the rpi-1 attachment for the complete text:

File Attachment:

File Name: rpi-1_fail...mand.txt
File Size:17 KB


Note, the (highly finnicky) rtl8821cu wifi dongle driver was installed about a month ago.  Apt did attempt to rebuild this driver for kernel 6.1.0-35, but that was an old kernel and (now at least) no longer exists in /boot.  Now in there, are only 6.12.11 and 6.12.12+bpo-rt-arm64.  Note the latter is much larger than the previous:
linuxcnc@linuxcncpi:/boot$ ls -ag
total 170932
drwxr-xr-x 3 root 4096 May 17 16:16 .
drwxr-xr-x 18 root 4096 Mar 10 18:49 ..
drwxr-xr-x 3 root 16384 Dec 31 1969 broadcom
-rw-r--r-- 1 root 245283 Jan 26 07:36 config-6.12.11
-rw-r--r-- 1 root 332811 Feb 23 13:00 config-6.12.12+bpo-rt-arm64
lrwxrwxrwx 1 root 14 May 17 16:16 firmware -> /boot/broadcom
-rw-r--r-- 1 root 26624512 Jan 26 07:36 Image
-rw-r--r-- 1 root 22391722 May 17 16:16 initrd.img-6.12.11
-rw-r--r-- 1 root 71401400 May 17 16:15 initrd.img-6.12.12+bpo-rt-arm64
-rw-r--r-- 1 root 4085277 Jan 26 07:36 System.map-6.12.11
-rw-r--r-- 1 root 83 Feb 23 13:00 System.map-6.12.12+bpo-rt-arm64
-rw-r--r-- 1 root 9535537 Jan 26 07:36 vmlinuz-6.12.11
-rw-r--r-- 1 root 40374208 Feb 23 13:00 vmlinuz-6.12.12+bpo-rt-arm64
linuxcnc@linuxcncpi:/boot$

I can't get update-initramfs -c -k all -v to build the /boot/initrd.gz; it always complains with: cp: target '/boot/initrd.gz': No such file or directory

File Attachment:

File Name: rpi-2_upda...bose.txt
File Size:37 KB


I've updated the rtl8821cu driver, rebuilt and reinstalled it, but this did not help.  Then I removed it completely; same.  Thoughts?  Thanks much for taking a look.

P.S. A really, really good idea would be to, right now, sudo nano /etc/initramfs-tools/update-initramfs.conf and change backup_initramfs=yes
Attachments:
Last edit: 18 May 2025 02:35 by rdtsc.

Please Log in or Create an account to join the conversation.

More
18 May 2025 07:12 #328669 by unknown
Why did you a dist-upgrade ?

The kernel is a custom kernel (this has been explained in the first thread of the Rpi image thread) and does not come from the debian repos (the kernel sources are from the RPi github repo and contain patches specific to the RPi platform), from memory the debian kernel packages don't have the RPi patches nor support for dymanic device, eg spi, I2C and such.

Save your configs, reinstall and don't do a dist upgrade, there is no need to upgrade the kernel, if you do have stability related issues related to the kernel please make a report in the forum.

Not being to turn off the Rpi could be related to a device tree issue, eg the GPIO that is used is not setup correctly.

Please Log in or Create an account to join the conversation.

  • rdtsc
  • rdtsc's Avatar Topic Author
  • Away
  • Senior Member
  • Senior Member
More
18 May 2025 16:37 #328702 by rdtsc
Aaah I see; thoughtless mistake then. Kernel 6.1.0-35-arm64 was the linuxcnc one, which apt erroneously removed in favor of 6.12.11-1 and 6.12.12+bpo-rt-arm64, since those (recently) emerged as the logical successor. Note to future self: do NOT accidentally do dist-upgrade on LinuxCNC!

I was hopeful though, that the original version could be reinstalled without having to redo the whole install. This is because when removed, apt did note that it could not remove the 6.1.0 folders as they had custom files in them. But alas, I accidentally removed linux-image-bcm2712-rpi since that was now linked to the 6.12.12 kernel. That package has no installation candidate, so I'm borked. Reinstalling...

Please Log in or Create an account to join the conversation.

More
18 May 2025 17:33 #328705 by unknown
Best thing to do is think of an RPi running Linuxcnc as the ECU in an early 2000's car or bike, as long as it works there's no real need to upgrade.
I'd like to be able to count the amount of times I upgraded the ECU on my 1999 Toyota Echo on one hand, but I have all the fingers on each hand

Please Log in or Create an account to join the conversation.

More
19 May 2025 12:05 #328737 by rodw
Its quite tricky building a custom kernel for preempt_rt. What we have done here is look at the kernel version the RT patch was released on at kernel.org, then we have to find the actual commit in the Rpi kernel git that matches the same release. If the kernel version deviates from the RT patch, the kernel will fail. So we end up with a kernel in between released versions of Debian. We also need to be ahead of the released kernels to maximize support for the Pi 5 which was released just after Linuxcnc 2.9.1 was released. Rpi are also making it hard for us since the Pi 5 because they are no longer tracking each version of the Linux kernel so sometimes, we can't upgrade to a later RT patch.

So you have to wait for Linuxcnc to release new images for a  reason. Don't try and upgrade yourself without forking thr Linuxcnc builder and compiling from source

Please Log in or Create an account to join the conversation.

  • rdtsc
  • rdtsc's Avatar Topic Author
  • Away
  • Senior Member
  • Senior Member
More
21 May 2025 13:01 - 21 May 2025 13:01 #328857 by rdtsc
Noted, and quite tricky indeed; thanks for staying the course and helping out so many people. Think the rpi-5-debian-bookworm-6.1.61-rt15-arm64-ext4-2023-11-17-1520.img.xz from linuxcnc.org/iso/ is missing the [rpi5] section in config.txt - I've tried this one several times, and it always kernel panics 0.5s into boot. I must have been using the rpi-5-debian-bookworm-6.12.11-arm64-ext4-2025-01-27-0140.img.xz before - will try that one again.

P.S. of course, after flashing the SD card, then I find the whole-SD backup, d'oh!
Last edit: 21 May 2025 13:01 by rdtsc.

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum