WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Compiling kernel and modules on TC  (Read 30390 times)

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: Compiling kernel and modules on TC
« Reply #30 on: March 01, 2009, 09:26:15 PM »
error: kernel directory lib/modules/2.6.28.6-tinycore does not exist
Make sure your TC remaster also has the newly built modules, if applicable.

Offline oldpig

  • WikiUser
  • *
  • Posts: 5
Re: Compiling kernel and modules on TC
« Reply #31 on: January 23, 2013, 08:44:09 AM »
Thanks for your summary. Marked and practice later.
thanks again.

Offline Scampada

  • Full Member
  • ***
  • Posts: 164
Re: Compiling kernel and modules on TC
« Reply #32 on: April 07, 2015, 01:17:37 PM »
Hi,
I need to patch my kernel with condecor patch, allowing a kernel to output background image in console mode.
I have got these files:

1. condecor patch
2. TC kernel config file
3. Well well well where is it ahh, linux-3.16.6-patched.txz from there: http://tinycorelinux.net/6.x/x86/release/src/kernel/, or somewhere.
4. Also I've downloaded Module.symvers-3.16.6-tinycore. I don't know what is this for, but just in case...

So, do I need to reproduce all steps described? Do I need to rebuild initrd? The core version is the same I'm using now. Why does this kernel source weigh about 70 mbs, and the result core image weigh only about 5; I got used to the fact that a source package is usually much lighter than a binary one. How can I build only kernel , with no modules I already have and so on; or I can not?
The winning entries in UNIX users' hymns competition were 'What's the buzz, tell me what's happening' and 'Strange Thing Mystifying' songs from A.L.Webber's musical.

Tiny Core Linux. Like Gentoo, except Gentoo is easier.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1703
Re: Compiling kernel and modules on TC
« Reply #33 on: April 07, 2015, 01:33:30 PM »
Wiki is your friend. (:
http://wiki.tinycorelinux.net/wiki:custom_kernel

In my understanding, it's the opposite - Binary is usually smaller.
Download a copy and keep it handy: Core book ;)

Offline Scampada

  • Full Member
  • ***
  • Posts: 164
Re: Compiling kernel and modules on TC
« Reply #34 on: April 07, 2015, 01:47:48 PM »
Wiki is your friend. (:
http://wiki.tinycorelinux.net/wiki:custom_kernel

In my understanding, it's the opposite - Binary is usually smaller.
I found a reference to this thread on the Wiki page. It also describes the whole process including non-relevant parts of obtaining non-TC kernel, patching it with TC patches, building modules, replacing initrd... I can't be sure if I have to do it all at once or not. And it's quite old. Maybe is somewhat outdated.

I mean, not binary executable but a whole binary package with all shared libraries and service files. Hmmm... I'll check it out later. I thought so.
The winning entries in UNIX users' hymns competition were 'What's the buzz, tell me what's happening' and 'Strange Thing Mystifying' songs from A.L.Webber's musical.

Tiny Core Linux. Like Gentoo, except Gentoo is easier.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 11108
Re: Compiling kernel and modules on TC
« Reply #35 on: April 07, 2015, 10:53:52 PM »
Also I've downloaded Module.symvers-3.16.6-tinycore. I don't know what is this for, but just in case...
You only need this if you're going to prepare the kernel source in order to compile an out of tree module or just one or a few of the kernel modules.
« Last Edit: April 07, 2015, 10:55:50 PM by Juanito »

Offline Scampada

  • Full Member
  • ***
  • Posts: 164
Re: Compiling kernel and modules on TC
« Reply #36 on: April 08, 2015, 06:04:32 AM »
The very first step making mrproper was aborted because no space on my TC drive left; the kernel source folder at the moment weighed about 600 MB. Is it okay? :o
I believe it's okay, but how could it be, over 600 MB to build a 4 MB kernel...
The winning entries in UNIX users' hymns competition were 'What's the buzz, tell me what's happening' and 'Strange Thing Mystifying' songs from A.L.Webber's musical.

Tiny Core Linux. Like Gentoo, except Gentoo is easier.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 11108
Re: Compiling kernel and modules on TC
« Reply #37 on: April 08, 2015, 06:11:31 AM »
I didn't check, but a 77mb tar.xz file could expand to +/- 600mb when uncompressed.

..and yes, that is what is required to compile the tinycore vmlinuz (3.2mb) and modules.gz (4.1mb) - remember that there are more kernel modules in the various *-3.16.6-tinycore extensions.

Offline Scampada

  • Full Member
  • ***
  • Posts: 164
Re: Compiling kernel and modules on TC
« Reply #38 on: April 08, 2015, 08:52:28 AM »
I've got it I think, there are more kernel resources and modules and drivers that are not compile usually but can be used for special purposes. For example I've included Cyrillic keymap or something in config, so new kernel would be possible to type Cyrillic characters (for now it can't type them, it only can output them), right? And many more features are included in source package but not in result kernel. Got it.
The winning entries in UNIX users' hymns competition were 'What's the buzz, tell me what's happening' and 'Strange Thing Mystifying' songs from A.L.Webber's musical.

Tiny Core Linux. Like Gentoo, except Gentoo is easier.

Offline Scampada

  • Full Member
  • ***
  • Posts: 164
Re: Compiling kernel and modules on TC
« Reply #39 on: April 08, 2015, 10:04:51 AM »
Quote
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/...
I have 'made' the source; I've also found bzImage in linux/arch/x86/boot/. Now what I am to do? Replace grub entry with "linux /path/to/new/bzImage" and boot?

And where is the new initrd image? I mean... If it were a regular Linux distribution I would know that after "make install" or something, they would be in some relevant system places, mmmaybe... But in TC, I'm not sure. Sorry, I think it's my first core compilation. Especially in TC.
The winning entries in UNIX users' hymns competition were 'What's the buzz, tell me what's happening' and 'Strange Thing Mystifying' songs from A.L.Webber's musical.

Tiny Core Linux. Like Gentoo, except Gentoo is easier.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1703
Re: Compiling kernel and modules on TC
« Reply #40 on: April 08, 2015, 11:26:07 AM »
You could rename it to  vmlinuz  or something else, and edit your boot loader's config file.

--

In my understanding, building the kernel from source, will create a binary file. Features that are not used often can be separated by creating modules to be loaded only if needed. Though, separated modules need to be available for the kernel early in the boot process. That's why you need to store kernel modules in an initrd (initial ram drive?). However,  core.gz  could be updated manually, if needed. But by building the kernel, you dont create the initrd file.
Download a copy and keep it handy: Core book ;)

Offline Scampada

  • Full Member
  • ***
  • Posts: 164
Re: Compiling kernel and modules on TC
« Reply #41 on: April 08, 2015, 02:11:16 PM »
I tried to boot from the new bzImage with old initrd (editing my grub entry) but it crashed to something like "can't change directory to 3.16.6 blah blah". Then, I somehow managed to login as tc but no disk were mounted and no extensions installed. I think maybe the old initrd is not suitable. But I found no new initrd in the kernel-build folder...

I read README in source folder, but there were not any clues... So weren't they on the wiki page.
« Last Edit: April 08, 2015, 02:36:54 PM by Scampada »
The winning entries in UNIX users' hymns competition were 'What's the buzz, tell me what's happening' and 'Strange Thing Mystifying' songs from A.L.Webber's musical.

Tiny Core Linux. Like Gentoo, except Gentoo is easier.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Compiling kernel and modules on TC
« Reply #42 on: April 08, 2015, 03:29:22 PM »
Please read the wiki articles on compiling a kernel and rebuilding the initrd.
Your initrd must hold the modules for your new kernel.

Offline Scampada

  • Full Member
  • ***
  • Posts: 164
Re: Compiling kernel and modules on TC
« Reply #43 on: April 08, 2015, 03:54:52 PM »
Please read the wiki articles on compiling a kernel and rebuilding the initrd.
Your initrd must hold the modules for your new kernel.
Erm. Okay. Maybe I read it not very attentively.
The winning entries in UNIX users' hymns competition were 'What's the buzz, tell me what's happening' and 'Strange Thing Mystifying' songs from A.L.Webber's musical.

Tiny Core Linux. Like Gentoo, except Gentoo is easier.

Offline Scampada

  • Full Member
  • ***
  • Posts: 164
Re: Compiling kernel and modules on TC
« Reply #44 on: April 09, 2015, 10:49:49 AM »
That occured after I did
make INSTALL_MOD_PATH=/path modules_install firmware_install
from the wiki page.
The winning entries in UNIX users' hymns competition were 'What's the buzz, tell me what's happening' and 'Strange Thing Mystifying' songs from A.L.Webber's musical.

Tiny Core Linux. Like Gentoo, except Gentoo is easier.