building linuxcnc-dev on ubuntu 16.04 preempt-rt kernel

More
8 years 6 months ago #109144 by rodw
I actually tried the 4.14 kernel last night but I lost support for my Displayport monitor on my Toshiba Dynadock so I'll stick to 4.16 for now. I'm not worried about that becasue this laptop does not have a network port so I'll only ever run sims on it.

For those following, its not hard to change the attached script to install and patch a different kernel. You just need to poke around in the repositories referred to in the wget statements in autoinstall.sh. If you want to install the PREEMPT_RT, make sure you choose a version that has a RT patch as there is not one released for every kernel version.

Once you decide on a version just update the scripts to replace the existing references something like this:
Code:
sudo apt-get install devscripts build-essential imagemagick texlive-font-utils tcl8.6-dev tk8.6-dev libxaw7-dev libncurses-dev libreadline-gplv2-dev dblatex groff python-dev python-tk libglu1-mesa-dev libgtk2.0-dev asciidoc source-highlight libboost-python-dev texlive-lang-cyrillic debhelper texlive-lang-french texlive-lang-spanish texlive-lang-german libmodbus-dev dvipng libusb-1.0-0-dev graphviz inkscape python-numpy python-imaging-tk python-gtkglext1 tclreadline blt bwidget libtk-img tclx libudev-dev gstreamer0.10-plugins-base python-vte libqt4-dev libssl-dev texlive-lang-polish w3c-linkchecker libxenomai-dev git python-pil.imagetk wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.14.34.tar.gz wget https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/4.14/patch-4.14.34-rt27.patch.gz tar -xpf linux-4.14.34.tar.gz gunzip patch-4.14.34-rt27.patch.gz cp patch-4.14.34-rt27.patch linux-4.14.34 cd linux-4.14.34 cat patch-4.14.34-rt27.patch | patch -p1 make xconfig make -j2 deb-pkg sudo add-apt-repository ppa:danielrichter2007/grub-customizer sudo apt-get update sudo apt-get install grub-customizer #grub-customizer

I would not recommend trying this version becasue it is too close to the bleeding edge. From version 4.15, the kernel includes protection from the Spectre and Meltdown vulnerabilities which is the only reason why I've chosen to run the latest kernel on this machine.

Finally, if you just want to be able to change your kernel at will and not use the PREMPT_RT kernel, there is a cool tool called ukuu that you can install with apt-get. It allows you to chose any kernel and install it. sooo easy!
More
8 years 6 months ago - 8 years 6 months ago #109257 by Grotius
Hi Rodw,

What do i have to do, to make a rt patch off the latest kernel release? For example i want to make a rt kernel of :
mirrors.edge.kernel.org/pub/linux/kernel/v4.x/patch-4.16.gz
Is it difficult to do?

At the moment i am understanding only the rt patches will be usable on real machines and you must check the rt project directory to
find this out.
mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/

Did you read the man pages 9 about the kernels? This section is not available by default.
Last edit: 8 years 6 months ago by Grotius.
More
8 years 6 months ago #109265 by rodw
I think the correct process is to look at the patches and choose a kernel version that has an available RT patch. Eventually the Linux RT Kernel team will release a version that includes support for Spectre and Meltdown protection (eg 4.15 and above). I understand this might introduce a performance hit on hardware as the vulnerability is in the Intel CPU architecture. I don't know if it would be a good idea to use it for a cnc machine.

Also its not a good idea to go too close to the latest bleeding edge of Linux development as there could be stability issues. When I built my machine Mint 18.1 was available but on PCW's advice I installed 17.3 because of some compatibility issues.

Whilst I try hard, I'm very much a linux novice.
More
8 years 6 months ago #109270 by Grotius
Hi Rodw,

I have a difficult issue. When trying to make a .deb linuxcnc install, i get this error. I get this unment build deps even when
i use an other kernel version.
Code:
grotius-root@grotius-cnc-machines:~/linuxcnc-dev$ dpkg-checkbuilddeps dpkg-checkbuilddeps: error: Unmet build dependencies: rtai-modules-4.14.34-rt27 | rtai-modules-4.14.34-rt27 grotius-root@grotius-cnc-machines:~/linuxcnc-dev$ uname -r 4.14.34-rt27 grotius-root@grotius-cnc-machines:~/linuxcnc-dev$
More
8 years 6 months ago #109272 by rodw
Sorry, I'm not near a Unix machine right now what does this do?
Code:
sudo apt-get install rtai-modules-4.14.34-rt27
or shorten it to rtai-modules

Seems a bit funny though if you are using the PREEMPT_RT kernel not RTAI so it could be a problem in the LCNC build environment.
More
8 years 6 months ago - 8 years 6 months ago #109313 by Grotius
Hi Rodw,

I think when the reprository is not installed you get this, today i saw it also for a mesa product. :
Code:
error: Unmet build dependencies: rtai-modules-4.14.34-rt27 | rtai-modules-4.14.34-rt27

It is nice that i know how to solve the glade problem very quick.
I will make a new install script and test it on ubuntu and mint.

Now i have the debian stretch version running with glade widget's, linuxcnc and draftsight.

To get glade-gtk2 running in this 64 bit version:
www.linuxcnc.org/testing-stretch-rtpreem...uspace-amd64-r10.iso

Install gdebi and then install this :
linuxcnc.org/dists/wheezy/base/binary-am...0-0ubuntu6_amd64.deb
linuxcnc.org/dists/wheezy/base/binary-am...0-0ubuntu6_amd64.deb
linuxcnc.org/dists/wheezy/base/binary-am...0-0ubuntu6_amd64.deb
linuxcnc.org/dists/wheezy/base/binary-am...0-0ubuntu6_amd64.deb

After install type in command line : glade-gtk2

One problem still remain's. It is making a .deb install from linuxcnc.....
The error is : error: Unmet build dependencies: rtai-modules-4.14.34-rt27 | rtai-modules-4.14.34-rt27
But with all kernel version's i get this error. So i must solve that problem.
Last edit: 8 years 6 months ago by Grotius.
Time to create page: 0.171 seconds
Powered by Kunena Forum