UDOO Quad real time kernel

This forum is for supported devices using an ARMv7 Freescale SoC.

UDOO Quad real time kernel

Postby pedronf65 » Mon Feb 15, 2016 3:09 pm

Hi all,
I installed the UDOO Quad image from the platforms/armv7/freescale/udoo page and it works like a charm!
I want to make some testing with openPOWERLINK and it would be better to have a real time kernel.
I don't have much experience on real time linux kernel install and I'm overwhelmed with all the info I found, about AUR kernel-rt package, about the real time patch, about recompiling a custom kernel...
So my question is: is there a UDOO Quad arch linux real time SD image available?
If not, what is the best way to proceed in order to have my UDOO Quad running a real time kernel?
Or at least some pointers on how to proceed...
Many thanks in advance,
Pedro
pedronf65
 
Posts: 13
Joined: Mon Mar 02, 2015 5:15 pm

Re: UDOO Quad real time kernel

Postby osnwt » Wed Feb 17, 2016 11:45 am

My UDOO-Quad board is currently building 4.4.1-rt6 kernel with PREEMPT_RT patches applied.

Still don't know if that will run on it, but hope to see soon. If it works, I am happy to publish the package somewhere.
osnwt
 
Posts: 9
Joined: Wed Feb 17, 2016 10:00 am

Re: UDOO Quad real time kernel

Postby osnwt » Wed Feb 17, 2016 8:09 pm

$this->bbcode_second_pass_quote('', 'S')o my question is: is there a UDOO Quad arch linux real time SD image available?


Assuming that you know what to do with it, I now have a working PREEMPT_RT kernel built and loaded on UDOO Quad board:

$this->bbcode_second_pass_quote('', '[')b]Linux quad-host 4.4.1-2-rt6-ARCH #1 SMP PREEMPT RT Wed Feb 17 15:54:32 UTC 2016 armv7l GNU/Linux


It can be installed just as a pacman update of linux-armv7 package by another one that provides new kernel with modules. I didn't perform too many tests yet, but do not expect too many issues (if any).

The kernel package can be published somewhere, but if anyone could give me ideas about a correct name for it (should it have different name comparing to original linux-armv7, for instance, to provide easy replacement), and where to publish it, it could be published to open repository as a PKGBUILD source.
osnwt
 
Posts: 9
Joined: Wed Feb 17, 2016 10:00 am

Re: UDOO Quad real time kernel

Postby pedronf65 » Tue Feb 23, 2016 8:02 am

Nice! This is great.
I've done some Linux server / network maintenance in the past (15 years ago) and I was using Red Hat / Fedora at the time, one of my objectives now is to recover some lost knowledge on Linux install, maintenance and hacking. This time I've chosen Arch Linux.
Can you please describe your steps to build the RT kernel? Did you start from ArchLinuxARM-armv7-latest.tar.gz image in the UDOO platforms page? Did you apply a RT patch?
Thanks in advance,
Pedro
pedronf65
 
Posts: 13
Joined: Mon Mar 02, 2015 5:15 pm

Re: UDOO Quad real time kernel

Postby pedronf65 » Wed Feb 24, 2016 4:15 am

You have the Board index ‹ Development ‹ User-Submitted Packages where you can submit your package, I guess it goes into https://github.com/archlinuxarm/PKGBUILDs.
Can you please submit yours? Or give me some pointers on how to make it?
pedronf65
 
Posts: 13
Joined: Mon Mar 02, 2015 5:15 pm

Re: UDOO Quad real time kernel

Postby osnwt » Wed Feb 24, 2016 9:04 am

Yes, it was based on latest linux-armv7 package, and yes, it includes preempt_rt patches.

The package sources are here: https://github.com/osnwt/archlinuxarm-pkgs
You can build any of them with makepkg command.

There are 3 packages: exact copy of official one, the same with preemptive kernel, and the last with realtime patches included. I collected them all so I can build them with the same tools and compare performance.

I do not pretend to put them to official repository because (1) I am not sure that similar versions don''t already exist, and (2) because the package should be called like 'linux-rt-armv7', but I kept original names for all 3. So I can easily replace (upgrade) anyone and reboot to see the difference. Different names require some changes so they can replace each other, I guess.
osnwt
 
Posts: 9
Joined: Wed Feb 17, 2016 10:00 am

Re: UDOO Quad real time kernel

Postby pedronf65 » Wed Feb 24, 2016 10:24 am

Thank you very much, I'm going to try out your packages.
It is the first time I'm doing this, what will happen after the package compile/install? The new kernel will be in place or I need to make a copy of it to /boot?
pedronf65
 
Posts: 13
Joined: Mon Mar 02, 2015 5:15 pm

Re: UDOO Quad real time kernel

Postby osnwt » Wed Feb 24, 2016 2:01 pm

This is a package source. I think if one wants to build a realtime kernel, he may need some tweaking, so I did not publish a binary package.

To build it you need to install build tools (pacman -S base-devel git) and then run 'buildpkg' in the package directory (move it out of the git root directory, it does not work for me if placed under any folder containing .git directory due to 'git apply' used, that used by original package as well - more info here).

In the end you will have a binary package in the same directory. You have to update current kernel with 'pacman -U package_file_name', it will replace the kernel and modules, and after reboot you will have a new kernel (uname -a).

I recommend to edit /etc/makepkg.conf before and add some MAKEFLAGS='-j4' or so, and even in that case the build lasts 3 hours on UDOO Quad. So I installed distcc (FAQ also exists) and used another ArmLinux x64 system to distribute compilation jobs. In that case it takes around 1.5 hours anyway (distcc preprocesses every C file on the ARM, so it still takes a lot of resources before the compilation job is passed to another machine).

Nothing unusual, so generic makepkg FAQ should be useful.
osnwt
 
Posts: 9
Joined: Wed Feb 17, 2016 10:00 am

Re: UDOO Quad real time kernel

Postby pedronf65 » Fri Feb 26, 2016 5:49 pm

With your files and your explaining I managed to compile the preempt rt kernel and test it, it worked the first time!
It also improved the openPOWERLINK connection, this time I have no random errors.
Thank you very much osnwt!
I edited my /etc/makepkg.conf and put MAKEFLAGS='-j8' but didn't have the time to configure distcc, so I left it running for 3 or 4 hours.
I moved the linux-armv7-preempt-rt folder into another base folder because of the git issues.
I had a few file not found errors and I had to change in PKGBUILD:
$this->bbcode_second_pass_code('', 'pkgver=4.4.2
pkgrel=2
rtrel=rt7')
Then:
$this->bbcode_second_pass_code('', '$ updpkgsums
$ makepkg -s
$ sudo pacman -U linux-armv7-4.4.2-2-armv7h.pkg.tar.xz
$ sudo pacman -U linux-armv7-headers-4.4.2-2-armv7h.pkg.tar.xz')
And then reboot, now I have:
$this->bbcode_second_pass_code('', '$ uname -a
Linux udoo-quad 4.4.2-2-rt7-ARCH #1 SMP PREEMPT RT Fri Feb 26 00:58:50 UTC 2016 armv7l GNU/Linux')
Thank you very much!!!
pedronf65
 
Posts: 13
Joined: Mon Mar 02, 2015 5:15 pm

Re: UDOO Quad real time kernel

Postby osnwt » Fri Feb 26, 2016 10:03 pm

Thank you for update and feedback!
osnwt
 
Posts: 9
Joined: Wed Feb 17, 2016 10:00 am


Return to Freescale

Who is online

Users browsing this forum: No registered users and 6 guests

cron