WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Recompiling the kernel ..  (Read 2334 times)

Offline klang

  • Newbie
  • *
  • Posts: 8
Recompiling the kernel ..
« on: February 19, 2014, 08:36:15 AM »
Hi,

I am trying to recompile the kernel as I need some specific settings turned on and a few tuned off.

As I am a total newbie in the arts of kernel customizations, I started following the wiki page on the subject:

http://wiki.tinycorelinux.net/wiki:custom_kernel

(I'm using TC 4.77 to get some very specific support for the Intermec CV60 monitor and touch screen)

On this page, we get an excellent 10 point breakdown of the process involved and my process was as follows:

Code: (bash) [Select]
wget http://tinycorelinux.net/4.x/x86/release/src/kernel/linux-3.0.21-patched.txz
wget http://tinycorelinux.net/4.x/x86/release/src/kernel/config-3.0.21-tinycore
tce-load -w -i compiletc.tcz
tce-load -w -i ncurses-dev.tcz
sudo tar xvfJ linux-3.0.21-patched.txz
cd linux.3.0.21
sudo make mrproper
sudo cp ../config-3.0.21-tinycore .config
sudo make oldconfig
sudo make menuconfig
# found and adjusted the parameters (FB_VESA, FB_I810, TOUCHSCREEN_HAMPSHIRE, SERIO_RAW)
# no FB_VESA, y to the rest
# FB_I810 added as THAT is exactly the screen we are working with! (specific for my case)
sudo make bzImage
sudo make modules
sudo make INSTALL_MOD_PATH=/mnt/sda1/kernel/modified modules_install firmware_install

(the bzImage takes about 45 minutes to make on the CV60 .. the modules take 3 hours and 45 minutes .. second time it's faster)

This is where the wiki leaves me hanging. (In my opinion, there are 3-4 points missing after number 10, namely: the "what now" points..)

Now what .. after reading the rest of the wiki-page several times, I realize that I can at least figure out how to boot up my new kernel.

ok, let's move the running kernel out of the way

Code: (bash) [Select]
mv /mnt/sdb1/vmlinuz /mnt/sdb1/vmlinuz
and move in our freshly compiled kernel so we can boot it without modifying anything else

Code: (bash) [Select]
cp arch/x86/boot/bzImage /mnt/sdb1/vmlinuz
after rebooting the system, with some slight complaints because something that was previously compiled as a module, now is compiled into the kernel (SERIO_RAW=y instead of SERIO_RAW=m), and I'm still running with the original Initrd (core.gz). Fair enof, the system boots up and "uname -a" reports the correct information, most importantly the compile date corresponding to a time just a little while ago (yesterday, in my case) ..

BUT .. what about all the modules I've just compiled?

How do I make a "modified" core.tz file, that doesn't complain about the parts of the system that are now inside my kernel?

I am probably missing something trivial .. any suggestions are welcome!

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11026
Re: Recompiling the kernel ..
« Reply #1 on: February 19, 2014, 10:00:59 AM »
You would pack up the module tree you installed in INSTALL_MOD_PATH=/mnt/sda1/kernel/modified as a second initrd, then adjust your bootloader to use it.

For an example file see modules.gz from ftp://ftp.nluug.nl/pub/metalab/distributions/tinycorelinux/5.x/x86/release/distribution_files/
For instructions on initrd packing and booting, see chapter 12 in the book. http://tinycorelinux.net/book.html
The only barriers that can stop you are the ones you create yourself.

Offline klang

  • Newbie
  • *
  • Posts: 8
Re: Recompiling the kernel ..
« Reply #2 on: February 20, 2014, 02:14:43 PM »
thanks, I had missed the book somehow .. absorbing this.