Author Topic: Compiling kernel: Which kernel source code?  (Read 17182 times)

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Compiling kernel: Which kernel source code?
« Reply #15 on: August 31, 2013, 10:47:06 am »
Okay, I've changed the type back to OTG, and now it compiles fine.
Can you help me with something else? I tried to build the deb package on my XUbuntu 13.04, and I get the following error:

Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- KBUILD_IMAGE=uImage -j6 deb-pkg
.......
dpkg-deb: building package `linux-firmware-image' in `../linux-firmware-image_3.4.43-7_armhf.deb'.
dpkg-gencontrol: error: current host architecture 'armhf' does not appear in package's architecture list (amd64)
make[1]: *** [deb-pkg] Error 255
make: *** [deb-pkg] Error 2
Looks like you need some cross building tools like dpkg-cross or crossbuild-essential-armhf.

Cubear

  • Guest
Re: Compiling kernel: Which kernel source code?
« Reply #16 on: September 01, 2013, 08:39:02 am »
Oh, what a mess, dpkg-cross is already installed, but I get this when trying to install crossbuild-essential-armhf.

Quote
cubear@harmonica:~/linux-sunxi$ sudo apt-get install crossbuild-essential-armhf
[sudo] password for cubear:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 crossbuild-essential-armhf : Depends: libc6-dev:armhf but it is not installable
E: Unable to correct problems, you have held broken packages.

I mean all the script needs to do is create a .deb package out of the already-compiled binaries and files. Why does it need libc?


Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Compiling kernel: Which kernel source code?
« Reply #17 on: September 08, 2013, 10:30:11 pm »
Oh, what a mess, dpkg-cross is already installed, but I get this when trying to install crossbuild-essential-armhf.

Quote
cubear@harmonica:~/linux-sunxi$ sudo apt-get install crossbuild-essential-armhf
[sudo] password for cubear:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 crossbuild-essential-armhf : Depends: libc6-dev:armhf but it is not installable
E: Unable to correct problems, you have held broken packages.

I mean all the script needs to do is create a .deb package out of the already-compiled binaries and files. Why does it need libc?
Because you're installing a development environment, not just a deb package creator.  "Crossbuild essential" are the essential packages for a cross compiler build environment, and you're asking for the "armhf" version, which pulls in lots of stuff, including libc:armhf.  So in order to cross compile an armhf kernel on x86, you need the cross compiling packages for armhf, which requires libc:armhf.

Cubear

  • Guest
Re: Compiling kernel: Which kernel source code?
« Reply #18 on: September 15, 2013, 09:26:48 am »
So in order to cross compile an armhf kernel on x86, you need the cross compiling packages for armhf, which requires libc:armhf.

I am confused. The compiling already works fine on my x64 - I've compiled a working armhf uImage without libc:armhf several times. It's the deb-pkg that refuses to run and make a .deb image. What are the correct steps to make a .deb kernel package for armhf on x64? There seem to be some people on various mailing lists having similar problems due to dpkg using the wrong architecture string (if I understood that correctly).

See here:
https://lkml.org/lkml/2012/9/6/364
http://lists.debian.org/debian-kernel/2012/06/msg00235.html
« Last Edit: September 15, 2013, 09:29:13 am by Cubear »

AutoStatic

  • Guest
Re: Compiling kernel: Which kernel source code?
« Reply #19 on: September 23, 2013, 10:12:52 am »
make-kpg should work:
Code: [Select]
sudo apt-get install kernel-packageAnd then use a script like:
Code: [Select]
#!/bin/bash

export $(dpkg-architecture -aarmhf)
export CROSS_COMPILE=arm-linux-gnueabihf-
export LOCALVERSION=
export CONCURRENCY_LEVEL=$(getconf _NPROCESSORS_ONLN)
export DEBIAN_REVISION=0
export INITRD=YES
export IMAGE_TYPE=uImage

cp your.config .config
make-kpkg clean
fakeroot make-kpkg kernel_image
Haven't tried this myself for the Cubieboard, it works for other platforms though.

Offline allensmith

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Compiling kernel: Which kernel source code?
« Reply #20 on: January 05, 2015, 04:08:16 am »
I'm trying to build a custom kernel from a git repository on my Ubuntu virtual machine. I run the make command as follows :
Code: [Select]
sudo apt-get install vim libncurses5-dev gcc make git exuberant-ctags
mkdir -p git/kernels; cd git/kernels
git clone -b staging-next git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
cd staging
cp /boot/config-`uname -r`* .config
make olddefconfig
make menuconfig
make
The build process ends with the following error.
Code: [Select]
drivers/staging/media/cxd2099/cxd2099.c: In function ‘slot_reset’: 
drivers/staging/media/cxd2099/cxd2099.c:537:4: error: expected ‘;’ before ‘if’ 
make[4]:  [drivers/staging/media/cxd2099/cxd2099.o] Error 1 
make[3]:  [drivers/staging/media/cxd2099] Error 2 
make[2]:  [drivers/staging/media] Error 2 
make[1]:  [drivers/staging] Error 2 
make:  [drivers] Error 2 
How should I repair this error?I am a greenhand of this fileld.Any suggestion will be appreciated. Thanks in advance.

________________________
Join code128 and create code128