WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline bmarkus

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

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

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: How to use a newer kernel?
« Reply #16 on: March 25, 2013, 11: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.
« Last Edit: March 26, 2013, 12:10:49 AM by roberts »
10+ Years Contributing to Linux Open Source Projects.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to use a newer kernel?
« Reply #17 on: March 26, 2013, 03: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
« Last Edit: March 26, 2013, 03:12:02 AM by bmarkus »
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 #18 on: March 26, 2013, 06: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?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to use a newer kernel?
« Reply #19 on: March 26, 2013, 07: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.
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 #20 on: March 28, 2013, 08: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
« Last Edit: March 28, 2013, 09:08:09 AM by sbp »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: How to use a newer kernel?
« Reply #21 on: March 28, 2013, 08:52:00 AM »
When posting logs on English forums, please use "export LANG=C" before running the command.
The only barriers that can stop you are the ones you create yourself.

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: How to use a newer kernel?
« Reply #22 on: March 28, 2013, 09: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.

 

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to use a newer kernel?
« Reply #23 on: March 28, 2013, 09: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.

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 #24 on: March 28, 2013, 09: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

Offline sbp

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


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
« Last Edit: March 28, 2013, 11:02:02 AM by sbp »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: How to use a newer kernel?
« Reply #26 on: March 28, 2013, 11: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

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to use a newer kernel?
« Reply #27 on: March 28, 2013, 11: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
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 #28 on: March 28, 2013, 11: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

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to use a newer kernel?
« Reply #29 on: March 28, 2013, 11:53:12 AM »
Béla
Ham Radio callsign: HA5DI

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