lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Cross Compiling kernel from MacOS

Thu Feb 27, 2014 2:42 am

http://elinux.org/RPi_Kernel_Compilatio ... nel_source

2. Cross compiling from Linux
Complete script requires raspberrypi.config to be in the same folder that you execute from

I copy that raspberrypi.config script and put into my linux folder

I type make raspberrypi.config however it says nothing to be done.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6229
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Cross Compiling kernel from MacOS

Thu Feb 27, 2014 2:56 am

I don't see anything there that says to run "make raspberrypi.config"

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Cross Compiling kernel from MacOS

Thu Feb 27, 2014 3:01 am

ShiftPlusOne wrote:I don't see anything there that says to run "make raspberrypi.config"
then if I copied that raspberry.config what do I do with it other than make? That's the only thing I can do with that .config file right?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6229
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Cross Compiling kernel from MacOS

Thu Feb 27, 2014 3:04 am

I am not sure what to say. all of the instructions are on the page you linked. I can only paste the relevant bit.

Code: Select all

cd /Volumes/raspberrypi-kernel/src/linux-rpi-3.6.y/
export CCPREFIX=/opt/local/bin/arm-none-eabi-
make mrproper
cp /Volumes/raspberrypi-kernel/raspberrypi.config .config
#answer yes to all config options
#yes "" | make ARCH=arm CROSS_COMPILE=${CCPREFIX} oldconfig
make ARCH=arm CROSS_COMPILE=${CCPREFIX} -j$cpup1
#make ARCH=arm CROSS_COMPILE=${CCPREFIX} modules -j$cpup1

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Cross Compiling kernel from MacOS

Thu Feb 27, 2014 3:08 am

ShiftPlusOne wrote:I am not sure what to say. all of the instructions are on the page you linked. I can only paste the relevant bit.

Code: Select all

cd /Volumes/raspberrypi-kernel/src/linux-rpi-3.6.y/
export CCPREFIX=/opt/local/bin/arm-none-eabi-
make mrproper
cp /Volumes/raspberrypi-kernel/raspberrypi.config .config
#answer yes to all config options
#yes "" | make ARCH=arm CROSS_COMPILE=${CCPREFIX} oldconfig
make ARCH=arm CROSS_COMPILE=${CCPREFIX} -j$cpup1
#make ARCH=arm CROSS_COMPILE=${CCPREFIX} modules -j$cpup1

So you saying that .config can't run automatically I have to run each instruction at a time on the command line?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6229
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Cross Compiling kernel from MacOS

Thu Feb 27, 2014 3:14 am

The config contains information about which features of the kernel to enable, how it's optimized, what CPU it's compiled for and everything necessary to ensure the kernel suits the hardware and purpose it's compiled for. It is not a set of instructions.

I haven't looked too closely at the instructions, but oddly enough, I don't see where it tells you to get the .config from. What are you using as the .config?

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Cross Compiling kernel from MacOS

Thu Feb 27, 2014 5:10 am

ShiftPlusOne wrote:The config contains information about which features of the kernel to enable, how it's optimized, what CPU it's compiled for and everything necessary to ensure the kernel suits the hardware and purpose it's compiled for. It is not a set of instructions.

I haven't looked too closely at the instructions, but oddly enough, I don't see where it tells you to get the .config from. What are you using as the .config?

It said cp raspberry.config .config from that script

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6229
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Cross Compiling kernel from MacOS

Thu Feb 27, 2014 5:27 am

I got that, I am asking where you got the raspberrypi.config from.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Cross Compiling kernel from MacOS

Thu Feb 27, 2014 7:49 am

ShiftPlusOne wrote:I got that, I am asking where you got the raspberrypi.config from.
copy and paste from section that page. Just search raspberry.config on that page.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6229
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Cross Compiling kernel from MacOS

Fri Feb 28, 2014 2:54 am

Right, that's not how it works. The Mac instructions on that page are atrocious.

This is what you should be using as the .config file:
http://pastebin.com/e3Qk0WhE

When that page says raspberrypi.config it is NOT referring to the script. It simply says that the script expects raspberrypi.config to be present. What it fails to mention is where to get the file from! The instructions are okay if you are already familiar with the process of compiling a kernel, but for beginners, it's junk.

Another problem with those instructions is that they are dated. It will download the 3.6 kernel, although there was a switch to 3.10 a while back.

Return to “General discussion”