Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: Arslan S. on March 30, 2011, 01:08:11 PM

Title: building realtime kernel & remastering for tiny core linux
Post by: Arslan S. on March 30, 2011, 01:08:11 PM
i have setup a git repository at gitorious to host build scripts
https://gitorious.org/tinyrt (https://gitorious.org/tinyrt)

to download:
Code: [Select]
git clone git://gitorious.org/tinyrt/linux.gitor
click linux-->source tree and download master as tar.gz

just run ./build.sh

everything from downloading to packing is automated

pre-built rt kernel and modules images posted in contrib repository
http://distro.ibiblio.org/tinycorelinux/4.x/x86/contrib/rt-kernel/ (http://distro.ibiblio.org/tinycorelinux/4.x/x86/contrib/rt-kernel/)

you can use this script to remaster latest tiny core linux images
https://gitorious.org/tinyrt/linux/blobs/master/extra/remaster-core.sh (https://gitorious.org/tinyrt/linux/blobs/master/extra/remaster-core.sh)

build concepts:

read more about rt linux
https://rt.wiki.kernel.org/index.php/Main_Page (https://rt.wiki.kernel.org/index.php/Main_Page)
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Arslan S. on April 02, 2011, 02:00:14 AM
first product of the project is hosted in kernel contrib repository and
a script is attached to first post to remaster latest tinycore/microcore images, it is useful because grub does not support multiple initrds, there is a way chainloading a bootloader supporting multiple initrds though
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: curaga on April 02, 2011, 02:59:54 AM
Grub is ok with merely cat'ed initrds though. cat tinycore.gz rt-modules.cpio.gz > tinycorert.gz

Less space efficient than repacking, but easier to do.
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: tinypoodle on April 02, 2011, 03:08:54 AM
unfortunately grub does not support multiple initrds so use the script attached to this post to remaster latest tinycore/microcore images

Oh? Rather surprising...
I simply tried to load 2 initrd's with linld which is ~5Kb and next to zero documented, and "it just works"   ;D
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Arslan S. on April 02, 2011, 07:32:52 AM
Grub is ok with merely cat'ed initrds though. cat tinycore.gz rt-modules.cpio.gz > tinycorert.gz

Less space efficient than repacking, but easier to do.

i tried cat'ing tinycore.gz with rt-modules.gz before but when i extract the output file i can not find the modules
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: curaga on April 02, 2011, 07:39:32 AM
i tried cat'ing tinycore.gz with rt-modules.gz before but when i extract the output file i can not find the modules


The gunzip/cpio tools can't handle that, the kernel can. That's why it's not so good format when you won't have the original files anymore.
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: floppy on April 02, 2011, 01:31:49 PM
unfortunately grub does not support multiple initrds so use the script attached to this post to remaster latest tinycore/microcore images

Oh? Rather surprising...
I simply tried to load 2 initrd's with linld which is ~5Kb and next to zero documented, and "it just works"   ;D
how?
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: tinypoodle on April 02, 2011, 02:52:48 PM
initrd=tinycore.gz,initram2.gz
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Arslan S. on June 05, 2012, 12:14:33 AM
version bump to 3.0
kernel is 3.0.32-x1-rt52 please see the first post
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: ndrancs on August 09, 2012, 12:40:34 AM
want to try to compile nvidia but no kernel headers for this rt kernel in the repo.
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: curaga on August 09, 2012, 02:24:47 AM
Just use the full kernel source.
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Arslan S. on August 16, 2012, 02:02:52 AM
or use this tool to build your module
http://code.google.com/p/tc-ext-tools/source/detail?r=858 (http://code.google.com/p/tc-ext-tools/source/detail?r=858)

it is not tested for rt-kernel though
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: ndrancs on August 18, 2012, 12:15:10 AM
@Arslan S.
I've compiled all from scratch, using the script here and use tce-ext-tools revision 824, and the result is libGL.so* missing.
but I will try to use tce-ext-tools that revision 858. Thank you.  ;D
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Arslan S. on August 18, 2012, 02:29:18 AM
you should install Xorg-7.5 or Xorg-7.6 for libGL
also use the latest revision r858 is buggy
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: webb on October 20, 2012, 02:00:35 PM
hi arslan,

looks like a sweet project. unfortunately, i get many 404 not founds during the dl process. are you still maintaining this?

best,
webb
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Arslan S. on October 21, 2012, 03:05:58 AM
yes i still maintain it but not frequently i have completed two major updates so far one for tc 3.x and one for tc 4.x
tiny core linux team is kind to host custom kernels in contrib area you don't need to build it yourself unless you have a specific reason
http://distro.ibiblio.org/tinycorelinux/4.x/x86/contrib/rt-kernel/ (http://distro.ibiblio.org/tinycorelinux/4.x/x86/contrib/rt-kernel/)

anyways i will check it out when i have time thanks for reporting
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Arslan S. on October 23, 2012, 08:29:28 AM
i have updated tinyrt now builds fine
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: webb on October 24, 2012, 06:15:22 PM
> i have updated

exciting! downloading now...

-webb
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: webb on November 09, 2012, 10:44:11 AM
hi arslan,

works great, thanks! i modified sorter.sh to include the two additional modules that i need (wl-rtl8192ce_se_de and virtualbox-ose-modules) and am now rebuilding.

what do you think about letting sorter.sh use /tmp/tcloop/*$KERNEL* instead explicitly naming modules?

also, do you have any suggestions for compiling a pae or 64bit tinyrt (for >4gb ram)? so far this hasn't worked well because pae requires at least a 586 kernel, and the tc modules expect a 486 kernel. ideally i would want a core2 64bit tinyrt, but gcc.tcz appears to have 64-bit mode not compiled in. thus far, when i try to recompile gcc within 32-bit tc i haven't been able to get 64-bit mode compiled in, and i can't get gcc to compile at all from within 3.0.3-tinycore64 (3.0.21-tinycore64 won't boot on my machine). so 2nd prize would be 32bit with pae, either for core2 or 586, whichever is likely to be easier.

many thanks,
webb
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Rich on November 09, 2012, 11:34:37 AM
Hi webb
Maybe  toolchain64.tcz  will meet your needs?
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: webb on November 09, 2012, 05:21:52 PM
tried that. maybe i'm using it wrong?
Code: (bash) [Select]
thinki toolchain64-shell
thinki gcc -m64 jsmin.c
jsmin.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Rich on November 09, 2012, 07:11:23 PM
Hi webb
Quote
jsmin.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
Maybe you have the 32 bit version of gcc installed too, and it's finding that?
Assuming  /usr/local/x64/bin/  is in your path, maybe:
Code: [Select]
x86_64-unknown-linux-gnu-gcc -m64 jsmin.c
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Arslan S. on November 10, 2012, 01:03:47 AM
toolchain64 is not a native compiler you should compile like you are cross compiling

and you need a different kernel configuration for compiling 64 bit kernel also you should see that tiny core repository is x86 only
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Juanito on November 10, 2012, 01:14:51 AM
...also you should see that tiny core repository is x86 only

except for the *-tinycore64 extensions which work with core64 and in a pure 64-bit environment  ;)
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: webb on November 10, 2012, 08:53:02 PM
hi rich, juanito, & arslan,

tinyrt for core2 with pae built fine and is working well, and at last i have my full 8gb finally :) i had to make wl-rtl8192ce_se_de-3.0.32-x1-rt52.tcz manually, but other than that, arslan's build.sh worked perfectly, and after booting the system did feel more responsive. next: virtualbox-ose-modules.

as for 64-bit, i have never used a cross-compiler before and didn't realize that loading toolchain64 wasn't sufficient. any suggestions on how to make make use it? this appears to do nothing:
Code: (bash) [Select]
toolchain64-shell
ARCH=x86_64
CROSS_COMPILE=x86_64-unknown-linux-gnu-
make $ARCH $CROSS_COMPILE [x]

many thanks,
webb
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Rich on November 11, 2012, 08:27:20 PM
Hi webb
Quote
this appears to do nothing:
Not even any error messages?
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Arslan S. on November 12, 2012, 12:12:05 AM
when compiling kernel modules it is sufficient to set ARCH=x86_64 and CROSS_
COMPILE=x86_64-unknown-linux-

but for others you should also set LDFLAGS see toolchain64's info for details
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: webb on November 12, 2012, 01:43:27 AM
as arslan points out, this does work for cross-compiling the kernel :)
Code: (bash) [Select]
ARCH=x86_64 and CROSS_
COMPILE=x86_64-unknown-linux-
it only didn't work for a test cross-compile of a small non-kernel source file.
my apologies for crying wolf.

ps:
actually, i used:
Code: (bash) [Select]
COMPILE=x86_64-unknown-linux-gnu-and compiling is going ok so far. is there any reason not to use the gnu-?

pps:
these forms seem to work for non-kernel cross-compilation:
./configure --host=x86_64-unknown-linux-gnu (instead of ./configure)
/usr/local/x64/bin/x86_64-unknown-linux-gnu-gcc [x.c] (instead of gcc [x.c])

many thanks,
webb
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Juanito on November 13, 2012, 12:07:51 AM
..or you could compile natively using corepure64  8)
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: webb on November 13, 2012, 01:26:26 AM
> ..or you could compile natively using corepure64

that does sound nice, but so far neither 3.0.21-tinycore64 nor 3.0.32-tinyrt64 will boot on my thinkpad t510. i'll check out 3.0.3-tinycore64 again (which boots) and see how that compares to 3.0.32-tinyrt32-pae performance-wise. hmm. i'm wondering now why i didn't just use 3.0.3-tinycore64 in the first place...

-webb
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: webb on November 26, 2012, 04:55:12 AM
interestingly, if i build a 64-bit 3.0.21 kernel with tinycore patches and config-3.0.21-tinycore64, but set the version string to 3.0.21-w64, it does boot. if i compile with the same .config and patches but with version string 3.0.21-tinycore64, then i cannot boot, just as with official tinycore vmlinuz64. ("fixing recursive fault" error)

-webb
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Rich on November 26, 2012, 10:14:12 AM
Hi webb
Another forum member  solved his  "fixing recursive fault"  error using the  maxcpus=0  boot code.
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: webb on November 27, 2012, 05:19:03 PM
yes but i like all of my four cores!

here's a hypothesis about this whole recursive fault business:

Code: [Select]
3.0.21-tinycore64
^^^^^^^^^^^^^^^^^ <-- 17 character version string, doesn't boot

3.0.3-tinycore64
^^^^^^^^^^^^^^^^ <-- 16 character version string, boots

3.0.21-w64
^^^^^^^^^^ <-- 10 character version string, compiled with config-3.0.21-tinycore64 but with version string changed. boots.

perhaps the kernel expects a maximum of 16 bytes in the version string.

-webb
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: althalus on November 27, 2012, 06:00:51 PM
yes but i like all of my four cores!

here's a hypothesis about this whole recursive fault business:

Code: [Select]
3.0.21-tinycore64
^^^^^^^^^^^^^^^^^ <-- 17 character version string, doesn't boot

3.0.3-tinycore64
^^^^^^^^^^^^^^^^ <-- 16 character version string, boots

3.0.21-w64
^^^^^^^^^^ <-- 10 character version string, compiled with config-3.0.21-tinycore64 but with version string changed. boots.

perhaps the kernel expects a maximum of 16 bytes in the version string.

-webb
Seems coincidental. The version string doesn't change just by adding maxcpus=0, but doing so lets my system boot.

Idle thought I haven't had a chance to test and/or research yet - Setting maxcpus=0 actually does two things - uses only 1 cpu, AND disables IO APIC. Maybe there's another option that can disable APIC whilst still keeping all of your CPUs, and maybe that will be enough to get around the recursive fault erro
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Rich on November 27, 2012, 06:11:32 PM
Hi webb
Quote
yes but i like all of my four cores!
That may be, but one core that boots runs better than four that don't.
Quote
perhaps the kernel expects a maximum of 16 bytes in the version string.
Perhaps. Or maybe the longer string just pushes some data in the kernel into a position that causes a
seg fault.
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Rich on November 27, 2012, 06:20:36 PM
Hi althalus
If you go to  http://www.mjmwired.net/kernel/Documentation/kernel-parameters.txt  you can use your browser
to search for instances of  IOAPIC  for other possible options.
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: webb on November 27, 2012, 06:38:49 PM
althalus wrote:
> Seems coincidental

unlikely. i compiled my own 3.0.21-tinycore64 and 3.0.21-w64 kernels, one after the other, and using the same config-3.0.21-tinycore64 kernel configuration, varying only the version string. the kernel with the 17 character version string won't boot, 16 or fewer will. i'll also try 3.0.21-tinycor64 and 3.0.21-tinycore64b, and also with a newer kernel version (e.g., 3.0.52) to see if this is a kernel bug that has been fixed.

rich wrote:
> maybe the longer string just pushes some data in the kernel into a position that causes a seg fault

sounds plausible.

-webb
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: bricolodu13 on June 19, 2013, 12:08:17 PM
Hello,

I'm absolutly newbie but want to learn...

I've setup a basic i386 install for a squeezelite setup.
I want RT Kernel.

when I type "git clone git://gitorious.org/tinyrt/linux.git
I get the following message "-sh: git: not found" !
What am I missing ?

Thank you
Jean
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: Rich on June 19, 2013, 12:34:44 PM
Hi bricolodu13
You can find the RT kernel here:
http://tinycorelinux.net/4.x/x86/contrib/rt-kernel/
Or you can go to:
https://gitorious.org/tinyrt
and as it says in the first post:
Quote
click linux-->source tree and download master as tar.gz

just run ./build.sh
Title: Re: building realtime kernel & remastering for tiny core linux
Post by: bricolodu13 on June 21, 2013, 12:30:00 PM
Thank you Rich,

I have downloaded the  tinyrt-linux-master.tar.gz file and have copied it through ssh (WinSCP) to the TC directory.
I have also made the build.sh and two other .sh files with vi to the same directory.
I have made them usable with chmod a+x
but still, when I do ./build.sh, I got the following message :
./build-kernel.sh: .: line 15: functions.sh: not found
./build-initrd.sh: .: line 15: functions.sh: not found

Sorry to be so stupid !  :'(

Best regards,
Jean

Title: Re: building realtime kernel & remastering for tiny core linux
Post by: tinypoodle on June 21, 2013, 01:54:46 PM
Blind guess, perhaps you would use a non compatible filesystem?