Compiled my first kernel - it was easy.

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

Compiled my first kernel - it was easy.

Postby Flemur on Tue Sep 25, 2012 4:53 pm

I'd done a lot of C/unix programming the in the past but no system/kernel stuff, so most of this was new to me.

I put this here because most descriptions make compiling a kernel sound harder than it is:

1: Download: http://www.kernel.org/pub/linux/kernel/ ... .5.tar.bz2 (or the version you want, of course).

2: uncompress/untar, and cd into "linux-3.5.0"

3: $ make mrproper
(This "cleans" the code - whatever tht means?)

4: Plug in all your gizmos - sd cards, camera, USB drives - and turn them on, mount, etc.

5: $ make localmodconfig
(This'll see what drivers and such are needed for your devices, and make the config. There's a zillion obscure options on the "menuconfig" method, so I didn't do it that way.)
Edit: Now I'm making another: after localmodconfig run "$ make gconfig", which is MUCH better than menuconfig but requires gtk-dev, etc.

6: $ make -j2 ( -j2 = use 2 processors)
(This takes a long time - half hour or more, typically)

I backed up /boot and /lib/modules, then:
7: $ sudo make modules_install (creates files in /lib/modules/version-name)

8: $ sudo make install (creates files in /boot)
(I had some errors on vbox stuff - which probably shouldn't even be there - and ignored them. This step took several minutes).

9: $ cd /boot

10: $ sudo mkinitramfs -o initrd.img-3.5.0 3.5.0 (make the initrd file).

9: Run update-grub or edit the grub file (grub.cfg or menu.lst).

Much to my amazement it booted on the first try and all gizmos seem to work :D
Mint 17/Xfce/fluxbox & another Mint 17/Xfce/fluxbox
User avatar
Flemur
Level 5
Level 5
 
Posts: 903
Joined: Mon Aug 20, 2012 9:41 pm

Linux Mint is funded by ads and donations.
 

Re: Compiled my first kernel - it was easy.

Postby Oscar799 on Wed Sep 26, 2012 3:59 am

Moved here by moderator
Image
"Don't fix it if it ain't broken,don't break it if you can't fix it" Husse
Registered Linux User #511789
User avatar
Oscar799
Level 18
Level 18
 
Posts: 8873
Joined: Tue Aug 11, 2009 9:21 am
Location: United Kingdom

Re: Compiled my first kernel - it was easy.

Postby atari800 on Wed Sep 26, 2012 9:27 pm

Good deal!!!
atari800
Level 1
Level 1
 
Posts: 10
Joined: Thu Aug 16, 2012 10:59 pm

Re: Compiled my first kernel - it was easy.

Postby Flemur on Sun Sep 30, 2012 6:24 pm

Beginners' luck, apparently!

I did another with kernel 3.6.0-rc7, trying to get the disk drivers into the kernel so it wouldn't need initrd.img (never got that to work), and it took 40 seconds to boot vs about 20 seconds (w/autologin to fluxbox GUI) with the generic kernel.

Then kernel 3.5.4, using the config for 3.2.0-31-generic, and couldn't get it to boot; the "make install" ran forever and made a /lib/modules directory that was several times as big as the others. ??

Also, the process of making the kernels (each one) used close to 10GB of disk space...yikes.

My conclusion is: the tricky part is the configuration (.config file). And everything else.
Mint 17/Xfce/fluxbox & another Mint 17/Xfce/fluxbox
User avatar
Flemur
Level 5
Level 5
 
Posts: 903
Joined: Mon Aug 20, 2012 9:41 pm


Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 11 guests