WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: (not so) custom kernel  (Read 4413 times)

Offline Ferns

  • Newbie
  • *
  • Posts: 14
(not so) custom kernel
« on: October 18, 2009, 09:50:12 AM »
I want to add Intel SCH PATA support to the kernel so I guess I must make my own custom kernel. I thought it would be good to start this process by using the simplest method: download
the patched kernel (2.6.29.1) for TC, unzip, use the TC config and try to reproduce the current bzImage.
However, if I just copy the bzImage which is produced by 'make bzImage' and replace the current bzImage to the /boot directory I would expect everything to work normally (otherwise the bzImage in TC 2.4.1 is not the result of this simple procedure). Unfortunately, the resulting bzImage is different and when I boot I get a prompt without tinyX (so it partly works).
Here are my steps:

sudo su
cd /usr/local
mkdir mykernel
cd mykernel
wget ftp://ftp.ibiblio.org/pub/linux/distributions/tinycorelinux/2.x/release/src/linux-2.6.29.1-patched.tar.bz2
wget ftp://ftp.ibiblio.org/pub/linux/distributions/tinycorelinux/2.x/release/src/config-2.6.29.1-tinycore
tar xvjf linux-2.6.29.1-patched.tar.bz2
cd linux-2.6.29.1-tinycore
cp ../config-2.6.29.1-tinycore ./.config
make bzImage

The resulting bzImage in arch/x86/boot has a different md5 compared to the bzImage in the TC2.4.1 release.
So I guess something is wrong with my GCC? I use Ubuntu 8.04 to compile which uses gcc version 4.2.4.
Do I need TC to compile TC?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11040
Re: (not so) custom kernel
« Reply #1 on: October 18, 2009, 10:02:55 AM »
Kernels aren't identical, even when the same environment is used. Files may be compiled in different order, compiler may optimize differently, etc. At the very least the compile number will differ.

Building on TC for TC would be recommended, but with the kernel it should work when built on another system also. But you must remember to replace the modules as well, because your Ubuntu system uses a different gcc version.
The only barriers that can stop you are the ones you create yourself.

Offline Ferns

  • Newbie
  • *
  • Posts: 14
Re: (not so) custom kernel
« Reply #2 on: October 18, 2009, 10:08:51 AM »
The exact procedure for replacing the modules is not really clear to me. I know how to build them, but I'm not sure exactly which modules should be packed into the tinycore.gz file. Does anybody have a script or a list with the commands?

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14787
Re: (not so) custom kernel
« Reply #3 on: October 18, 2009, 10:10:49 AM »
So I guess something is wrong with my GCC? I use Ubuntu 8.04 to compile which uses gcc version 4.2.4.
Do I need TC to compile TC?

The compiletc extension can be used to compile for tc on tc.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14787
Re: (not so) custom kernel
« Reply #4 on: October 18, 2009, 10:14:46 AM »
Quote
The exact procedure for replacing the modules is not really clear to me. I know how to build them, but I'm not sure exactly which modules should be packed into the tinycore.gz file. Does anybody have a script or a list with the commands?

All of the modules not compiled into the kernel (bzImage) are available as separate extensions named *-2.6.29.1-tinycore.tczm

Offline Ferns

  • Newbie
  • *
  • Posts: 14
Re: (not so) custom kernel
« Reply #5 on: October 18, 2009, 11:51:50 AM »
It looks like I incorrectly assumed my bzImage was broken. I have recompiled the bzImage now including the PATA_SCH and my Atom Z530 with US15 chipset now correctly identifies my harddisk. And there was much rejoicing...

Offline wille

  • Newbie
  • *
  • Posts: 2
Re: (not so) custom kernel
« Reply #6 on: November 19, 2009, 12:21:25 PM »
The exact procedure for replacing the modules is not really clear to me. I know how to build them, but I'm not sure exactly which modules should be packed into the tinycore.gz file. Does anybody have a script or a list with the commands?

What is the process for determining which kernel modules go into tinycore.gz?  Approximately 200 modules are included in tinycore.gz compared to the 1000+ modules generated by make modules.

There's got to be a way to re-generate tinycore.gz after rebuilding the kernel.  I just can't find it.

Thanks!

-wille

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: (not so) custom kernel
« Reply #7 on: November 24, 2009, 03:20:46 AM »
Could run `find` on /lib/modules/`uname -r`/kernel