Close

Installation - Failures

A project log for Linux CNC - Installation

This project covers the nuances of installing Linux CNC 2.8 pre and setting up a consistent environment.

greg-duckworthGreg Duckworth 04/23/2020 at 09:310 Comments

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:

  1. Support for hardware that will be used in my milling machine conversion (7i96 - Mesa Electronics)
  2. Support for the latest Python, Python-pip and other current software repositories
  3. Pretty, familiar UI. I use Linux Mint as my typical Linux distro.
  4. 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.

I (mostly) followed the instructions here:

https://gnipsel.com/linuxcnc/uspace/index.html

(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:

https://unix.stackexchange.com/questions/270390/how-to-reduce-the-size-of-the-initrd-when-compiling-your-kernel

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.

New CPU, new day, same old problems.  I installed Linux Mint 19.1 - Mate - 64-bit on the computer, downloaded all the RT Kernel bits, including the correct patches, compiled the Kernel, module_installed (with stripping), installed the Kernel, installed grub-customizer, reboot.

Same old errors, just faster because of the new CPU...

At this point, I had downloaded 3 distros, which I had installed 5 times, upgraded the CPU, compiled the Kernel 6 times (much faster when using the Q9300 with the -j4 flag).  This was getting old.  I need a win.  I have the old Debian 7 version (2015 vintage) Linux CNC install still available on a hard disk and I don't want to go back.  Its a nice safety net though.

I downloaded the 'linuxcnc-2.7.14-wheezy' ISO from the Linux CNC website, but this is not much of an upgrade and still has the issues with repositories etc.  This doesn't even install properly because the mirrors that are necessary for installing 3rd party software are not functional.  I was rather short on patience at this point so I didn't try to find out if it was my install procedure, my internet, or the mirror servers to blame.  

I may have tried the 'linuxcnc-stretch-uspace-i386-r13' ISO as well, but at this point, I was not being rigorous so maybe I didn't get around to it.

The next project log will be the actual success that I have had.  If you have any questions, please ask.  There is a happy ending, promise.

Discussions