Proposal RPi Linuxcnc Image Based on Raspi OS All welcome/encoraged to comment

  • unknown
  • Away
  • Platinum Member
  • Platinum Member
More
18 Oct 2025 10:49 - 18 Oct 2025 10:52 #336656 by unknown
After a bit of a discussion with forum member f355 it came to my attention that an image based on the "Raspiberry Pi Way" maybe possible. Whilst a little "terse" at first he did raise some valid point and gave me time to reconsider some things. And eat some humble pie. I would like to give thanks for this...sometimes it's needed to find a new direction.

One reason for this idea is to make using the image more familiar to those used to the RPi ecosystem. Being able to use the RPi imager and setup some defaults may be beneficial as well.

At the moment I'm experimenting with pi-gen ( github.com/RPi-Distro/pi-gen/tree/bookworm-arm64 ) target a bookworm based image, as I feel as time moves on and more familiarity is gained using the tool a working image with a RT kernel and Linuxcnc will be produced and can be compared to the existing image. Wifi seemed to be a bit of a issue from time to time.

Hopefully from this in the readme "Tool used to create Raspberry Pi OS images, and custom images based on Raspberry Pi OS, which was in turn derived from the Raspbian project." distribution should not be an issue.

So the first task is to create a basic image to get a feel for the tool.

All input whether positive or negative ( remember coming from Australia I'm somewhat hard to offend ;) ) is welcomed and encouraged. Rather than the way it has happened in the past I would like this to be more of a community effort with regards to packages. Please remember the object is not to create a daily driver OS but one that makes the entry easier to running Linuxcnc on a Pi. Whilst it may be beneficial to include CAD\CAM I feel leaving this out will create a smaller image to download, and as there are many packages available half will be happy, half wont be and the other half may not have a preference.

As a final note the final decision will have to be made by the Linuxcnc hierarchy as I dont want to go against their wishes, but for the moment I think at least a discussion is good idea, and see what the community thinks.

Yes,yes I know some our esteemed members aren't exactly keen (not recommend) on the RPi due to cost factor. ;)

Cheers
Rob
Last edit: 18 Oct 2025 10:52 by unknown. Reason: Edit title due to issues with being a little silly
The following user(s) said Thank You: tommylight

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

More
18 Oct 2025 13:29 #336659 by f355
first of all, thanks for the kind(-ish, lol) words, I'm happy to be helpful to the community even if it is just planting ideas into smart people's minds :)

have you seen github.com/raspberrypi/rpi-image-gen? to me it looks like a better fit for the purpose - all we need is to install some packages and configure some things, right? building the entire distro from scratch seems excessive.
The following user(s) said Thank You: unknown

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

  • unknown
  • Away
  • Platinum Member
  • Platinum Member
More
18 Oct 2025 13:45 #336660 by unknown
Saw that, but was too lazy to setup the spare RPi. In fact that was what led me to pi-gen. Tho I haven't completely ruled it out.
Tho I do seem to like with pi-gen you can stop the process at certain stages.
Luckily or maybe not so I'm in a position where time is something I have plenty of. Also a couple of PC's I can use to build different configs. Sadly only one spare RPi400 and one spare RPi5, with the RPi5 being part of a very generous gift on Father's Day from my son.

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
18 Oct 2025 13:50 #336661 by tommylight

I'm happy to be helpful to the community even if it is just planting ideas into smart people's minds :)

That is quite a habit to have, so use it as much as possible.
The following user(s) said Thank You: JT

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

  • unknown
  • Away
  • Platinum Member
  • Platinum Member
More
18 Oct 2025 23:15 #336678 by unknown
@f355

I've tried looking for a RT_PREEMPT kernel in the repos, but could only find kernels that were configured for Real time not Preemptive real time (which is what Linuxcnc requires).
Debian doesn't have any support for the RPi5 as it doesn't have enough upstream kernel support.
wiki.debian.org/RaspberryPiImages#Overview

and

raspi.debian.net/tested-images/

So to get a full RT_PREEMPT kernel the only solution it would seem is to roll our own. Which would not be a suitable solution for upgrading.

One solution maybe if Linuxcnc could host suitable kernels, but I really don't see the sense in a regular upgrade regarding the kernel in this situation. I'm still running the original kernel that was built whilst building the image in Jan 2025.

BTW running pi-gen builds a couple of flavours of images everything from lite to a fully image. Tho it does use a significant amount of disk space.

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

More
18 Oct 2025 23:54 #336680 by rodw
Debian includes a RT kernel for the Pi 4b and it is possible to get a working RT linuxcnc install using the Debian images. But the RT kernel was not installed as a dependency from linuxcnc-uspace and needed installing separately with something like sudo apt install linux-image-rt-$uname -r) (might not have that correct. The only catch is that the images only install a text terminal with a root user. You needed to add a user, add sudo rights and then install xfce to get a working system ut it is quite doable. Sadly it does not appear support continued to the pi5.

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

  • unknown
  • Away
  • Platinum Member
  • Platinum Member
More
19 Oct 2025 00:05 #336682 by unknown
Hiya Rod ;)

From memory the Debian Rpi kernels lacked support for overlays, which was a show stopper for SPI.

ATM I'm cross compiling a kernel from the 6.12.y branch, I think that was what was used in the January build.

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

More
19 Oct 2025 02:30 #336689 by rodw
Sorry, I have no idea about the Pi... but I did get the 4b working years ago.

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

More
19 Oct 2025 05:41 #336691 by f355

I've tried looking for a RT_PREEMPT kernel in the repos, but could only find kernels that were configured for Real time not Preemptive real time (which is what Linuxcnc requires).


the packages are on archive.raspberrypi.org . you want linux-image-6.12.34+rpt-rpi-v8-rt, it works for both RPi 4 and 5. there's a meta package linux-image-rpi-v8-rt that depends on the latest version of the RT kernel, but it gives you auto-updates with apt, which is not necessarily a good idea (e.g. the currently-latest 6.12.47 is hanging my Pi5 sometimes).

it is a proper PREEMPT_RT kernel:
$ uname -a
Linux ratcage 6.12.34+rpt-rpi-v8-rt #1 SMP PREEMPT_RT Debian 1:6.12.34-1+rpt1 (2025-06-26) aarch64 GNU/Linux

in order for bootloader to use it, you need to add kernel=kernel8_rt.img to /boot/firmware/config.txt.

the kernel configs themselves are here .

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

  • unknown
  • Away
  • Platinum Member
  • Platinum Member
More
19 Oct 2025 06:55 - 19 Oct 2025 06:56 #336694 by unknown
A couple of things related to choosing a Kernel for Linuxcnc.

For the RPi4 you require options for the bcm2711 in the config.
For the RPi5 you require options for the bcm2712 in the config.

The change of the SoC broke a lot of stuff that broke GPIO stuff. What previously worked on the RPi4 failed on the RPi5. In the context of Linuxcnc this required a rewrite of the SPI driver for the RPi5.

For both SoCs
CONFIG_PREEMPT_RT=y
must be set. Otherwise we dont get the real time model required.

In the link you gave for the configs only the bcm_2711 rt config has that option set. The bcm_2712 config does not.

With regards to the kernel version the one on the image is uname -a
Linux raspberrypi 6.12.11 #1 SMP PREEMPT_RT Mon Jan 27 00:10:15 AEDT 2025 aarch64 GNU/Linux

This was built from the 6.12.y branch in January. Whilst not to up to date 6 months later it was in January and has proved to be stable. With regards to the kernel itself there have been no reports of crashing, except one user whilst using GMOCCAPY but this was traced to zram swap issue.

This is the one running my RPi5 on the mill, it's been up for 39 odd days with no issues. Having the power saving stuff turned off on the wifi has been constantly connected for those 39 days. Usually it powers down after some time.
Attachments:
Last edit: 19 Oct 2025 06:56 by unknown.

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

Time to create page: 0.354 seconds
Powered by Kunena Forum