Linux CNC has been built for at least 3 different real-time kernels, has been shown to work with distros like Linux Mint and Ubuntu, as well at the default Debian.
I have previously been using an early pre-release of Linux CNC on Debian 7. My main reason for upgrading is the requirement for python packages and other software that is no longer supported on Debian 7.
This project will cover the real method I have used to install Linux CNC 2.8 pre on Debian 9, including the quality-of-life changes I have made. It will also include the links to other peoples instructions which I used to compile this poroject.
For informational purposes, I will also include the myriad ways in which I could not get LinuxCNC working. It is important to document your 'failures' as well as successes, although in this instance I do not consider them failures as I learned several useful things along the way.
When I tried to install Linux CNC, I found that there was a lot of useful information, but the world had moved on and the information was not as applicable as it once was. I spent a significant amount of time trying to update the guides for the current software but no dice.
Anyway, the reasons I want a current Linux CNC install:
Support for hardware that will be used in my milling machine conversion (7i96 - Mesa Electronics)
Support for the latest Python, Python-pip and other current software repositories
Pretty, familiar UI. I use Linux Mint as my typical Linux distro.
USB support for RS485 converter, and wireless networking
I know Linux Mint has current software repositories, and a decent UI that I am familiar with, works with the USB wifi dongle and the USB RS485 converter I have. So lets start there.
(Side note: the information on this site was invaluable, I am glad the time was taken to collect that information in a single place. Thank you.)
I started off by downloading Linux Mint 19.3 - Mate - 32-bit
The Mate desktop environment is great for older hardware as it doesn't use as many resources as the fancier desktops but it still has all the comforts I have come to expect with a modern Linux. I chose the 32-bit to ensure that my old hardware would be compatible.
Installed Mint from USB
My old hardware would not boot from a USB 3 flash drive, so I had to use a USB 2 drive instead. :(
Downloaded the real-time patches, as per the 'Linux Mint 19.1 RT Kernel' page.
I initially downloaded the newest real time patches I could find, to got with the newer Linux distro (I had downloaded Mint 19.3, the tutorial covered Mint 19.1) This was a mistake.
Built the Preempt Kernel.
What a pain in the ass is kernel building. I ran out of hard disk space once because the build files were 16 GB and I had used a small SSD as a boot drive. This was a mistake.
The actual build process itself takes a very long time, especially on a Pentium D, without using the proper build flags and limiting the build to a sensible hardware configuration. This was a mistake.
After the Kernel built over night, I followed the rest of the tutorial.
Installed the Kernel, installed grub-customizer, reboot.
Linux Mint not boot into Preempt Kernel, will boot into other Kernels, just not the new one. I found the problem is that the Kernel I built is too large to fit in the initial RAM disk that is used to boot Linux. Great.
To fix this, I had to reboot into a working Kernel, then re-make the Kernel, using commands to strip the built modules. Wow that was a pain. I used this website as a guide:
I started the build process again, deleting the extracted files (all 16+GB Gone :( ), to ensure I was starting with a clean slate. I ended up running these commands specifically:
make -j4 make INSTALL_MOD_STRIP=1 modules_install make install
This gave me an initrd image that was ~60MB instead of 580MB as before. Great.
Sort grub, reboot.
Not having it. Some very strange errors that I can no longer remember and that google did not help with. Bugger.
So I started again.
This time with Mint 19.1 and the older RT patches. I followed all of the steps in the guide and got to the 'sort grub, reboot step' without too much trouble. Still, Linux would not boot to the Preempt RT Kernel.
At this point I ordered a more modern CPU for my motherboard. I upgraded to a Q9300 quad core, costing only £7 from eBay. I did this because the Pentium D was limited to 32-bit, and I wondered if the 64-bit versions of Linux Mint would have better luck. It was also an upgrade in terms of the performance and should reduce the jitter of the LinuxCNC's base thread.