Building a new kernel


14 posts
by Doctorwho8 » Wed Jan 23, 2013 7:13 pm
Hello!
I am familiar with the steps to build a new kernel using the tools for Linux. Naturally on Intel platforms. ;) However for doing so on the Pi using Raspbian I believe I am presuming that the steps are similar ;) but that the whole business needs to launched using the root user shell after entering at the prompt $sudo bash, which then takes me to the root user's prompt # and from there go ahead and go to the source directory. :shock:

Next steps after entering the kernel source code one are therefore much the same as on my Intel box? Correct?

The only part that has me rather peeved is how the whole thing is retrieved. I'm still getting used to the ways that the Debian based distribution retrieves packages and installs them. (Including the kernel source code.)

If anyone is curious it is because I need to add more modules to cover what else I would want to attach, plus I'm more used to having the USB based mass storage module also pull in the SCSI layer's disk drive one as well.
-------------------
Gregg
Doctor Who8
Posts: 33
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY
by madman_xxx » Wed Jan 23, 2013 8:39 pm
I'm not sure what are you asking for... If you ask for a kernel source, there is a package for that, but AFAIK it is outdated, so you should download the kernel from repository. There are two versions - 3.2.27 (not to be confused with 3.2.27+), and 3.6.y (3.6.11). After you download the kernel, you can start its configuration to enable extra modules you require.
PS: SCSI storage is already included with stock kernel, doesn't have to be explicitly enabled.
Posts: 38
Joined: Tue Dec 18, 2012 5:03 pm
by rpdom » Thu Jan 24, 2013 7:10 am
You shouldn't need to be root to compile a kernel, only to install it once it has been compiled.

Having said that, I've not tried compiling a kernel for my Pi (yet), although I do it on a regular basis for some of my Debian x86 boxen. Once you get used to the steps required, the actual build part is quite easy.
User avatar
Posts: 3915
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by MaxK1 » Thu Jan 24, 2013 10:32 am
SCSI storage is enabled, but not all chipset specific stuff stuff is. Cypress chipset support for example _is_ needed at least for my adaptor - there may be others. At least in the 3.2 kernels, I had to build my own to get my external Cypress based USB<-->HDD adaptor to work. Be prepared to wait if you build "natively" - On an overclocked Rev 1 Pi it took about 6 1/2 hours...
Posts: 497
Joined: Sun Aug 26, 2012 11:34 pm
by madman_xxx » Thu Jan 24, 2013 12:53 pm
MaxK1 wrote:Be prepared to wait if you build "natively" - On an overclocked Rev 1 Pi it took about 6 1/2 hours...

That's why cross-compilation is a better choice. Comprehensive guide for that (among other things) can be found here:
http://elinux.org/RPi_Kernel_Compilation
Posts: 38
Joined: Tue Dec 18, 2012 5:03 pm
by MaxK1 » Thu Jan 24, 2013 1:04 pm
Well, it gave the pi and HDD a good workout in a semi-sealed metal box. And doing an overnight build is no big deal. If I had been in a hurry to test it, cross compiling would have been the way to go.
Posts: 497
Joined: Sun Aug 26, 2012 11:34 pm
by Doctorwho8 » Thu Jan 24, 2013 2:59 pm
madman_xxx wrote:
MaxK1 wrote:Be prepared to wait if you build "natively" - On an overclocked Rev 1 Pi it took about 6 1/2 hours...

That's why cross-compilation is a better choice. Comprehensive guide for that (among other things) can be found here:
http://elinux.org/RPi_Kernel_Compilation


Hello!
I quite agree gentlemen. However my Linux system is not a Debian based system. It is a Slackware 13.37 based system. Until the Raspberry Pi I had sworn off Debian based systems because the very first one I tried gave me problems.

Now those problems seem to have been resolved. And I've managed to get this far. Now that location contains instructions for kernel rebuilding, and on all distributions, not just via Debian?
-------------------
Gregg
Doctor Who8
Posts: 33
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY
by MaxK1 » Thu Jan 24, 2013 4:45 pm
I think those instructions cover just about all major distro's EXCEPT Slackware... You can probably figure out what is needed, though.
Posts: 497
Joined: Sun Aug 26, 2012 11:34 pm
by Doctorwho8 » Thu Jan 24, 2013 4:54 pm
MaxK1 wrote:I think those instructions cover just about all major distro's EXCEPT Slackware... You can probably figure out what is needed, though.


Hello!
No it doesn't. It makes the mistake of presupposing that the user of the R.PI also owns a Debian or Ubuntu based system hanging around.

The only people I know in my area who also own the target do not. One individual is largely a Mac owner, and the other does have some Linux experience, also not from that fraternity. In my entire LUG I believe I am the only Slackware user. The majority there are largely everything but Slackware. One individual claimed some usage, but has since departed.

Right now I am in the process of working out how to configure a VMware based system for hosting a Debian one, but I'll know more by the beginning of next week.....
-------------------
Gregg
Doctor Who8
Posts: 33
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY
by mwilliams03 » Thu Jan 24, 2013 5:18 pm
I cross-compile on Ubuntu running within VMware. it works great.

Some instructions here;
http://marks-space.com/2012/11/26/how-t ... pberry-pi/
Mark -- OzzMaker.com -- Creator of PiScreen - A 3.5" TFT for the Rasspberry Pi
Posts: 58
Joined: Mon Oct 29, 2012 2:56 pm
by RaTTuS » Thu Jan 24, 2013 5:32 pm
I use distcc on 3 RPi's and a kernel rebuild is about 3 hours
I also have a PC which will x-compile it much faster
http://www.catb.org/esr/faqs/smart-questions.html <- ask smart Questions
"That's not right, the badgers have moved the goalposts."
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX - Prosliver FTW
User avatar
Posts: 5566
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
by MaxK1 » Thu Jan 24, 2013 6:00 pm
Well, if it takes you anywhere close to 6 hours to set up, you probably would have been further ahead "going native" and just building it on the pi ;-) It's a good stability/stress test anyway. I haven't tried it on a Rev 2 to see if it's any faster.
Posts: 497
Joined: Sun Aug 26, 2012 11:34 pm
by mattyslim » Fri Jan 25, 2013 4:19 am
Hi Mr. Who,

You can get slackware 14.0(armedslack) for the pi and be in familiar territory.
The install is only slightly different than the x86 version, It isn't as bleeding
edge as arch or debian so you kinda avoid packages breaking your system.
It isn't hardfloat but I can't tell the difference for what I do. I haven't needed to
compile a kernel yet but just letting you know that slacking is an option.

Matty
Posts: 6
Joined: Fri Jan 25, 2013 2:19 am
by Doctorwho8 » Fri Jan 25, 2013 5:05 am
mattyslim wrote:Hi Mr. Who,

You can get slackware 14.0(armedslack) for the pi and be in familiar territory.
The install is only slightly different than the x86 version, It isn't as bleeding
edge as arch or debian so you kinda avoid packages breaking your system.
It isn't hardfloat but I can't tell the difference for what I do. I haven't needed to
compile a kernel yet but just letting you know that slacking is an option.

Matty


Hello!
Yes exactly. I am aware of Slackware for the Arm family. I have an image for it. And will be switching that way RSN. There's no need to. I am very familiar with Slackware, perhaps more so then the others.

As for title, its Doctor not the Mr one.
-------------------
Gregg
Doctor Who8
Posts: 33
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY