WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to use a newer kernel?  (Read 61858 times)

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
How to use a newer kernel?
« 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
« Last Edit: February 27, 2013, 10:35:18 AM by sbp »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to use a newer kernel?
« Reply #1 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
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: How to use a newer kernel?
« Reply #2 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

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to use a newer kernel?
« Reply #3 on: March 02, 2013, 03:09:40 AM »
What do you mean newer kernel?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to use a newer kernel?
« Reply #4 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
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: How to use a newer kernel?
« Reply #5 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?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to use a newer kernel?
« Reply #6 on: March 03, 2013, 01:00:05 AM »
Do not know what was changed in the latest Raspbian kernel if any.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: How to use a newer kernel?
« Reply #7 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. 
« Last Edit: March 03, 2013, 04:01:31 AM by sbp »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to use a newer kernel?
« Reply #8 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 :)
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: How to use a newer kernel?
« Reply #9 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 :-)

 

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: How to use a newer kernel?
« Reply #10 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 .?

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: How to use a newer kernel?
« Reply #11 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
« Last Edit: March 24, 2013, 12:12:02 PM by sbp »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: How to use a newer kernel?
« Reply #12 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

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to use a newer kernel?
« Reply #13 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.

Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: How to use a newer kernel?
« Reply #14 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