WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Need a little help compiling a custom kernel for CorePure64  (Read 6066 times)

Offline arisb

  • Newbie
  • *
  • Posts: 3
Hi all,

The only drivers I am missing are the IPMI and Infiniband device drivers and I figured I could easily add them to the kernel.
On the wiki I found page with the steps to be taken to create a custom kernel: http://wiki.tinycorelinux.net/wiki:custom_kernel

So I downloaded the linux-3.8.13-patched.txz and the config-3.8.13-tinycore64 files from http://tinycorelinux.net/5.x/x86/release/src/kernel/.
Since the default kernel basically does everything I want it to do, I started "make menuconfig" and loaded the tinycore64 config file.
From there I added the following options:
"Device Drivers > Character Devices > IPMI top-level message handler (and all underlying options from it)
"Device Drivers > Infiniband support > all Mellanox and QLogic options.

Then I saved the settings and compiled the kernel on my system (fedora 19) and replaced the /boot/vmlinuz64 with my newly compiled kernel.
The client machines boot from network using a CentOS PXE server. CorePure64 and Core boot just fine with their default kernels, but not with my custom kernel.

The following is onscreen on the client:

Booting Core 5.3
Running Linux Kernel 3.8.13
Checking boot options... Done
Starting udev daemon for hotplug support... Done
modeprobe: can't change directory to '3.8.13': No such file  or directory
modeprobe: can't change directory to '3.8.13': No such file  or directory
[1.196091] tsc: Refined TSC clocksource calibration: 3391.742 MHz
[1.196451] Switching to clocksource tsc

And then it stops.
Apparently kernel modules are not that easily added as I initially thought :)

If anyone can give me some help/ advise on this, it would be greatly appreciated.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14823
Re: Need a little help compiling a custom kernel for CorePure64
« Reply #1 on: May 01, 2014, 05:27:20 AM »
The tinycore base contains a mixture of drivers compiled into the kernel and drivers compiled as modules - depending on whether you compiled your additional drivers into the kernel or as modules, you will need to replace vmlinuz64 or vmlinuz64 and modules64.gz (rootfs64.gz + modules64.gz = corepure64.gz)

Note also that tinycore uses kernel modules in a non-standard location, so you need to ensure the modules are in the correct place - /usr/local/lib/modules/3.8.13-tinycore64

..and, if possible, I'd recommend that you recompile the kernel using corepure64
« Last Edit: May 01, 2014, 06:05:30 AM by Juanito »

Offline arisb

  • Newbie
  • *
  • Posts: 3
Re: Need a little help compiling a custom kernel for CorePure64
« Reply #2 on: May 01, 2014, 08:58:43 AM »
I have made a bit of progress.

Instead of just loading the configuration file into #make menuconfig I had to run #make oldconfig first.
Now I have compiled the kernel and the kernelmodules on my fedora machine, and copied the newly generated files into corepure64.gz. (with cpio)

Only problem now is that corepure64.gz is about 550MB in size and it still does not boot. It gets loaded but hangs at the message "Booting the Kernel". I think the size of the image is to big to be booted trough PXE. So i am guessing that I should not copy all modules into the image but just the ones I want to add (IPMI, Qlogic and Mellanox) :)

Also My Fedora machine has gcc 4.8.2, my CentOS machine gcc 4.4.2 while CorePure64 has 4.7.2.
So I thought to take your advice and avoid any compatibility issues, I tried to compile everything on CorePure but I keep missing dependencies.
I currently have installed:
cloog.tcz
cmake.tcz
compiletc.tcz
gcc_base-dev.tcz
gcc_libs-dev.tcz
gcc_libs.tcz
gcc.tcz
glibc_add_lib.tcz
glibc_apps.tcz
glibc_base-dev.tcz
glibc_gconv.tcz
glibc_i18n_locale.tcz
gmp.tczmpc.tcz
make.tcz
mpc.tcz
mpfr.tcz
ppl.tcz
tar.tcz
linux-kernel-sources-env.tcz

But it errors that it cant find limits.h, and neither can I. This forum post:http://forum.tinycorelinux.net/index.php/topic,541.0.html suggests only compiletc.tcz is needed.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14823
Re: Need a little help compiling a custom kernel for CorePure64
« Reply #3 on: May 01, 2014, 09:33:10 AM »
to compile the kernel on core/corepure64 you need:
Code: [Select]
$ tce-load -i compiletc ncurses-dev perl5 bash

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Need a little help compiling a custom kernel for CorePure64
« Reply #4 on: May 01, 2014, 09:44:50 AM »
Better to use -iw instead of -i
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline arisb

  • Newbie
  • *
  • Posts: 3
Re: Need a little help compiling a custom kernel for CorePure64
« Reply #5 on: May 01, 2014, 10:55:56 AM »
Better to use -iw instead of -i

The -iw option solved my depency issue.
 It is compiling now, hope it works :D