Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: sbp on December 24, 2013, 02:26:32 AM

Title: Kernel 3.12.6
Post by: sbp on December 24, 2013, 02:26:32 AM
hi bmarkus.

First of all - merry Christmas to you, and thank you for your continued support and work on the piCore.


Next I will ask whether your plan for a new version includes using the new 3.12.6 kernel which just appeared. I'm asking because in this kernel Kaolo and Popcornmix were so kind as to include the new I2S/PCM option on my request.https://github.com/raspberrypi/linux/pull/461 (https://github.com/raspberrypi/linux/pull/461)

If you are close to release a new version build on this I will wait for it.
However, if you won't be using the new kernel or your release schedule lays further ahead, then I will try to build a new piCore based on the 3.12.6 kernel.

If you build on the new kernel, will you consider to activate the new options, and include the corresponding modules - should probably go in the ALSA package?

http://www.crazy-audio.com/projects/hifiberry-mini/hifiberry-mini-linux-configuration/ (http://www.crazy-audio.com/projects/hifiberry-mini/hifiberry-mini-linux-configuration/)
Code: [Select]
Enable the DMA module and the SOC codec driver
ARCH=arm CROSS_COMPILE=${CCPREFIX} make oldconfig
ARCH=arm CROSS_COMPILE=${CCPREFIX} make menuconfig
Device drivers –> Sound card support –> Advanced Linux Sound Architecture –> Alsa for SOC audio support –> Enable PCM5102 driver (or “build all ASoC CODEC drivers”)
Device drivers –> DMA engine support –> BCM2708 DMA Engine support


The reason that this new option is interesting is that it allows an audio DAC to be directly connected to the raspberry pi without the use of a USB connection. And there are now emerging several small and cheap high performance I2S-DACs:
http://www.crazy-audio.com/ (http://www.crazy-audio.com/)
http://www.tjaekel.com/T-DAC/raspi.html (http://www.tjaekel.com/T-DAC/raspi.html)
http://www.element14.com/community/community/raspberry-pi/raspberry-pi-accessories/wolfson_pi (http://www.element14.com/community/community/raspberry-pi/raspberry-pi-accessories/wolfson_pi)


Regards
Steen
Title: Re: Kernel 3.12.6
Post by: bmarkus on December 24, 2013, 03:50:48 AM
Hu Steen

thanks for the best wishes and Merry Christmas to you as well. Also thanks a lot for helping piCore become better and also make it better known through you player!

Current schedule is to release 5.1 on Week 2, 2014. Current 3.12.1 kernel is stabel. I tried few of the later kernels but they were buggy. I will make 3.12.6 kernel and rc4 however as thes RPi specific features look interesting and as a backup plan keep 3.12.1/rc3

As usual, I need you help in testing specially this DAC part.

Regards... Bela
Title: Re: Kernel 3.12.6
Post by: sbp on December 24, 2013, 04:25:25 AM
Hi

Off course I will help testing any new build you produce - if you feel it is better that we continue testing these RC4 and RC5 builds in private - just send me a link in PM.

Regards
Steen
Title: Re: Kernel 3.12.6
Post by: bmarkus on December 24, 2013, 04:42:27 AM
Just building new kernel and will see how it works in general. If OK, will make it available.
Title: Re: Kernel 3.12.6
Post by: bmarkus on December 25, 2013, 12:50:29 AM
I built a new kernel with the same config as current 3.12.1 has. Strange, BusyBox depmod segfaults with 3.12.6 while it works fine with 3.12.1 No idea why. kmod is OK, but it breaks piCore (and TC in general) at few points like usage of /usr/local/lib for kernel modules and BusyBox depmod is hardwired to TC scripts, so not a drop-in replacement. Anyhow, I will make kernel with new features enabled.
Title: Re: Kernel 3.12.6
Post by: lykkedk on December 25, 2013, 01:42:06 AM
Hey...

Marry X-mas!

Do you guys use a crosscompiler for compiling kernels ? - EG. the Linaro ?

// Jesper.
Title: Re: Kernel 3.12.6
Post by: bmarkus on December 25, 2013, 01:54:59 AM
Hey...

Marry X-mas!

Do you guys use a crosscompiler for compiling kernels ? - EG. the Linaro ?

// Jesper.

Thanks, Merry XMAS to you!

Kernel is crosscompiled with gcc-4.7.3 from x-tools, not Linaro.
Title: Re: Kernel 3.12.6
Post by: lykkedk on December 25, 2013, 02:33:58 AM
Okay thank you.

Can you quick -in very short, tell me, howto setup the needed enviroment for compiling kernels ?

I am having problems understanding how this works.

Past in time, i did a lot of kernel -compiling on my linuxbox, but that was not cross-compiling.
What i learned back then was to ::

Download the linux"vanilla" src. into /usr/src/linux and then softlink ln -s linux-xxx-vanillaxxx  /usr/src/linux
Then make menuconfig, make bzimage, make modules, and make modules install if needed (remember modules is only another word for firmware/driver)

Also i learned that when building a kernel, the only difference between building, and modules, was that the modules could be loaded only when needed, leaving a smaller kernel. BUT things like lirc_rpi, i2c eg... need to be build in for working proberly, and that is why i need to learn this for my raspberry.

// Jesper
Title: Re: Kernel 3.12.6
Post by: bmarkus on December 25, 2013, 03:21:52 AM
Read this:

http://elinux.org/RPi_Kernel_Compilation
Title: Re: Kernel 3.12.6
Post by: sbp on December 25, 2013, 03:37:25 AM
Hi Jesper

Here you can follow my progress, and there are a lot of good info from several experts also. I just recently started doing anything with linux, I think one year ago I haven't touched a linux computer:

However, this thread is about building the kernel: http://forum.tinycorelinux.net/index.php/topic,14964.0.html (http://forum.tinycorelinux.net/index.php/topic,14964.0.html)

Here is detailed info on making the modules. http://forum.tinycorelinux.net/index.php/topic,14634.30.html (http://forum.tinycorelinux.net/index.php/topic,14634.30.html)

Hope you figure it out otherwise please ask again.

Steen
Title: Re: Kernel 3.12.6
Post by: sbp on December 25, 2013, 04:18:50 AM
Hi bmarkus

I managed to make a booting 3.12.6 piCore, based on the config file from your 3.12.1 (just adding the new I2S/PCM options).

It is "fat" as I simply took all the modules and included them in the piCore.gz file. Also I copied the two files "modules.builtin" and "modules.dep"

What do you think the next step is, should I start to only include the modules that are present in the previous 3.12.1 - to slim the new version - and take out the sound and net modules for ALSA and NET packages?

You mention busybox problems -  how do I know if I have that problem as well?

Steen
Title: Re: Kernel 3.12.6
Post by: lykkedk on December 25, 2013, 07:10:10 AM
Hey Steen.

Can you help me, telling me, how you setup youre enviroment ?

Just did a new fresh Ubuntu 12.04 install here on my linuxbox.

// Jesper
Title: Re: Kernel 3.12.6
Post by: sbp on December 25, 2013, 07:31:01 AM
Hi Jesper

As far as I remember I downloaded the cross-compiler https://github.com/raspberrypi/tools/tree/master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi (https://github.com/raspberrypi/tools/tree/master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi) as described here: http://elinux.org/RPi_Kernel_Compilation (http://elinux.org/RPi_Kernel_Compilation)

Then in the .config file I added:
Code: [Select]
CONFIG_CROSS_COMPILE="/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-"
And then just continue as you use to do it

Steen
Title: Re: Kernel 3.12.6
Post by: tinypoodle on December 25, 2013, 07:59:21 AM
Past in time, i did a lot of kernel -compiling on my linuxbox, but that was not cross-compiling.
What i learned back then was to ::

Download the linux"vanilla" src. into /usr/src/linux and then softlink ln -s linux-xxx-vanillaxxx  /usr/src/linux

Above sounds very wrong.

http://linuxmafia.com/faq/Kernel/usr-src-linux-symlink.html
Title: Re: Kernel 3.12.6
Post by: lykkedk on December 25, 2013, 09:22:51 AM
 :) okay okay ... the other way around then ::

# cd /usr/src
# ln -sfn linux-2.6.9-gentoo-r2 linux

// Jesper
Title: Re: Kernel 3.12.6
Post by: bmarkus on December 25, 2013, 10:20:04 AM
Hi bmarkus

I managed to make a booting 3.12.6 piCore, based on the config file from your 3.12.1 (just adding the new I2S/PCM options).

It is "fat" as I simply took all the modules and included them in the piCore.gz file. Also I copied the two files "modules.builtin" and "modules.dep"

What do you think the next step is, should I start to only include the modules that are present in the previous 3.12.1 - to slim the new version - and take out the sound and net modules for ALSA and NET packages?

You mention busybox problems -  how do I know if I have that problem as well?

Steen

Try depmod command and check that modules.dep updated correctly and the other files are created, and no segfault.

As fast check:

Code: [Select]
lsmod
modprobe cifs
lsmod


Title: Re: Kernel 3.12.6
Post by: tinypoodle on December 25, 2013, 10:31:51 AM
No!!
Linus is very much absolute about:
1. users *not* touching /usr/src at all, besides from installing distro provided system files
2. not to have a single symbolic link in sight
Title: Re: Kernel 3.12.6
Post by: sbp on December 25, 2013, 10:36:09 AM
hi bmarkus

the first lsmod command - returned an empty list.

Then I did
sudo modprobe cifs
No errors was observed

AND
the next lsmod command - returned:
Modules  Size   Used by    Not tainted
cifs  444390      0



Also the command
sudo depmod
finished without errors.

EDIT: and it made new files in /lib/modules/3.12.6-piCore/



Steen
Title: Re: Kernel 3.12.6
Post by: bmarkus on December 25, 2013, 10:42:06 AM
Interesting. I will do more investigations, here it segfaults. Can you give me your SD card image?
Title: Re: Kernel 3.12.6
Post by: sbp on December 25, 2013, 10:42:58 AM
Sure, i Will send you a download link shortly.

Steen
Title: Re: Kernel 3.12.6
Post by: sbp on December 25, 2013, 11:52:19 AM
Hi bmarkus.

I have just been reading up on the depmod command, which I have never used before.

But it seems like it is necessary when I make a new version of piCorePlayer with a new kernel - until now I have simply used the files provided by your kernel "modules.builin" and  "modules.dep" but it seems to me now, that using depmod would be more correct?

Steen
Title: Re: Kernel 3.12.6
Post by: bmarkus on December 25, 2013, 12:17:09 PM
No, what you are doing is correct for. During startup piCore executes depmod which will update whatever is in initrd. Technically .builtin is not needed (it is missing in x86 version), it is included for user convenience to know what is built-in without looking for additional resources.

In case of cut down release however the correct way is to have .dep for the current modules instead of the full list.

Title: Re: Kernel 3.12.6
Post by: bmarkus on December 25, 2013, 12:23:23 PM
It works now. initrd I used to create 3.2.16 versions were courrupted. With a fresh clean rc3 base it is OK.
Title: Re: Kernel 3.12.6
Post by: lykkedk on December 26, 2013, 12:08:11 AM
Quote
Hi Jesper

As far as I remember I downloaded the cross-compiler https://github.com/raspberrypi/tools/tree/master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi as described here: http://elinux.org/RPi_Kernel_Compilation

Then in the .config file I added:
Code: [Select]

CONFIG_CROSS_COMPILE="/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-"


And then just continue as you use to do it

Steen

Okay then, i downloaded the tarball from https://github.com/raspberrypi/tools/archive/master.tar.gz, and extracted it into my /home/jesper/cross directory.

There is not much more explained, what is my next step?


// Jesper
Title: Re: Kernel 3.12.6
Post by: sbp on December 26, 2013, 01:54:52 AM
Hi Jesper

As far as I understand all this:
The tar-ball you just installed is your cross-compiler - therefore the line you add to the .config file points to the newly installed cross-compiler.

On my computer I need to add this line to the .config file:
CONFIG_CROSS_COMPILE="/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-"

BUT you must check that you have the same path - if not change the line so it points to your cross-compiler.

Then you follow the recipe from here http://elinux.org/RPi_Kernel_Compilation (http://elinux.org/RPi_Kernel_Compilation)

In brief make your changes to the .config file
first
make mrproper
then
make ARCH=arm oldconfigconfig
then
make ARCH=arm menuconfig

finally:
make ARCH=arm -j3

(the -j3 is dependent upon how many cores your computer have)

Steen
Title: Re: Kernel 3.12.6
Post by: lykkedk on December 26, 2013, 03:23:20 AM
Hi again  :D

Quote
On my computer I need to add this line to the .config file:
CONFIG_CROSS_COMPILE="/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-"

Do you meen the $PATH, when you say .config, or the config file located at
jesper@Lykke-laptop:~/rpi/tools/configs$ ls
bcm2708-ct-ng.config  bcm2708hardfp-ct-ng.config  ct-nt-version  gcc-linaro-arm-linux-gnueabihf-raspbian


Also, do i have to set my enviroment (.bashrc) to point to the compiler ??

// Jesper

EDIT !! :: I have been reading the thread, that you mentioned about building a newer kernel.
Did help a lot, for me, but there are still far to many things i do not understand!

I will start a new thread, where i will try to figure out, howto do this from scratch!

Title: Re: Kernel 3.12.6
Post by: Paul_123 on December 29, 2013, 08:28:58 AM
Everyone seems to be using a cross-compiler......I know the rpi is painfully slow to compile the kernel.   But I have been using my rpi to compile a few modules that have not been included.   I'm using a hardfp based raspbian image, so I would be generating hardfp based modules.

the last image I have of piCore5.1_rc3 is using    the tool chain ....armv6l-picore-linux-gnueabi/bin/armv6l-picore-linux-gnueabi-

is that a hard or soft float kernel?

I've been using piCore images that sbp makes, and he is using the tool chain

.../tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi-

Title: Re: Kernel 3.12.6
Post by: bmarkus on December 29, 2013, 08:41:00 AM
All piCore kernels ard hardfloat, we have never had a softfloat edition.
Title: Re: Kernel 3.12.6
Post by: Paul_123 on December 29, 2013, 08:53:47 AM
All piCore kernels ard hardfloat, we have never had a softfloat edition.

ok....so you just rename your tool chain ....thanks
Title: Re: Kernel 3.12.6
Post by: bmarkus on January 01, 2014, 12:34:20 AM
Testing 3.12.6 found buggy in tests. There are lost SSH connections, killed processes, failed loop mounts, etc. While there are new features like new camera or SPI DAC support, it is not usable.
Title: Re: Kernel 3.12.6
Post by: sbp on January 01, 2014, 04:45:22 AM
Hi

I have also found problems with 3.12.6, where I'm unable to read from a file which IS present.

But as I really would like the I2S-DAC support. Therefore, I have been trying to build a piCore5.1 on kernel 3.10.25 (which also have the I2S support) - this is strictly for use in the piCorePlayer.

I'm having a problem.
My version boots:
Code: [Select]
Booting Core 5.1
Running Linux Kernel 3.10.25-piCore.
Checking boot options... Done.
Starting udev daemon for hotplug support... Done

BUT then it won't go further - the cursor just stays blinking....

Does anybody know what it is trying to load next?
And how I can troubleshoot?

Steen
Title: Re: Kernel 3.12.6
Post by: Paul_123 on January 01, 2014, 09:42:42 AM
I've not had problems with file access yet.   So far it is working for me......other than having to recompile one of the wifi drivers.

Do you think the problems with 3.12.6 are possibly with the cross-compiled kernel?   I noticed you changed to the new linaro toolchain...... around the same time we stared playing with this kernel.

I know the kernel is different, as I built using the same .config, and not all natively compiled modules would not work with the linaro built kernel.



Title: Re: Kernel 3.12.6
Post by: bmarkus on January 01, 2014, 10:34:56 AM
Don't think it is toolchain related. New linaro is the native toolchain which is not used for kernel compilation. Kernel crosscompiled and cross toolchain not changed. Simply, using the same config file for 3.12.1 and 3.12.6 and the same toolchain 3.12.1 works, 3.12.6 doesn't.
Title: Re: Kernel 3.12.6
Post by: bmarkus on January 13, 2014, 12:25:20 AM
In 3.12.7 the issues of 3.12.6 with memory allocation, killed tasks and loop mounts fixed, it works fine.
Title: Re: Kernel 3.12.6
Post by: sbp on January 13, 2014, 01:39:50 AM
Hi bela

That is good to hear.
For me version 3.12.7 is also working fine, I haven't found any problems yet.

Steen
Title: Re: Kernel 3.12.6
Post by: bmarkus on January 13, 2014, 03:18:20 AM
Thanks Steen.
Title: Re: Kernel 3.12.6
Post by: sbp on January 13, 2014, 11:28:27 AM
Hi Béla

I noticed that the modules you make now are in the format like snd-bcm2835.ko.gz instead of when I compile I get snd-bcm2835.ko.

1. How do you get them in the gz format when you compile?
2. Can I for now simply compress my already made .ko files to the gz format?

Steen
Title: Re: Kernel 3.12.6
Post by: bmarkus on January 13, 2014, 11:38:39 AM
Hi Béla

I noticed that the modules you make now are in the format like snd-bcm2835.ko.gz instead of when I compile I get snd-bcm2835.ko.

1. How do you get them in the gz format when you compile?
2. Can I for now simply compress my already made .ko files to the gz format?

Steen

Hi Steen

Kernel compilation results .ko modules which are simply gzipped after the compilation out of kernel compilation process. You can script it or do it manually. You can mix .ko and gzipped .ko in the system. What is important you must run depmod command always when you are changing modules or module format to make system aware of changes and update support files.
Title: Re: Kernel 3.12.6
Post by: sbp on January 13, 2014, 11:48:50 AM
Thanks

I wont be needing Depmod for the two changes I make.

The first I change is the snd-bcm2835.ko with my own version that allows 192 kHz playback via HDMI (whereas the original only allow max 48 kHz)
And the other is the 8192cu.ko.gz with my own version where power saving has been disabled (as suggested by Paul)

So I simply change two files which are already present in the Alsa-package and the Wifi package.

Steen
Title: Re: Kernel 3.12.6
Post by: Paul_123 on January 13, 2014, 06:22:31 PM
Does zipping the modules use less RAM space on the ram drive?   is there a benefit to do this.

You can gzip them all after "installing" the modules.   Go into your temp installation directory and run

find . -name *.ko | xargs gzip

Is there really a reason to run depmod?   doesn't depmod run during boot anyway?   I struggle with running depmod outside the normal path.

Title: Re: Kernel 3.12.6
Post by: bmarkus on January 13, 2014, 11:00:19 PM
Does zipping the modules use less RAM space on the ram drive?   is there a benefit to do this.

Modules in base are loaded in RAM as all other files, gzipping them saves some RAM.

gzipping modules in .tcz reduces tcz size by cca. 10%.

depmod is executed at boot, I referred to case when one is changing modules online in a running system. Also in initrd dep file must be in sync with modules in initrd.
Title: Re: Kernel 3.12.6
Post by: Paul_123 on January 14, 2014, 06:28:45 AM
Modules in base are loaded in RAM as all other files, gzipping them saves some RAM.

gzipping modules in .tcz reduces tcz size by cca. 10%.

depmod is executed at boot, I referred to case when one is changing modules online in a running system. Also in initrd dep file must be in sync with modules in initrd.

When I built my kernel, I just used the dep that was in the installed modules directory .....so all of the lines referred to the .ko extension, I did gz the modules.   It did work fine.   But I would rather do it the right way.

After building the kernel and installing the modules to /tmp/modules, and gzipping and re-running depmod, All I get is a zero length modules.dep file

Code: [Select]
cd /tmp/modules
find . -name *.ko | xargs gzip
sudo depmod -a -b /tmp/modules 3.12.7-piCore+

This is being done on my cross-compiler system which is an debian wheezy-amd64 based system.....

Title: Re: Kernel 3.12.6
Post by: tinypoodle on January 14, 2014, 05:14:53 PM
A simple approach could be to use the gzip extension which has a "recursive" option.
Title: Re: Kernel 3.12.6
Post by: Paul_123 on January 15, 2014, 06:19:13 AM
Interesting that not all versions of depmod work with modules that are gzipped.

Seems the busybox implementation is one that does.   But only if you compile busybox with the "simplified modutils" turned off.