[Home]Building RTAI 5.2 Packages

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

The first steps are Copied directly from https://github.com/NTULINUX/RTAI

Also see https://github.com/SebKuzminsky/linux-rtai-build (which is a very well documented system for building several different flavours of RTAI automatically. I don't know why I didn't use it...

Installing RTAI

Commands marked with # specify root, commands marked with $ are user commands.

1.) Download the RTAI source

 $ git clone https://github.com/NTULINUX/RTAI.git

Make patched kernel packages

2.) Patch kernel with IPIPE, in this case we use 4.14.148

 $ sudo rm -rf /usr/src/000*.patch /usr/src/linux
 $ cd /usr/src
 $ sudo wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.14.148.tar.xz
 $ sudo tar xf linux-4.14.148.tar.xz
 $ sudo  ln -sfv linux-4.14.148 linux
 $ sudo cp -aLv /path/to/this/RTAI-git-tree/ksrc/patches/v4.14.148/*.patch /usr/src/
 $ cd linux
 $ sudo patch -p1 < ../0001*.patch
 $ sudo patch -p1 < ../0002*.patch
 $ sudo patch -p1 < ../0003*.patch
 $ sudo patch -p1 < ../0004*.patch
 $ sudo make olddefconfig
 $ sudo make menuconfig

// Differs here from NTULinux //

in the menu configuration select General Config -> Local version - append to kernel release Use "-rtai-amd64". This will avoid a problem later with RTAI config needing two parameters.

 $ sudo make
 $ sudo make install
 $ sudo make modules_install

On debian this will automatically update grub and set the system to boot from the new kernel.

REBOOT (and check with uname -r that the new kernel is running: 4.14.132-rtai-amd64

If it boots to the busybox boot to the old kernel then run these commands JT

  cd /usr/src/linux
  sudo make modules_install
  sudo make install

If the kernel boots you can now make kernel packages:

 $ sudo make deb-pkg


Make RTAI application packages

4.) Configure, build and install RTAI (MUST BE BOOTED INTO YOUR NEW RTAI KERNEL)

 $ cd ~/RTAI
 $ ./autogen.sh
 $ ./configure

Now set up debian. The NTULINUX repo now contains the magic sauce from: https://github.com/SebKuzminsky/rtai/tree/old-3.9-debs/debian

Consider changing the maintainer name in configure.in Create a git tag to have a release number: git tag -a 5.2.2-linuxcnc -m "experimental RTAI debs for LinuxCNC"

update the changelog:

 $ debian/update-dch-from-git
 $ debian/configure 4.14.148 rtai amd64

build packages:

 $ dpkg-buildpackage

This will give _many_ messages about missing math functions. Ignore these. There will also be an error about package signing and gpg, I need to find out how to fix that, but the debs are still built.


Install them

 $ sudo dpkg -i rtai-modules-4.14.148_5.2.2_amd64.deb

Make LinuxCNC Packages

First get the LinuxCNC source:

 $ git clone https://github.com/LinuxCNC/linuxcnc.git linuxcnc-dev

Select the branch you want to build:

 $ git checkout 2.8
 $ git pull

You must first apply all patches to LinuxCNC located in the linuxcnc_patches directory of the NTULINUX/RTAI repository before you run ./autogen.sh inside it's source tree.

To do this:

 $ cd linuxcnc-dev
 $ patch -p1 /path/to/this/RTAI-git-tree/linuxcnc_patches/0001*.patch
 $ cd src
 $ ./autogen.sh

Configure to build with the currently running (should be RTAI) kernel.

 $ debian/configure -r 

LinuxCNC has many dependencies, get a list of these and install them:

 $ dpkg-checkbuilddeps

(This will return a list that can be pasted after "sudo apt-get install" but that will need editing to remove minimum version number and alternatives)

build debian packages:

 $ dpkg-buildpackage

YOU NOW SHOULD HAVE LINUXCNC Packages (in the folder below /linuxcnc-dev )

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited October 15, 2019 12:53 am by MalteR (diff)
Published under a Creative Commons License