Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: sbp on February 27, 2013, 10:33:37 AM

Title: How to use a newer kernel?
Post by: sbp on February 27, 2013, 10:33:37 AM
Hi


Because of our problems with the USB WiFi dongle, I have been thinking that it might be caused by the poor USB performance of the Raspberry. I have seen that major improvements have been included in the more recent kernels and that some of the problems according to the the raspberry forum has been improved.

Therefore I just tried to change the kernel in the 4.7.5 piCore img with a newer kernel from either: https://github.com/raspberrypi/firmware/blob/master/boot/kernel.img  or from http://www.raspberrypi.org/downloads

I simply deleted the old kernel and copied the newer to the card, however, it is obviously not this simple, because piCore won't boot afterwards. It results in kernel panic.

Any thoughts on this, is it worth trying to update the kernel?

Steen
Title: Re: How to use a newer kernel?
Post by: bmarkus on February 27, 2013, 11:33:05 AM
The latest stable kernel for the Pi is 3.2.27 what we are using. There are few config differences compared to Raspbian for example like loop devices, etc. but these are documented.

Development kernel is 3.6-y which is unstable at the moment. You can try to build it from GIT repo with TC config for testing. While it is unstable, I expect it can boot and work in general. It is worth to try.

More info:

http://elinux.org/RPi_Kernel_Compilation
Title: Re: How to use a newer kernel?
Post by: sbp on March 02, 2013, 03:00:53 AM
Thanks for you pointers, however I have been unable to to figure out how to use a newer kernel from raspberry (even a 3.2 version) in piCore.

But I have burned an original rasbian SD-card from here: http://downloads.raspberrypi.org/images/raspbian/2013-02-09-wheezy-raspbian/2013-02-09-wheezy-raspbian.zip

Using this there is absolutely no errors in the music, and it is connected with my 150 Mb/s router (although it only connects at 54 Mb/sec, whereas piCore connects at 150 Mb/sec)

The output from iwlist is similar in raspbian and piCore. This is from raspbian:
Code: [Select]
Cell 03 - Address: 00:24:01:79:93:33
                    ESSID:"Steens 2.4GHz"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.442 GHz (Channel 7)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1a0050f20101000050f20202000050f2020050f20401000050f202
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD8C0050F204104A00011010440001021057000120103B00010310470010034A75D5063B39279AAE4B577EB0A2E01021000E442D4C696E6B2053797374656D73102300074449522D383535102400024132104200046E6F6E651054000800060050F20400011011001A576972656C657373204E205175616462616E6420526F7574657210080002008C103C000103


And this is from piCore:
Code: [Select]
Cell 03 - Address: 00:24:01:79:93:33
                    ESSID:"Steens 2.4GHz"
                    Protocol:IEEE 802.11bgn
                    Mode:Master
                    Frequency:2.442 GHz (Channel 7)
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    Extra:wpa_ie=dd1a0050f20101000050f20202000050f2020050f20401000050f202
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac020000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : TKIP CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD180050F204104A00011010440001021057000120103C000102
                    Quality=42/100  Signal level=43/100


From iwconfig in raspberry is also similar to output from piCore, except that it only connect via 54 Mb/s whereas piCore connects at 150 Mb/sec (as far as I remember - will check up on this later.

This is from raspbian linux:
Code: [Select]
wlan0     IEEE 802.11bg  ESSID:"Steens 2.4GHz"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.442 GHz  Access Point: 00:24:01:79:93:33
          Bit Rate:54 Mb/s   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=83/100  Signal level=45/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0


ifconfig still shows a lot of dropped packages on the rasbian linux:
Code: [Select]
Link encap:Ethernet  HWaddr 00:0f:12:82:13:1f
          inet addr:192.168.1.25  Bcast:255.255.255.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:35478 errors:0 dropped:35515 overruns:0 frame:0
          TX packets:10454 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:45012410 (42.9 MiB)  TX bytes:1213114 (1.1 MiB)


But somehow the original rasbian linux is able to deliver much better results through the WiFi than piCore. Do you think it is because of a newer kernel (which probably has improved USB handling) or is there a problem somewhere with the current status of the WiFi packages in piCore?

Should I move this to the wifi discussion - or let it be here in the kernel discussion?

Hope to get some input
Steen
Title: Re: How to use a newer kernel?
Post by: bmarkus on March 02, 2013, 03:09:40 AM
What do you mean newer kernel?
Title: Re: How to use a newer kernel?
Post by: tinypoodle on March 02, 2013, 03:31:11 AM
You might want to consider looking into compat-drivers.
https://backports.wiki.kernel.org/index.php/Main_Page
Title: Re: How to use a newer kernel?
Post by: sbp on March 02, 2013, 04:03:37 AM
What do you mean newer kernel?

I mean that the kernel from the rasbian system is dated from the 9 feb 2013 with a size of 2.802.684 whereas the kernel from the latest piCore is dated 16 sept 2012 with a size of 5.558.628

So therefore I imagined that the kernel was newer and different in the rasbian compared to the piCore?
Title: Re: How to use a newer kernel?
Post by: bmarkus on March 03, 2013, 01:00:05 AM
Do not know what was changed in the latest Raspbian kernel if any.
Title: Re: How to use a newer kernel?
Post by: sbp on March 03, 2013, 03:59:53 AM
Hi bmarkus

Here you can see what has been changed and when; https://github.com/raspberrypi/firmware/commits/master

There seems to be many changes between sept 2012 to feb 2013. And as far as I can understand especially the changes made by P33M seems to have improved the USB handling and the network performance  https://github.com/raspberrypi/linux/issues/189

So maybe these improvements are important for the problems Gerrelt and I have with the WiFi throughput on a piCore system.

As I demonstrated previously in this thread using the same WiFi dongle on the raspberry, but running the most recent official Rasbian linux, the problems with the WiFi is gone. 
Title: Re: How to use a newer kernel?
Post by: bmarkus on March 03, 2013, 05:26:10 AM
Thanks, would be interesting to have either this or the dev 3.6 kernel with TC specific setting for testing. Unfortunately it is out of my capacity at the moment. Would appreciate if someone would make it :)
Title: Re: How to use a newer kernel?
Post by: sbp on March 03, 2013, 05:50:00 AM
Thanks, would be interesting to have either this or the dev 3.6 kernel with TC specific setting for testing.
Yes, I would like to try such a new one and see if it solves the problem with the WiFi in piCore.


Unfortunately it is out of my capacity at the moment. Would appreciate if someone would make it :)

If it is out of your capacity, then I know why all my attempts the last few days have been unsuccessful :-)

 
Title: Re: How to use a newer kernel?
Post by: sbp on March 12, 2013, 05:26:54 AM
There have been even further development in the two topics that cause many problems on the raspberry: the USB and a popping noise on the audio

Therefore I have been reading both on the wiki here as well as pages on the raspberry pages.

On the page in the microcore Wiki: http://wiki.tinycorelinux.net/wiki:custom_kernel
 it is mentioned that " In general I think that TC will work with a kernel without patches, i.e. a “pure” standard Linux kernel."
Therefore, I have tried once again to simply use a newer kernel in the microcore - but it is not starting correctly.

It results in "kernel panic" and maybe it has something to do with a wrong definition of the size of the initramfs , as discussed here: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=10532 .?
Title: Re: How to use a newer kernel?
Post by: sbp on March 24, 2013, 12:09:03 PM
Hi bmarkus and other microcore gurus.

Now the Easter is coming I will have some time which I can spend on the microcore and raspberry.
I really would like to learn/try to see if I can manage to update the kernel in microcore. But as you probably already know I just recently started to use linux and microcore. But I am ready to give it a try.

On the wiki I found this:
 http://wiki.tinycorelinux.net/wiki:custom_kernel

Code: [Select]
The process to create a custom kernel could in short be described as:

1. Get the sources for the version of the standard Linux kernel that you are going to base your kernel on
2. Get the patches you intend to apply - both TC kernel patches and possibly others (in my case the RT-patches)
3. Unpack the linux sources and cd into the top level directory of the source package
4. Apply the patches using (in most cases) “patch -p1 < patchfile” for each patch file
5. Move the kernel config file from the standard TC kernel into the same directory and rename it to ”.config”
6. Do “make oldconfig” and answer all questions, in case you have no clue on the answer just provide the default ones (i.e. just hit Return)
7. Do “make menuconfig” and make any changes you need to the configuration
8. Do “make bzImage” to build the kernel itself
9. Do “make modules” to build the loadable modules
10. Do “make INSTALL_MOD_PATH=/path modules_install firmware_install” where /path is a path to a directory where you expect to find the modules.

At this point you will find the kernel file as “arch/x86/boot/bzImage” (relative to the directory from where you issues all the make commands). Further you will find all loadable modules and firmware files under ”/path/lib/modules/kernel_version” and ”/path/lib/firmware”

The bzImage file need to be moved to a location where your boot loader can access it and the boot loader needs also to be configured to boot using the new kernel.

Point no 1:
So I should get the sources from the raspberry github.
According to the raspberry site this is done like this:
Code: [Select]
git fetch git://github.com/raspberrypi/linux.git rpi-3.6.y:refs/remotes/origin/rpi-3.6.y
git checkout rpi-3.6.y

Will that work on Picore-X beta?

Point no 2:    -I will skip as no patches is needed.

Point no 3:    - Seems easy

Point no 4:    I will skip as no patches is needed

Point 5-10:   Should be followed.


So are this the steps I need to perform?


I plan to use the picore-X beta image made by bmarkus on my raspberry pi board - could you please tell me what other packages I need to install before this is possible?

If others are also trying to compile a new kernel - maybe we could collaborate on this?

Steen
Title: Re: How to use a newer kernel?
Post by: Rich on March 24, 2013, 12:22:38 PM
Hi sbp
Code: [Select]
8. Do “make bzImage” to build the kernel itselfI don't know if that command will still work as written. The Linux kernel is now called  vmlinuz  not  bzImage.
Juanito recently posted a brief step by step here:
http://forum.tinycorelinux.net/index.php/topic,14900.msg85097.html#msg85097
Title: Re: How to use a newer kernel?
Post by: bmarkus on March 24, 2013, 02:49:58 PM
Before doing anything with 3.6.y development kernel I would compile the official piCore kernel and would move on to 3.6 when I can build a working 3.2.27.

Next question to make kernel native or cross compile. If native be ready for long development cycle as kernel compilation will take many hours. If you change anything maybe you can test next day only :) Cross compilation is faster, but it takes time to setup environment and to learn how to use it.

Anyhow, it is a good experience to build a kernel for Pi.

Title: Re: How to use a newer kernel?
Post by: sbp on March 24, 2013, 10:26:12 PM
Before doing anything with 3.6.y development kernel I would compile the official piCore kernel and would move on to 3.6 when I can build a working 3.2.27.

Next question to make kernel native or cross compile. If native be ready for long development cycle as kernel compilation will take many hours. If you change anything maybe you can test next day only :) Cross compilation is faster, but it takes time to setup environment and to learn how to use it.

Anyhow, it is a good experience to build a kernel for Pi.

Good advice.
I will then start with the official 3.2.27 and will be doing it on the raspberry.
I plan on using your picore-X image.
Which extra packages do I need to instal in order to build the kernel.?

Steen
Title: Re: How to use a newer kernel?
Post by: bmarkus on March 25, 2013, 12:24:26 AM
Which extra packages do I need to instal in order to build the kernel.?

Just compile-essentials to hvae the GCC toolchain and ncurses for configuration tool. I always have mc (Midnight Commander) as file manager, archive tool, ftp, ... but it is not necessary for kernel build.
Title: Re: How to use a newer kernel?
Post by: roberts on March 25, 2013, 08:53:51 PM
The first kernel and modules I made for piCore were on the pi, (256MB) and it took 12 hours!
Needless to say, I did this only once.

All the other kernels, both for pi and qemu I built using Code Sourcery with x86 Tiny Core.
Code Sourcery unpacks into a directory, use a persistent drive for this.
Title: Re: How to use a newer kernel?
Post by: bmarkus on March 26, 2013, 12:10:02 AM
Native build on Pi with 512M RAM is abt. 10 hours.

For cross compilation on x86 LINUX toolchains available preconfigured for the Pi, see

http://elinux.org/RPi_Kernel_Compilation

While the current dev kernel for Pi is 3.6.y there are reports on running 3.8 on Pi. It supports Pi's SOC which appeared in 3.7.1

http://www.element14.com/community/blogs/mirandasoft/2013/02/19/raspberry-pi-now-running-linux-kernel-380-freshly-compiled-in-the-philippines
Title: Re: How to use a newer kernel?
Post by: sbp on March 26, 2013, 03:55:14 AM
Native build on Pi with 512M RAM is abt. 10 hours.

For cross compilation on x86 LINUX toolchains available preconfigured for the Pi, see

http://elinux.org/RPi_Kernel_Compilation

While the current dev kernel for Pi is 3.6.y there are reports on running 3.8 on Pi. It supports Pi's SOC which appeared in 3.7.1

http://www.element14.com/community/blogs/mirandasoft/2013/02/19/raspberry-pi-now-running-linux-kernel-380-freshly-compiled-in-the-philippines

Hi bmarkus

Don't you think that I should go for 3.2.27 first - and if I can manage I will go for the 3.6y, because most of the USB problems seems to get fixed it that version.
Probably 3.8 is a native linux, where all the specific patches for raspberry is not applied?
Title: Re: How to use a newer kernel?
Post by: bmarkus on March 26, 2013, 04:05:17 AM
You can start with 3.2.27 to verify your environment as I wrote previously then go on with 3.6.y

While 3.8 is a vanilla (generic) kernel there are already support for the Broadcom SoC used in Pi which was not available in 3.6 Do not know wether you need or not additional Pi specific patches. It worth to try.
Title: Re: How to use a newer kernel?
Post by: sbp on March 28, 2013, 05:36:52 AM
Hi

Now I have started on the project of cross-compiling a new raspberry kernel. I'm using a Debian computer for the process - installed all the tools and following the advice from here: http://elinux.org/RPi_Kernel_Compilation

I have extracted the config from a running piCore kernel, and are trying to use that for the set-up.

I used:
Code: [Select]
root@debian:/mrproper1/linux-rpi-3.2.27# make ARCH=arm CROSS_COMPILE=/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi oldconfig
There were only a few questions that I neeed to answer (some NEW) settings so that is fine - see here:
Code: [Select]
root@debian:/mrproper1/linux-rpi-3.2.27# make ARCH=arm CROSS_COMPILE=/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi oldconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --oldconfig Kconfig
*
* Restart config...
*
*
* Broadcom BCM2708 Implementations
*
Broadcom BCM2708 Development Platform (MACH_BCM2708) [Y/?] y
  BCM2708 gpio support (BCM2708_GPIO) [Y/n/?] y
  Videocore Memory (BCM2708_VCMEM) [Y/n/?] y
  Videocore L2 cache disable (BCM2708_NOL2CACHE) [N/y/?] n
  BCM2708 DMA helper (BCM2708_DMAER) [N/m/y/?] (NEW) y
*
* I2C Hardware Bus support
*
*
* I2C system bus drivers (mostly embedded / system-on-chip)
*
BCM2708 BSC (I2C_BCM2708) [M/n/y/?] m
  BCM2708 I2C baudrate (I2C_BCM2708_BAUDRATE) [100000] (NEW)
Synopsys DesignWare Platfrom (I2C_DESIGNWARE_PLATFORM) [N/m/y/?] n
GPIO-based bitbanging I2C (I2C_GPIO) [N/m/y/?] n
OpenCores I2C Controller (I2C_OCORES) [N/m/y/?] n
PCA9564/PCA9665 as platform device (I2C_PCA_PLATFORM) [N/m/y/?] n
Simtec Generic I2C interface (I2C_SIMTEC) [N/m/y/?] n
Xilinx I2C Controller (I2C_XILINX) [N/m/y/?] n
*
* External I2C/SMBus adapter drivers
*
Diolan U2C-12 USB adapter (I2C_DIOLAN_U2C) [N/m/y/?] n
Parallel port adapter (light) (I2C_PARPORT_LIGHT) [N/m/y/?] n
TAOS evaluation module (I2C_TAOS_EVM) [N/m/y/?] n
Tiny-USB adapter (I2C_TINY_USB) [N/m/y/?] n
*
* Other I2C/SMBus bus drivers
*
I2C/SMBus Test Stub (I2C_STUB) [N/m/?] n
#
# configuration written to .config
#
.


Next I wanted to actually make the new kernel.
Therefore I used this command:

Code: [Select]
make ARCH=arm CROSS_COMPILE=/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi
But the output I get is:

Code: [Select]
export LANG=C
root@debian:/mrproper1/linux-rpi-3.2.27# make ARCH=arm CROSS_COMPILE=/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi
make: /cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabigcc: Command not found
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
/bin/sh: /cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabigcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
 

I can't figure out what is wrong, but something is not found. Any Idea?

Steen
Title: Re: How to use a newer kernel?
Post by: curaga on March 28, 2013, 05:52:00 AM
When posting logs on English forums, please use "export LANG=C" before running the command.
Title: Re: How to use a newer kernel?
Post by: sbp on March 28, 2013, 06:09:58 AM
Thanks  - the original post is updated

I didn't know that export command - and I regret that I installed Debian in Danish - should have used English instead.

 
Title: Re: How to use a newer kernel?
Post by: bmarkus on March 28, 2013, 06:28:56 AM
Did you updated the link to cross tool directory in the kernel .config? If .config is correct, no need for make parameters, just run make.

Title: Re: How to use a newer kernel?
Post by: sbp on March 28, 2013, 06:42:53 AM
Did you updated the link to cross tool directory in the kernel .config? If .config is correct, no need for make parameters, just run make.

No I did not update anything - I wasn't asked this question during the making of the "old-config thing" and I didn't even look in the config file to see if anything needed to be changed.

I will have a look in the config file.
Steen
Title: Re: How to use a newer kernel?
Post by: sbp on March 28, 2013, 07:51:53 AM
Hi bmarkus

Thanks for your guidance. I changed the path in the .config file.

But there still seems to be a problem. Frankly I don't know if it is the correct directory I put in the path.
In the .config file I used:
CONFIG_CROSS_COMPILE="/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi-"

I used the "Provided compiler" from the raspberry site: http://elinux.org/RPi_Kernel_Compilation
As stated you can download a tarball from the website using this link. https://github.com/raspberrypi/tools/archive/master.tar.gz

It seems like it can't find gcc in the directory here

But please see this screenshot - is that correct?
(http://)

This is the error from trying to build the kernel:

Code: [Select]
root@debian:/mrproper1/linux-rpi-3.2.27# make ARCH=arm CROSS_COMPILE=/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi-
make: /cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi-[b]gcc[/b]: Command not found
scripts/kconfig/conf --silentoldconfig Kconfig
make: /cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi-[b]gcc[/b]: Command not found
  WRAP    arch/arm/include/generated/asm/auxvec.h
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/errno.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/percpu.h
  WRAP    arch/arm/include/generated/asm/poll.h
  WRAP    arch/arm/include/generated/asm/resource.h
  WRAP    arch/arm/include/generated/asm/sections.h
  WRAP    arch/arm/include/generated/asm/siginfo.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  Generating include/generated/mach-types.h
  CC      kernel/bounds.s
/bin/sh: /cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi-[b]gcc[/b]: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
root@debian:/mrproper1/linux-rpi-3.2.27#


Sorry re-read what you wrote tried with make only:
Still the same error:
Code: [Select]
root@debian:/mrproper1/linux-rpi-3.2.27# make ARCH=arm
scripts/kconfig/conf --silentoldconfig Kconfig
make: /cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi-gcc: Command not found
  WRAP    arch/arm/include/generated/asm/auxvec.h
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/errno.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/percpu.h
  WRAP    arch/arm/include/generated/asm/poll.h
  WRAP    arch/arm/include/generated/asm/resource.h
  WRAP    arch/arm/include/generated/asm/sections.h
  WRAP    arch/arm/include/generated/asm/siginfo.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  Generating include/generated/mach-types.h
  CC      kernel/bounds.s
/bin/sh: /cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
root@debian:/mrproper1/linux-rpi-3.2.27#


Steen
Title: Re: How to use a newer kernel?
Post by: Rich on March 28, 2013, 08:11:43 AM
Hi sbp
If you go to the   /cross/tools-master/arm-bcm2708/   directory, does it contain a file called
arm-bcm2708hardfp-linux-gnueabi-gcc
Title: Re: How to use a newer kernel?
Post by: bmarkus on March 28, 2013, 08:26:35 AM
Check path. Executables are in a bin subdir. Simple the tool name (gcc, cpp, ...) is appended to the end of the string you specify. I
Title: Re: How to use a newer kernel?
Post by: sbp on March 28, 2013, 08:49:35 AM
Thank you to you both.

It is now compiling.
The path needed to be:
CONFIG_CROSS_COMPILE="/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-"

This is the first time ever that I have tried compiling anything at all. So I hope the kernel is working when it is finished. I will let you know.

By the way:
1., were do you think that I find the newly compiled kernel?
2. Sometimes I see mentioned that modules also needs to be compiled - but for the picore I only need the kernel or...?

Once again - thank you for your help.

Steen
Title: Re: How to use a newer kernel?
Post by: bmarkus on March 28, 2013, 08:53:12 AM
Read howto at elinux

http://elinux.org/RPi_Kernel_Compilation
Title: Re: How to use a newer kernel?
Post by: sbp on March 30, 2013, 02:20:29 AM
Hi I managed to build a newer version 3.2.27 kernel.

If I change the old kernel in picore.img with my own kernel, picore is starting fine and everything is working fine - so thank you for your help.

I didn't build any modules (I don't know what they are and where to put them anyway).

I tried to use the files like the newer start.elf etc, but then my kernel resulted in kernel panic.


Steen
Title: Re: How to use a newer kernel?
Post by: sbp on March 30, 2013, 10:08:38 AM
Hi as you might have seen in bmarkus thread about 3.6.11 I still have problems with the sound breaking up if I'm using it via wifi. On the other hand I have no problems if using the original rasbian image.

So I'm thinking it might be:
1. Either some setting that are different when building the kernel?
Or
2. The wifi packages?

Therefore, I could try to build a new kernel for picocore with the same settings as in the original rasbian kernel - and only change those that are essential for the microcore.

Do you know which settings are really essential for a working picore system?

Title: Re: How to use a newer kernel?
Post by: bmarkus on March 30, 2013, 03:33:14 PM
Hi as you might have seen in bmarkus thread about 3.6.11 I still have problems with the sound breaking up if I'm using it via wifi. On the other hand I have no problems if using the original rasbian image.

So I'm thinking it might be:
1. Either some setting that are different when building the kernel?
Or
2. The wifi packages?

Therefore, I could try to build a new kernel for picocore with the same settings as in the original rasbian kernel - and only change those that are essential for the microcore.

Do you know which settings are really essential for a working picore system?

initramfs and availability of loop block device.
Title: Re: How to use a newer kernel?
Post by: sbp on April 06, 2013, 06:11:11 AM
Hi bmarcus

I'm still trying to learn how to make kernels for the PiCore. I think that I'm much closer than I ever have been, but still not quite there.

I have been using your recent 3.6.11 picore.img.  From this I extracted the file /proc/config.gz and used your .config file as follows:

1. I downloaded the linux-rpi-3.6.y.gz from the github - extracted it on my crosscompile computer.
2. Untarred the linux-rpi-3.6.y.gz
3. used the command make mrproper
4. Copied your .config file to the linux directory (only changed the path to my crosscompiler directory)
5. Started the crosscompilation by: make ARCH=arm
6. Copied the file arch/arm/boot/Image to the SD-card which was burned with your picore3.6.11.
7. Renamed the original kernel3.6.11a.img to old_kernel3.6.11a.img
8. Renamed my newly made Image to kernel3.6.11a.img

9. Put this SD-card into the raspberry - and it boots fine and picore is starting as well - but it is not quite there, because if I try to use the tce package manager it will find the correct package like ALSA and start downloading to a certain point:

Code: [Select]
alsa-utils.tcz.dep OK
alsa-plugins.tzc.dep OK
Downloading: libasound.tzc
Connecting to repro.tinycorelinux.net (89.22.99.37:80)
libasound.tcz      100% ************************************************************** 344k 0:00:00 ETA
Libasoundtcz: OK

Then I need to press "Ctr + c"  to continue.

Other packages have the same problem ??
So it seems like I'm missing a final part - can you see what I do wrong?


INFO: Using wget I can download other files from the internet.
Steen
Title: Re: How to use a newer kernel?
Post by: tinypoodle on April 06, 2013, 07:05:02 AM
To use alsa you need the respective modules of specific kernel you are running.
A 'make oldconfig' could not harm.
Title: Re: How to use a newer kernel?
Post by: sbp on April 06, 2013, 07:15:36 AM
Thanks for the advise.

My thinking was that if I used the exact same .config file as bmarkus had used, then I would build an identical kernel. And this would be my first step, to be able to build a kernel that works.

I think you are correct about the modules, because I didn't do this part as otherwise described here http://elinux.org/RPi_Kernel_Compilation :

Code: [Select]
Now you need to transfer the modules. Set an environment variable that points to a temporary module path.
export MODULES_TEMP=~/modules
In the build directory, run the following command:

make ARCH=arm CROSS_COMPILE=${CCPREFIX} INSTALL_MOD_PATH=${MODULES_TEMP} modules_install


But I have just tried this
export MODULES_TEMP=~/modules
make ARCH=arm INSTALL_MOD_PATH=${MODULES_TEMP} modules_install[/code]

And it runs -
But I don't know what to do next, I think it produced a file called "modules.order" and another ".missing-syscalls.d"
Title: Re: How to use a newer kernel?
Post by: tinypoodle on April 06, 2013, 07:45:02 AM
My thinking was that if I used the exact same .config file as bmarkus had used, then I would build an identical kernel. And this would be my first step, to be able to build a kernel that works.
That's what I understood and why I said "could not harm" rather than "is required".  ;)
Depends though on the source being identical.
Title: Re: How to use a newer kernel?
Post by: bmarkus on April 06, 2013, 07:46:07 AM
What is the output of

Code: [Select]
uname -a
when you are using your own kernel?
Title: Re: How to use a newer kernel?
Post by: sbp on April 06, 2013, 08:14:12 AM
Thanks

There might be a problem here.
uname -a results in:

Linux box 3.6.113.6.11-piCore #1 PREEMPT Sat Apr 6 14.27:34 CEAT 2013 armv61 GNU/Linux

So it seems like I will need to build another kernel with the correct name?
 
Title: Re: How to use a newer kernel?
Post by: bmarkus on April 06, 2013, 08:46:15 AM
Your kernel is 3.6.113.6.11-piCore which means that you need a new initrd with your own moduls and you can't use kernel modules from the repo.

Rebuild your kernel with -piCore local version in the config to get it as 3.6.11-piCore.
Title: Re: How to use a newer kernel?
Post by: sbp on April 07, 2013, 04:46:44 AM
Thanks.

I managed to use your .config file and make a new functional kernel. Which seems to have the same problems as your original kernel - that is problems using a wifi-USB and a USB-DAC at the same time. The sound is breaking up.

If I use an original raspian image there is no problem using the same USB-wifi and USB-DAC.

So I tried to use a .config file from the rasbian build and change a few things in order to boot piCore. My hope was that maybe this would fix the USB wifi and USB-DAC problems in piCore.

So I made these changes to the original rasbian .config file:

Code: [Select]
Changed to: CONFIG_CROSS_COMPILE="/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-"

Changed to: CONFIG_LOCALVERSION="-piCore"

Changed to: CONFIG_BLK_DEV_INITRD=y
Added: CONFIG_INITRAMFS_SOURCE=""
Added: CONFIG_RD_GZIP=y

Changed to: CONFIG_CMDLINE="dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait"

Changed to: CONFIG_CPU_FREQ_STAT=y

Changed to: CONFIG_USB_NET_CDC_NCM=y

Changed to: CONFIG_LOGO_LINUX_MONO=y
Changed to: CONFIG_LOGO_LINUX_VGA16=y

Changed to: CONFIG_SQUASHFS_EMBEDDED=y

Changed to: CONFIG_ZLIB_INFLATE=y

So besides these changes the .config file is identical to the Rasbian .config file.


The kernel made from this is almost fine; piCore boots fine, but once again the problem is with the tce package manager.
And also if I have the original TCE directory on the SD-card, where my previously downloaded ALSA, WiFi, Flac, Libmad are included, then piCore will hang during boot.
It is hanging only spinning and "loading extensions" forever.

So something is not quite right.

The uname - a command:
Linux box 3.6.11-piCore #1 PREEMPT Sun Apr 7 13:07:06 CEST 2013 armv61 GNU/Linux

Regards
Steen
Title: Re: How to use a newer kernel?
Post by: bmarkus on April 07, 2013, 05:22:21 AM
Quote

And also if I have the original TCE directory on the SD-card, where my previously downloaded ALSA, WiFi, Flac, Libmad are included, then piCore will hang during boot.
It is hanging only spinning and "loading extensions" forever.


At which extension?

Quote
but once again the problem is with the tce package manager.

Please provide details.

Quote
So I made these changes to the original rasbian .config file

Which Raspbian? release/kernel?
Title: Re: How to use a newer kernel?
Post by: sbp on April 07, 2013, 06:50:24 AM
Quote
At which extension?

I had installed Flac, ALSA, libmad, libvorbis, dropbear and wifi packages via TCE - using your 3.6.11-piCore image. I copied this tce directory to my new SD-card with my own modified rasbian kernel.

As stated is booted fine, but was hanging when loading extensions. By removing each extension I found that it could boot with these extensions in the tce/optional directory:
Alsa.tcz
Alsa-modules-3.6.11-piCore.tcz
Alsa-plugins.tcz
Alsa-utils.tcz

Flac.tcz

libiconv.tcz
libiw.tcz
libvorbis.tcz
openssl-1.0.0.tcz

wifi.tcz
wireless_tools.tcz
wireless-3.6.11-piCore.tcz
wpa_supplicant.tcz

However it fails to load if any of these packages are present:
Droppbear
libasound
libogg
libnl
libmad
 

But eventhough it seems like the wifi package is OK and piCore boots with the wifi package in the tce/optional directory it is not working. 

Quote
Which Raspbian? release/kernel?

The Rasbian 3.6.11 obtained from here:
Code: [Select]
https://github.com/raspberrypi/linux/archive/rpi-3.6.y.tar.gz as described from this page http://elinux.org/RPi_Kernel_Compilation


The problem with the TCE package manager is that it usualy does not finish:
If I try to install MC I get to here:
ncurses.tzc.dep OK
glib2.tcz.dep OK
libssh2.tcz.dep OK

If I try to install wifi (again) it find that it is already installed - but it is not working.

If I try to start wifi by
sudo /usr/local/bin/wifi.sh : command not found

If I delete the wifi package and try to install it via tce package manager I get to here:
wireless_tools.tcz.dep OK
wpa_supplicant.tcz.dep OK
Downloading: libnl.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
libnl.tcz   100% *********************************************************   232k 0:00:00 ETA
libnl.tcz: OK
And then I need to kill it because it hangs.

It might be important but my piCore could not boot fully if libnl.tcz was present in the tce/optional directory during boot.

Regards
Steen
Title: Re: How to use a newer kernel?
Post by: tinypoodle on April 07, 2013, 07:53:57 AM
Generally speaking, there is no guarantee a modular kernel would work properly when attempting to insert modules from a different build.
Title: Re: How to use a newer kernel?
Post by: bmarkus on April 07, 2013, 08:27:02 AM
You can try to build your kernel without localversion to have to same version at least by name as original to try modules.
Title: Re: How to use a newer kernel?
Post by: sbp on April 07, 2013, 09:57:31 AM
Hi bmarkus and tinypoodle

You both focus on the module issue - so I confident that that is where my problem is.

As you probably already have figured out I'm not so familiar with linux, but lately I have been reading a lot about linux, and started to try to learn how to make a kernel for piCore.

So if I should fix this in a correct way I suppose that I need to make the modules for my newly build kernel?

From the raspberry page I have been using (http://elinux.org/RPi_Kernel_Compilation) I copied this:

Code: [Select]
Now you need to transfer the modules. Set an environment variable that points to a temporary module path.
export MODULES_TEMP=~/modules

In the build directory, run the following command [i](I changed it a bit because the CROSS_Compile path is in my .config file)[/i]:
make ARCH=arm INSTALL_MOD_PATH=${MODULES_TEMP} modules_install

The contents of this directory should then be copied into the RPi root directory.


This resulted in the following files:
Module.symvers
Stystem.map
modules.order
.vmlinux.cmd
.tmp_System.map
vmlinux
.tmp_kallsysms2.o
.tmp_vmlinux1
vmlinux.o
.version

Is that correct, and what should I do with these files?

Steen
 
Title: Re: How to use a newer kernel?
Post by: bmarkus on April 07, 2013, 10:14:22 AM
This resulted in the following files:

Module.symvers
Stystem.map
modules.order
.vmlinux.cmd
.tmp_System.map
vmlinux
.tmp_kallsysms2.o
.tmp_vmlinux1
vmlinux.o
.version


And hopefully modules themselves. Are modules built?
Title: Re: How to use a newer kernel?
Post by: sbp on April 07, 2013, 10:32:39 AM
And hopefully modules themselves. Are modules built?

That is the question - where should I find the modules?

I think that I may have made it difficult for myself because of the directory structure I have been using.

I extracted the linux 3.6.11 to a directory called  linux-rpi-3.6.11
Then cd'ed into linux-rpi-3.6.11 whith all the directories already present from a linux system.

Standing in this directory I made the kernel which was found in /arch/erm/boot
but the modules I reaaly don't know where to find. I can see a lot of directories which time stamps indicate that they were changed at the time the modules were build. Like:
sound/usb
sound/drivers
sound/core
sound/arm

In these directories there are a lot of subdirectories and also files called something like:
snd-usbmidi-lib.ko
snd-usb-audio.ko
etc

Steen


Title: Re: How to use a newer kernel?
Post by: tinypoodle on April 07, 2013, 10:58:47 AM
I had a look much earlier at the link you posted and I think your chances are best when following all steps in detail.

.ko extension is file naming convention for kernel modules starting with Linux 2.6
Title: Re: How to use a newer kernel?
Post by: sbp on April 08, 2013, 12:47:46 PM
Hi I have not given up on learning to build a kernel with its modules - but it will take some time.
I don't know exactly what to do after having build the kernel - the modules should go into the piCore.gz?

In the meantime some info for bmarcus.
The problem I had with using a wifi-USB dongle and a USB-DAC at the same time could be solved by adding this line to the cmdline.txt: dwc_otg.speed=1


But also adding  "options snd-usb-audio nrpacks=1" to the /etc/modprobe.conf file seems to make it better.

Hopefully these USB problems will be solved at some time.

Steen
Title: Re: How to use a newer kernel?
Post by: tinypoodle on April 08, 2013, 02:55:07 PM
I don't know exactly what to do after having build the kernel - the modules should go into the piCore.gz?

http://wiki.tinycorelinux.net/wiki:custom_kernel
Title: Re: How to use a newer kernel?
Post by: bmarkus on April 08, 2013, 03:13:05 PM
The problem I had with using a wifi-USB dongle and a USB-DAC at the same time could be solved by adding this line to the cmdline.txt: dwc_otg.speed=1


There are many issues with the Pi's USB stack, like USB keyboard breaks WiFi link, incompatibility wit keyboards, peformance isssue with playback, etc. affecting various distributions and applications. Also some kernel guys simply call is scrap.

dwc_otg.speed=1

limits USB speed to 12 Mbit/s which means less overhead for driver/CPU. In many cases it solves the problem, but it is limiting connected unit's performance too.

You may read this:

http://raspberrypi.stackexchange.com/questions/1886/what-kernel-parameters-are-available-for-fixing-usb-problems

Title: Re: How to use a newer kernel?
Post by: sbp on April 14, 2013, 01:34:03 AM
hi I hope you have not given up on me, I'm still trying and reading up on how to make a kernel + modules for raspberry.

The status now is:
I can build a functional kernel if I use the .config file from bmarcus's 3.6.11 kernel.

But after reading the tinycore wiki: http://wiki.tinycorelinux.net/wiki:custom_kernel
 I stumbled on the following sentence:

Code: [Select]
"The TC patches and other related files for the standard TC kernel are available at
http://tinycorelinux.net/4.x/x86/release/src/kernel/ "

Should I apply the TC-patches to the raspberry kernel before building the kernel, and can the patches from the x86 version be used on an ARM kernel?

And regarding the modules - this is where I think I have most problems:

Code: [Select]
When it comes to the modules and firmware files, you basically have two options, either let them be part of your initrd (a file named “tinycore.gz” in TC) or let them be part of extension files
(*.tcem). In most cases it is probably best to have some of them built into the initrd and some
available as loadable extensions. If you are unsure, build all of your files into the initrd.

I think the best option for me will be to put them in the tinycore.gz.
But I can't find any description on how to make the tinycore.gz

Do you have a step-by-step procedure?

Steen
Title: Re: How to use a newer kernel?
Post by: tinypoodle on April 14, 2013, 01:55:16 AM
http://wiki.tinycorelinux.net/wiki:remastering
http://wiki.tinycorelinux.net/wiki:dynamic_root_filesystem_remastering
Title: Re: How to use a newer kernel?
Post by: bmarkus on April 14, 2013, 01:57:11 AM

Should I apply the TC-patches to the raspberry kernel before building the kernel, and can the patches from the x86 version be used on an ARM kernel?


No these are for x86. On RPi we are using the official RPi kernels.

Regarding initrd see http://wiki.tinycorelinux.net/wiki:remastering
Title: Re: How to use a newer kernel?
Post by: sbp on April 14, 2013, 02:39:52 AM
OK - no patches needed.

Regarding the remastering part - it is not completely clear for me.
After reading the wiki about a custom kernel I thought that the tinycore.gz should be created from scratch using the new modules. 

But after having read the remastering wiki it is more something like:
I reuse an existing tinycore.gz - unpack it and add the modules and then repack?

Steen

 
Title: Re: How to use a newer kernel?
Post by: Juanito on April 14, 2013, 02:49:04 AM
unpack it and add the modules and then repack?

..replace the modules and then repack would be a better description :)
Title: Re: How to use a newer kernel?
Post by: tinypoodle on April 14, 2013, 02:55:30 AM
Hmm, I just now realized that I had posted the "dynamic root filesystem remastering" wiki link without knowing anything about the RPi bootloader, so maybe not a good idea...
Title: Re: How to use a newer kernel?
Post by: bmarkus on April 21, 2013, 03:41:41 AM
Now rpi-3.8-y alpha is available at http://elinux.org/RPi_Kernel_Compilation
Title: Re: How to use a newer kernel?
Post by: sbp on June 12, 2013, 07:04:58 AM
Hi bmarcus

I just wanted to update the kernel once again to the USB fiq_split version, which have fixed many of the previous problems. It is based on linux 3.8.13, the same as your newest kernel.

Therefore I took the .config file you have used, and started cross compiling on the fiq_spilt branch.

Inside the .config file I changed the path to my compiler, and then the compile started fine without asking any questions. But just as it was about to finish the compilation I got these errors and no image file was build:

Code: [Select]
.......
......
......
  CC      lib/vsprintf.o
  CC [M]  lib/crc-ccitt.o
  CC [M]  lib/crc7.o
  CC [M]  lib/ts_kmp.o
  CC [M]  lib/ts_bm.o
  CC [M]  lib/ts_fsm.o
  GEN     lib/crc32table.h
  CC      lib/crc32.o
  LD      lib/built-in.o
  AR      lib/lib.a
  LINK    vmlinux
: command not found
make: *** [vmlinux] Error 127

Can you see what is wrong?

Steen

Steen
 
Title: Re: How to use a newer kernel?
Post by: bmarkus on June 12, 2013, 07:17:38 AM
Steen

unfortunately have no idea :(

One question. What are the issues with the current 3.8.13 which are fixed in version you are trying to build?
Title: Re: How to use a newer kernel?
Post by: sbp on June 12, 2013, 07:48:11 AM
Steen

unfortunately have no idea :(

One question. What are the issues with the current 3.8.13 which are fixed in version you are trying to build?

I don't know if it fixes anything. But you know my main interest in the raspberry is to use it as a small audio player as a replacement of a Squeezebox player.
So often it is used together with a USB-DAC. Personally I have no problem with the current piCorePlayer with the USB-DAC that I use, but I get reports that some USB-DACs still produce a cracklling noise from time to time from other users.
It is amassing, but there are more than 200 downloads of the piCorePlayer

My previous piCorePlayer was based on linux 3.8.12 - and there were some problems that were mostly solved by changing to the fiq_split fix version (3.8.12 based).
 
Then came the 3.8.13 version which was much better than the 3.8.12 version - but recently the fiq_split branch also have been updated to 3.8.13, and even one more change has been done in the USB-handling in this branch which is not present in the "pure" 3.8.13 linux.

Therefore I thought that this version might be even better than the "pure" 3.8.13 linux - and wanted to give it a try. But unfortunately I can't compile a new fiq_split 3.8.13 kernel.

And I thought that I finally could manage to build new kernels (I did make a 3.8.12 and a fig_split version based on 3.8.12).
Steen 

 
Title: Re: How to use a newer kernel?
Post by: curaga on June 12, 2013, 10:26:05 AM
Looks like you're missing bash.
Title: Re: How to use a newer kernel?
Post by: sbp on June 12, 2013, 10:48:30 PM
Thanks to both of you, somehow I managed to fix the problem. Unfortunately it is not entirely clear to me what was the cause of it, and what I changed - but anyway it is working now.

Steen