While compiling rt kernel following this http://www.frank-durr.de/?p=203
I got that error
1 Answer
By the looks of it, you're running the make bzimage
command on your rasberrypi. The link http://www.frank-durr.de/?p=203 is for instructions as to how to cross-compile the rpi kernel (which is to say, compile the kernel on another platform, such as a PC running linux). In the instructions given, I suspect, commands beginning user@host
are intended to be run on said host, whereas the only command beginning pi@raspberry$
is to be run on the raspberrypi. The only instruction to be run on the pi, is sudo modprobe configs
, then from your host, scp pi@raspberry:/proc/config.gz ./
to get the config.gz file from your raspberrypi (that config file will tell make what config settings to use when building the kernel, rather than asking you to set them all manually, starting from the defaults).
However, if you do want to compile on the Pi, the error message above, is telling you that gcc failed to compile due to a syntax error. You need to look at the file it was trying to compile and figure out what's causing the error. Normally, if you're compiling from a path often followed (by others) the code won't contain bugs, so you've probably broken something. A good way is through unresolved merges, or other upstream scripts that failed.
The error message is saying there was an unexpected "(" on line 1. Now I'd not expect a C file to begin with a "(" unless it's been minified to be all on 1 line (unlikely for the kernel source), so I suggest you inspect the files it's created and check they look right.
It's probably worth pointing out, the instructions you're following are not intended to explain how to compile the kernel on the pi. You should be able to do that, just like re-compiling a normal linux kernel. However I seem to remember reading that on the Pi 1, a full kernel compile could take days (compared to hours on a PC), so these are probably not the droids you're looking for.
-
-
I'm not sure the Pi 2 is that different. Sure it's faster, but the instructions you're following are for cross compiling, and you're compiling on a Pi, so it's not a cross compile. Certainly the "(" error, is the sort of thing a bad patch would create, but still, you needn't tell the Pi to cross compile for a Pi. You can skip half of those steps and just compile. You've no need for cross compile tools for example. It'll still take ages though :-)– sibazJan 14, 2016 at 12:56
-
That's what I did just used make (after unset options) and it compiled right, but the new kernel didn't boot, so I am stuck with the non rt one.– I.OmarJan 14, 2016 at 17:04
-
If you have a linux PC (virtual or not) I suggest you try cross compiling the kernel, using the same version and config of a downloaded Pi image first, to get familiar with the compilation/grub process, then try changing things.– sibazJan 15, 2016 at 9:20
-