Tiny Core Extensions > TCE Tips & Tricks

Compiling kernel and modules on TC

(1/12) > >>

Jason W:
This post was taken from another thread dealing with kernel modules and may be helpful for building kernel module extensions.

For those new to kernel building on TC, here is a simple and convenient example way of dealing with the kernel source.  You can create a directory on one of your hard drive partitions, say /mnt/hda5, and call it src or a name of your liking.  Then download the kernel source linux-2.6.26.tar.{gz,bz2} and place it in that directory. Have the compile extension loaded and do something like this:

# mkdir /mnt/hda5/src
# cp linux-2.6.26.tar.gz /mnt/hda5/src/
# cd /mnt/hda5/src
# tar xzvf linux-2.6.26.tar.gz
# ln -s linux-2.6.26 linux    #personal preference
# mkdir /usr/src
# mount --bind /mnt/hda5/src /usr/src
# cd /usr/src/linux
# make mrproper    # a recommended step even for a newly untarred source,
# cp /path/to/config-2.6.26-tinycore /usr/src/linux/.config   # do this after any running of 'make mrproper' as 'make mrproper' will wipe your .config
# make menuconfig     # Make your kernel config choices here
# make all  # or "make modules" for just building modules
# make modules_install  # or make modules_install INSTALL_MOD_PATH=/somewhere to install them elsewhere

If you want the kernel image itself, it resides in /usr/src/linux/arch/i386/boot/bzImage.  You can copy it from there.  Make modules_install installs the modules to /lib/modules/...  .  Find the modules in /lib/modules being sure to also get their dependencies.  Be sure to run "depmod -a" before you try to use the modules on the currently running system or on later reboot unless they are part of a .tcem extension.  Hope this may help those who have not built a TC kernel but would like to.

I have not applied the boot image patch slnce it does not affect modules.

After a reboot, you can make the source directory on /mnt/hda5/src part of your system again by just doing this:

# mkdir /usr/src
# mount --bind /mnt/hda5/src /usr/src

jpeters:
I'd like to see this linked to the main tc wiki page.   

kerpob:
I might have a go at building an eee specific version of the kernel (did one some time ago for Debian and it worked out OK). However, what extensions will I need in order for make and all the other commands to work?

Jason W:
Compiletc.tce or compiletc.tcz is the main one.  I normally have perl_xml loaded too when compiling, but I don't think it is necessary for the kernel.

Juanito:
In fact you'll need perl_xml (or perl5) to compile the kernel as well.

Navigation

[0] Message Index

[#] Next page

Go to full version