How-To Compile Latest Kernel for Wolvix

oithona
Posts: 609
Joined: 2006-03-06
Developer

If anyone can think of a good reason for doing this (apart from "'cos it's there, son!") I'd be glad to hear it.

 

Note: in the following, commands that you type are in single quotes.

 

Step 1: Get the latest kernel source from kernel.org Note: At time of writing it's 2.6.23.14, and the following assumes this one.

Step 2: Copy it to /usr/src and extract it with 'tar jxvf linux-2.6.23.14.tar.bz2'

Step 3: cd to the resulting linux-2.6.23.14/

Step 4: You'll need a config file - a good place to start is the old wolvix one - so 'cp ../linux-2.6.21.5/.config .'

Step 5: 'make menuconfig' - this is where you can change the wolvix settings - compile for your specific architecture, disable all those modules you never use and which mean you have to type 'lsmod | less' rather than 'lsmod'. Click 'yes' to save the config.

Step 6: 'make' ....and wait for rather a long time while your kernel compiles (around 30-40 minutes depending on your hardware).

Step 7: 'make install' ...installs your kernel including copying it to /boot.

Step 8: check it's there (in /boot) and make an extra entry in /boot/grub/menu.lst to allow booting (keep the old one just in case):

title Wolvix-Hunter-1.1.0 Kernel 2.6.21.5
root (hd0,4)
kernel /boot/vmlinuz root=/dev/hdc5 ro vga=791
initrd /boot/initrd.splash
savedefault
boot

title Wolvix-Hunter-1.1.0 Kernel 2.6.23.14
root (hd0,4)
kernel /boot/linux-2.6.23.14 root=/dev/hdc5 ro vga=791
initrd /boot/initrd.splash
savedefault
boot

Step 9: Back to /usr/src/linux-2.6.23.14 if you left it - 'make modules'

Step 10: 'make modules_install'

You are now good to reboot - best of luck.... mwahahahah.....

(well, it worked for me......)

Note: If you are using proprietary modules such as the Nvidia one, you'll need to recompile it for the new kernel - might as well get the latest one while you're at it. I used this one for my GeForce FX5600 (yeah, I know!!)

--

“How should I know if it works? That's what beta testers are for. I only coded it." (Attributed to Linus Torvalds, somewhere in a posting)



Midnight
Midnight's picture
Posts: 46
Joined: 2007-12-16
Member
Cool'N'Quiet

oithona wrote:
If anyone can think of a good reason for doing this (apart from "'cos it's there, son!") I'd be glad to hear it.
Well, what if you want to enable things like AMD Cool'N'Quiet? Because the installation instructions on that one says you have to recompile the kernel. I don't know if this is already in Wolvix/possible to get in another way for Wolvix, but I mentioned it.

Else, this is a very good guide! (Have you added it at the Wiki?)
Thanks, Oithona!

--

Imagination is a tool of the mind.
Knowledge is a tool for the blind.



Munford Gubbins
Posts: 58
Joined: 2007-08-09
Member
nice guide

I've read that win4lin needs to have a patched kernel for it to work, so I suppose guides like this would help with that.

Bit too scary for me to try, but it's nice to know the info is here if I need it



Munford Gubbins
Posts: 58
Joined: 2007-08-09
Member
cannot compile kernel with grub?

I got as far as Step 7: 'make install' when I do the make install I got this:-

root@wolvix linux-2.6.25 # make install
sh /usr/src/linux-2.6.25/arch/x86/boot/install.sh 2.6.25 arch/x86/boot/bzImage System.map "/boot"
Fatal: Cannot open: /etc/lilo.conf
make[1]: *** [install] Error 1
make: *** [install] Error 2

I'm using grub, not lilo. I've had a look at the install.sh file mentioned above and it has no grub options in there at all. Just lilo.

Anyone know how I can change it so that it looks for grub instead of lilo?



oithona
oithona's picture
Posts: 609
Joined: 2006-03-06
Developer
Lilo error in kernel compile

Yes sorry, I don't remember getting this error but I suppose I must hav dealt with it and forgotten

Trouble is, wolvix doesn't use lilo but the package is still there and the kernel install script detects that fact and tries to install it.

The answer is, run 'removepkg lilo' and then run your kernel 'make install' again - should now run fine. (GRUB needs no intervention except the edit of menu.lst as I describe above)

--

“How should I know if it works? That's what beta testers are for. I only coded it." (Attributed to Linus Torvalds, somewhere in a posting)



Munford Gubbins
Posts: 58
Joined: 2007-08-09
Member
Thanks Oithona      

Thanks Oithona

 

Laughing

 

 



rmb
Posts: 3
Joined: 2007-12-22
Working the steps

When I run make config, I get the following output:

  HOSTCC  scripts/basic/fixdep
scripts/basic/fixdep.c:107:23: sys/types.h: No such file or directory
scripts/basic/fixdep.c:108:22: sys/stat.h: No such file or directory
scripts/basic/fixdep.c:109:22: sys/mman.h: No such file or directory
scripts/basic/fixdep.c:110:20: unistd.h: No such file or directory
scripts/basic/fixdep.c:111:19: fcntl.h: No such file or directory
scripts/basic/fixdep.c:112:20: string.h: No such file or directory
scripts/basic/fixdep.c:113:20: stdlib.h: No such file or directory
scripts/basic/fixdep.c:114:19: stdio.h: No such file or directory
In file included from /usr/lib/gcc/i486-slackware-linux/3.4.6/include/syslimits.h:7,
                 from /usr/lib/gcc/i486-slackware-linux/3.4.6/include/limits.h:11,
                 from scripts/basic/fixdep.c:115:
/usr/lib/gcc/i486-slackware-linux/3.4.6/include/limits.h:122:61: limits.h: No such file or directory
scripts/basic/fixdep.c:116:19: ctype.h: No such file or directory
scripts/basic/fixdep.c:117:23: arpa/inet.h: No such file or directory
scripts/basic/fixdep.c: In function `usage':
scripts/basic/fixdep.c:131: warning: implicit declaration of function `fprintf'
scripts/basic/fixdep.c:131: error: `stderr' undeclared (first use in this function)
scripts/basic/fixdep.c:131: error: (Each undeclared identifier is reported only once
scripts/basic/fixdep.c:131: error: for each function it appears in.)
scripts/basic/fixdep.c:132: warning: implicit declaration of function `exit'
scripts/basic/fixdep.c: In function `print_cmdline':
scripts/basic/fixdep.c:140: warning: implicit declaration of function `printf'
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:143: error: `NULL' undeclared here (not in a function)
scripts/basic/fixdep.c: In function `grow_config':
scripts/basic/fixdep.c:156: warning: implicit declaration of function `realloc'
scripts/basic/fixdep.c:156: warning: assignment makes pointer from integer without a cast
scripts/basic/fixdep.c:158: warning: implicit declaration of function `perror'
scripts/basic/fixdep.c: In function `is_defined_config':
scripts/basic/fixdep.c:174: warning: implicit declaration of function `memcmp'
scripts/basic/fixdep.c: In function `define_config':
scripts/basic/fixdep.c:187: warning: implicit declaration of function `memcpy'
scripts/basic/fixdep.c: In function `use_config':
scripts/basic/fixdep.c:206: error: `PATH_MAX' undeclared (first use in this function)
scripts/basic/fixdep.c:220: warning: implicit declaration of function `tolower'
scripts/basic/fixdep.c:206: warning: unused variable `s'
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:225: error: syntax error before "size_t"
scripts/basic/fixdep.c:226: warning: function declaration isn't a prototype
scripts/basic/fixdep.c: In function `parse_config_file':
scripts/basic/fixdep.c:227: error: `map' undeclared (first use in this function)
scripts/basic/fixdep.c:227: error: `len' undeclared (first use in this function)
scripts/basic/fixdep.c:233: warning: implicit declaration of function `ntohl'
scripts/basic/fixdep.c:244: warning: implicit declaration of function `isalnum'
scripts/basic/fixdep.c: In function `strrcmp':
scripts/basic/fixdep.c:261: warning: implicit declaration of function `strlen'
scripts/basic/fixdep.c: In function `do_config_file':
scripts/basic/fixdep.c:272: error: storage size of 'st' isn't known
scripts/basic/fixdep.c:276: warning: implicit declaration of function `open'
scripts/basic/fixdep.c:276: error: `O_RDONLY' undeclared (first use in this function)
scripts/basic/fixdep.c:278: error: `stderr' undeclared (first use in this function)
scripts/basic/fixdep.c:282: warning: implicit declaration of function `fstat'
scripts/basic/fixdep.c:284: warning: implicit declaration of function `close'
scripts/basic/fixdep.c:287: warning: implicit declaration of function `mmap'
scripts/basic/fixdep.c:287: error: `PROT_READ' undeclared (first use in this function)
scripts/basic/fixdep.c:287: error: `MAP_PRIVATE' undeclared (first use in this function)
scripts/basic/fixdep.c:287: warning: assignment makes pointer from integer without a cast
scripts/basic/fixdep.c:296: warning: implicit declaration of function `munmap'
scripts/basic/fixdep.c:272: warning: unused variable `st'
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:301: error: syntax error before "size_t"
scripts/basic/fixdep.c:302: warning: function declaration isn't a prototype
scripts/basic/fixdep.c: In function `parse_dep_file':
scripts/basic/fixdep.c:303: error: `map' undeclared (first use in this function)
scripts/basic/fixdep.c:304: error: `len' undeclared (first use in this function)
scripts/basic/fixdep.c:306: error: `PATH_MAX' undeclared (first use in this function)
scripts/basic/fixdep.c:308: warning: implicit declaration of function `strchr'
scripts/basic/fixdep.c:310: error: `stderr' undeclared (first use in this function)
scripts/basic/fixdep.c:306: warning: unused variable `s'
scripts/basic/fixdep.c: In function `print_deps':
scripts/basic/fixdep.c:343: error: storage size of 'st' isn't known
scripts/basic/fixdep.c:347: error: `O_RDONLY' undeclared (first use in this function)
scripts/basic/fixdep.c:349: error: `stderr' undeclared (first use in this function)
scripts/basic/fixdep.c:359: error: `PROT_READ' undeclared (first use in this function)
scripts/basic/fixdep.c:359: error: `MAP_PRIVATE' undeclared (first use in this function)
scripts/basic/fixdep.c:359: warning: assignment makes pointer from integer without a cast
scripts/basic/fixdep.c:343: warning: unused variable `st'
scripts/basic/fixdep.c: In function `traps':
scripts/basic/fixdep.c:378: error: `stderr' undeclared (first use in this function)
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2

I'm missing something, but I don't know what it is. Will someone give me some guidance, please?



oithona
oithona's picture
Posts: 609
Joined: 2006-03-06
Developer
Required for compiling

You are missing the kernel-headers package needed to compile any source package.

slapt-get --install kernel headers

slapt-get --install hunter-headers

should do it.

Also - check out the other packages you need for compiling in Wolvix - see the file 'packagelist' in this package.

--

“How should I know if it works? That's what beta testers are for. I only coded it." (Attributed to Linus Torvalds, somewhere in a posting)



rmb
Posts: 3
Joined: 2007-12-22
re: required for compiling

Thanks for the guidance. I'll work on this project later this week.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.