Difference between revisions of "Kernel build instructions"

From Pandora Wiki
Jump to: navigation, search
(update general info)
 
(49 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{hint|This tutorial is outdated, as it covers the 2.6.x kernel. Now the Pandora runs on 3.2.x . The new git command is "git checkout --track -b pandora-3.2 origin/pandora-3.2", and the default config is "make omap3_pandora_defconfig". All patches are already applied.
 +
}}
 +
 
{{hint|Kernel will not be binary compatible with one that comes with firmware, meaning you'll need to rebuild all modules too, unless exact same toolchain and source code is used. See "Firmware Compatibility" section.
 
{{hint|Kernel will not be binary compatible with one that comes with firmware, meaning you'll need to rebuild all modules too, unless exact same toolchain and source code is used. See "Firmware Compatibility" section.
 
}}
 
}}
Line 17: Line 20:
  
 
===CodeSourcery G++===
 
===CodeSourcery G++===
Usually [http://www.codesourcery.com/gnu_toolchains/arm/portal/subscription?@template=lite CodeSourcery's ARM GNU/Linux tool chain] is used to build OMAP3 kernels, but other variations can be used as well. For [[CodeSourcery]], 2009q1-203 version is recommended (click "all versions" in above page), as 2007q3 doesn't work with kernels above 2.6.29, and 2008q1-2008q3 produce bad code in some situations. See [http://www.elinux.org/ARMCompilers BeagleBoard page] for more information.  
+
Usually [https://sourcery.mentor.com/sgpp/lite/arm/portal/subscription?@template=lite CodeSourcery's ARM GNU/Linux tool chain] is used to build OMAP3 kernels, but other variations can be used as well. For CodeSourcery, 2009q1-203 version is recommended (click "all versions" in above page), as 2007q3 doesn't work with kernels above 2.6.29, and 2008q1-2008q3 produce bad code in some situations. The 2011.03 does not work.
 +
See [http://www.elinux.org/ARMCompilers BeagleBoard page] for more information.  
  
 
'''Windows Users:'''
 
'''Windows Users:'''
Line 25: Line 29:
 
</source>
 
</source>
 
or similar. As mentioned [https://support.codesourcery.com/GNUToolchain/kbentry46 here], create an environment variable called CYGPATH with the value 'cygpath' (minus the quotes). Patching your install using the [https://support.codesourcery.com/GNUToolchain/kbentry21 SourceryG++ guide to kernel building] as a reference is necessary to get your cygwin/windows builds off the ground.
 
or similar. As mentioned [https://support.codesourcery.com/GNUToolchain/kbentry46 here], create an environment variable called CYGPATH with the value 'cygpath' (minus the quotes). Patching your install using the [https://support.codesourcery.com/GNUToolchain/kbentry21 SourceryG++ guide to kernel building] as a reference is necessary to get your cygwin/windows builds off the ground.
 
  
 
===Git===
 
===Git===
Line 40: Line 43:
 
<br>
 
<br>
  
== Cloning and switching branches ==
+
== The Kernel : Cloning and switching branches ==
 
Now you need to 'clone' kernel source using git tools from previous step. Make a directory you want to keep source in and cd into it. Then run:
 
Now you need to 'clone' kernel source using git tools from previous step. Make a directory you want to keep source in and cd into it. Then run:
 
<source lang="text">
 
<source lang="text">
Line 47: Line 50:
 
This will now download the source from openpandora.org. Note that it will take a while, so be patient.
 
This will now download the source from openpandora.org. Note that it will take a while, so be patient.
 
When done, you will have default 'master' branch checked out, but it doesn't have the latest files, so you need to checkout the current 'pandora-27-omap1' branch:
 
When done, you will have default 'master' branch checked out, but it doesn't have the latest files, so you need to checkout the current 'pandora-27-omap1' branch:
 +
<source lang="text">
 +
cd pandora-kernel/
 +
</source>
 +
Then:
 
<source lang="text">
 
<source lang="text">
 
git checkout --track -b pandora-27-omap1 origin/pandora-27-omap1
 
git checkout --track -b pandora-27-omap1 origin/pandora-27-omap1
 
</source>
 
</source>
 +
 +
 +
==Firmware Compatibility==
 +
The firmware kernel is built using OE (openembedded), so the only sure way to get binary compatibility is to use that. see [[http://pandorawiki.org/%C3%85ngstr%C3%B6m#Firmware_build_instructions]]
 +
 +
The manual procedure to do the same without using OE would be:
 +
* Get [[Setting_up_a_cross-compiler#DJWillis.27s_Cross_Compiler|DJWillis' toolchain]] (it is the same as one built by OE).
 +
* Apply the patches listed in [http://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=blob;f=recipes/linux/omap3-pandora-kernel_2.6.27-pandora.bb;hb=HEAD recipes/linux/omap-pandora-kernel_2.6.27-pandora.bb] from the git repository at [http://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=tree;f=recipes/linux/omap3-pandora-kernel git://git.openpandora.org/openpandora.oe.git] on the kernel tree. musb-rxtx.patch may not apply cleanly unless you remove the junk at the end and fix the context for musbhsdma.c
 +
* (deprecated) Copy the defconfig file from above patches location to .config
 +
* Set up environment as described in "Building" section and build (make/make uImage).
 +
 +
 +
== Getting The Patches ==
 +
 +
You have to come back to your initial directory:
 +
<source lang="bash">
 +
cd ..
 +
</source>
 +
 +
Then:
 +
<source lang="bash">
 +
git clone git://git.openpandora.org/pandora-oe-environment.git pandora-firmware
 +
cd pandora-firmware
 +
source ./op-env-oe.sh
 +
./initial-setup.sh
 +
cd metadata/openembedded.git/
 +
git checkout op.openembedded.next
 +
</source>
 +
 +
 +
== Applying The Patches ==
 +
 +
Now go back into the previously downloaded kernel sources :
 +
<source lang="bash">
 +
cd ../../../pandora-kernel/
 +
</source>
 +
 +
And patch around:
 +
<source lang="bash">
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/0001-Add-EHCI-patch-suggested-by-Steven-Kipisz.patch
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/0002-Add-missing-define-to-EHCI-OMAP.c.patch
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/no-empty-flash-warnings.patch
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/oprofile-0.9.3.armv7.diff
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/no-cortex-deadlock.patch
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/read_die_ids.patch
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/fix-install.patch
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-fix-timings.diff
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-fix-display-panning.diff
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-make-dpll4-m4-ck-programmable.diff
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-improve-pixclock-config.diff
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-make-video-timings-selectable.diff
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-enable-overlay-optimalization.diff
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/dvb-fix-dma.diff
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/0001-Removed-resolution-check-that-prevents-scaling-when.patch
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/0001-Implement-downsampling-with-debugs.patch
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/musb-rxtx.patch
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/squashfs/0006-SquashFS-Backport-SquashFS4-to-our-2.6.27-tree.patch
 +
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/aufs2/0007-AUFS2-Add-latest-AUFS2-in-tree-code-for-2.6.27.patch
 +
 +
</source>
 +
 +
 +
== More Dirty Things ==
 +
If you have "mixed implicit and normal rules" errors (make >= 3.82), edit the Makefile:
 +
 +
Remove the "config" at the beginning of the line 448.
 +
 +
Remove the "/" at the beginning of the line 1610.
 +
 +
 +
If you have "cc1: error: unrecognized command line option "-mlittle-endian"", then your toolchain is probably too recent.
 +
  
 
== Building ==
 
== Building ==
To build you need to have several environment variables set. If you don't have your toolchain in PATH, you need to add it there:
+
To build you need to have several environment variables set. If you don't have your toolchain in PATH, you need to add it:
 +
 
 +
DJWillis:
 +
<source lang="bash">
 +
export PATH=$PATH:/usr/local/angstrom/arm/bin
 +
</source>
 +
GS G++:
 
<source lang="bash">
 
<source lang="bash">
 
export PATH=$PATH:/path/to/arm-2009q1/bin
 
export PATH=$PATH:/path/to/arm-2009q1/bin
 
</source>
 
</source>
You also need to have CROSS_COMPILE set:
+
You also need to have CROSS_COMPILE set (DJWillis):
 +
<source lang="bash">
 +
export CROSS_COMPILE=arm-angstrom-linux-gnueabi-
 +
</source>
 +
Or (GS G++):
 
<source lang="bash">
 
<source lang="bash">
 
export CROSS_COMPILE=arm-none-linux-gnueabi-
 
export CROSS_COMPILE=arm-none-linux-gnueabi-
Line 64: Line 153:
 
export ARCH=arm
 
export ARCH=arm
 
</source>
 
</source>
 
+
Now set copy the defconfig from the patch location :
Now set up the default .config file:
 
 
<source lang="bash">
 
<source lang="bash">
make omap3_pandora_defconfig
+
cp /wherever_it_is/pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/defconfig ./.config
 
</source>
 
</source>
 
If you want to customize kernel features, run
 
If you want to customize kernel features, run
Line 78: Line 166:
 
make
 
make
 
</source>
 
</source>
and it should build you uImage and place it in arch/arm/boot/ . You can now use it to boot from [[SD card]] (recommended) or replace the one in your flash. Last make command will build you kernel modules.
+
OR (in case of errors with CS G++) :
 +
<source lang="bash">
 +
make CROSS_COMPILE="arm-none-linux-gnueabi-" uImage
 +
make CROSS_COMPILE="arm-none-linux-gnueabi-" modules
 +
</source>
 +
and it should build you uImage and place it in arch/arm/boot/ . You will use it to boot from [[SD card]] (recommended) or replace the one in your flash. Last make command will build you kernel modules.
  
==Firmware Compatibility==
+
And (almost) finally :
The firmware kernel is built using OE (openembedded), so the only sure way to get binary compatibility is to use that (see [[Firmware_build_instructions]]).
+
<source lang="bash">
 +
rm /path/to/your/pandora/filesystem/boot/uImage
 +
cp arch/arm/boot/uImage /path/to/your/pandora/filesystem/boot/
 +
INSTALL_MOD_PATH="/path/to/your/pandora/filesystem/" make modules_install
 +
</source>
 +
 
 +
 
 +
== Building Wi-Fi modules==
 +
Come back to your main directory, then clone the Wi-Fi git:
 +
<source lang="bash">
 +
cd ..
 +
git clone git://openpandora.org/pandora-wifi.git
 +
cd pandora-wifi
 +
git checkout --track -b pandora-wifi
 +
</source>
 +
 
 +
Build (change env variables if needed):
 +
<source lang="bash">
 +
export PATH=$PATH:/usr/local/angstrom/arm/bin/
 +
export CROSS_COMPILE=arm-angstrom-linux-gnueabi-
 +
make clean
 +
make ARCH=arm KLIB=../pandora-kernel KLIB_BUILD=../pandora-kernel
 +
</source>
 +
 
 +
And copy to your OP filesystem, ie if it's on /media/OS/ :
 +
<source lang="bash">
 +
mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/compat/
 +
cp compat/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/compat/
 +
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/compat/*.ko
 +
 
 +
mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/mac80211/
 +
cp net/mac80211/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/mac80211/
 +
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/mac80211/*.ko
 +
 
 +
mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/wireless/
 +
cp net/wireless/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/wireless/
 +
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/wireless/*.ko
 +
 
 +
mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/rfkill/
 +
cp net/rfkill/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/rfkill/
 +
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/rfkill/*.ko
 +
 
 +
mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/wl12xx/
 +
cp drivers/net/wireless/wl12xx/wl1251.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/wl12xx/
 +
cp drivers/net/wireless/wl12xx/wl1251_sdio.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/wl12xx/
 +
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/wl12xx/wl1251*.ko
 +
 
 +
# some bonus not wl1251 related drivers
 +
 
 +
cp drivers/net/wireless/at76c50x-usb.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/
 +
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/at76c50x-usb.ko
 +
 
 +
mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/rt2x00/
 +
cp drivers/net/wireless/rt2x00/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/rt2x00/
 +
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/rt2x00/*.ko
 +
 
 +
mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/p54/
 +
cp drivers/net/wireless/p54/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/p54/
 +
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/p54/*.ko
 +
</source>
 +
 
 +
 
 +
== First Boot ==
 +
 
 +
At the first boot, if modules don't load, type as root :
 +
<source lang="bash">
 +
depmod -ae
 +
</source>
 +
And reboot.
 +
 
 +
 
 +
- One forum thread about kernel recompilation [http://boards.openpandora.org/index.php?/topic/5842-rebuilding-the-actual-hf6s-kernel/ here:].
  
The manual procedure to do the same without using OE would be:
 
* Get [[Setting_up_a_cross-compiler#DJWillis.27s_Cross_Compiler|DJWillis' toolchain]] (it is the same as one built by OE).
 
* Apply the patches listed in [http://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=blob;f=recipes/linux/omap3-pandora-kernel_2.6.27-pandora.bb;hb=HEAD recipes/linux/omap-pandora-kernel_2.6.27-pandora.bb] from the git repository at git://git.openpandora.org/openpandora.oe.git . musb-rxtx.patch may not apply cleanly unless you remove the junk at the end and fix the context for musbhsdma.c
 
* Copy the defconfig file from above patches location to .config
 
* Set up environment as described in "Building" section and build (make/make uImage).
 
  
 
[[Category:Development]]
 
[[Category:Development]]
 
[[Category:Kernel]]
 
[[Category:Kernel]]

Latest revision as of 23:08, 17 March 2014



Preparation

First you need a toolchain and several other tools.

Cygwin (Windows Users)

Cygwin is a Linux-like environment for Windows; download and install here. You will need additional packages installed to build the kernel:

  • diffutils
  • gcc4
  • make
  • ncurses
  • libncurses-devel
  • git (see below)


CodeSourcery G++

Usually CodeSourcery's ARM GNU/Linux tool chain is used to build OMAP3 kernels, but other variations can be used as well. For CodeSourcery, 2009q1-203 version is recommended (click "all versions" in above page), as 2007q3 doesn't work with kernels above 2.6.29, and 2008q1-2008q3 produce bad code in some situations. The 2011.03 does not work. See BeagleBoard page for more information.

Windows Users: When installing on Windows, do not use the default install path, as it contains spaces and will cause problems when building (when the build system uses -print-file-name=include). Install to

C:\SourceryG++\

or similar. As mentioned here, create an environment variable called CYGPATH with the value 'cygpath' (minus the quotes). Patching your install using the SourceryG++ guide to kernel building as a reference is necessary to get your cygwin/windows builds off the ground.

Git

For source control access, you need to have git installed. Use your packet manager or build it from source. On Windows, install via cygwin.

A guide for basic git usage.


mkimage

Finally you need to have 'mkimage' tool in PATH, which can be built as part of u-boot build process, or download below:


The Kernel : Cloning and switching branches

Now you need to 'clone' kernel source using git tools from previous step. Make a directory you want to keep source in and cd into it. Then run:

git clone git://openpandora.org/pandora-kernel.git

This will now download the source from openpandora.org. Note that it will take a while, so be patient. When done, you will have default 'master' branch checked out, but it doesn't have the latest files, so you need to checkout the current 'pandora-27-omap1' branch:

cd pandora-kernel/

Then:

git checkout --track -b pandora-27-omap1 origin/pandora-27-omap1


Firmware Compatibility

The firmware kernel is built using OE (openembedded), so the only sure way to get binary compatibility is to use that. see [[1]]

The manual procedure to do the same without using OE would be:


Getting The Patches

You have to come back to your initial directory:

cd ..

Then:

git clone git://git.openpandora.org/pandora-oe-environment.git pandora-firmware
cd pandora-firmware
source ./op-env-oe.sh
./initial-setup.sh
cd metadata/openembedded.git/
git checkout op.openembedded.next


Applying The Patches

Now go back into the previously downloaded kernel sources :

cd ../../../pandora-kernel/

And patch around:

patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/0001-Add-EHCI-patch-suggested-by-Steven-Kipisz.patch
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/0002-Add-missing-define-to-EHCI-OMAP.c.patch
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/no-empty-flash-warnings.patch
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/oprofile-0.9.3.armv7.diff
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/no-cortex-deadlock.patch
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/read_die_ids.patch
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/fix-install.patch
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-fix-timings.diff
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-fix-display-panning.diff
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-make-dpll4-m4-ck-programmable.diff
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-improve-pixclock-config.diff
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-make-video-timings-selectable.diff
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/mru-enable-overlay-optimalization.diff
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/dvb-fix-dma.diff
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/0001-Removed-resolution-check-that-prevents-scaling-when.patch
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/0001-Implement-downsampling-with-debugs.patch
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/musb-rxtx.patch
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/squashfs/0006-SquashFS-Backport-SquashFS4-to-our-2.6.27-tree.patch
patch -p1 < ../pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/aufs2/0007-AUFS2-Add-latest-AUFS2-in-tree-code-for-2.6.27.patch


More Dirty Things

If you have "mixed implicit and normal rules" errors (make >= 3.82), edit the Makefile:

Remove the "config" at the beginning of the line 448.

Remove the "/" at the beginning of the line 1610.


If you have "cc1: error: unrecognized command line option "-mlittle-endian"", then your toolchain is probably too recent.


Building

To build you need to have several environment variables set. If you don't have your toolchain in PATH, you need to add it:

DJWillis:

export PATH=$PATH:/usr/local/angstrom/arm/bin

GS G++:

export PATH=$PATH:/path/to/arm-2009q1/bin

You also need to have CROSS_COMPILE set (DJWillis):

export CROSS_COMPILE=arm-angstrom-linux-gnueabi-

Or (GS G++):

export CROSS_COMPILE=arm-none-linux-gnueabi-

Newer kernels (2.6.3x+) need ARCH set to arm:

export ARCH=arm

Now set copy the defconfig from the patch location :

cp /wherever_it_is/pandora-firmware/metadata/openpandora.oe.git/recipes/linux/omap3-pandora-kernel/defconfig ./.config

If you want to customize kernel features, run

make menuconfig

When finished, just run

make uImage
make

OR (in case of errors with CS G++) :

make CROSS_COMPILE="arm-none-linux-gnueabi-" uImage
make CROSS_COMPILE="arm-none-linux-gnueabi-" modules

and it should build you uImage and place it in arch/arm/boot/ . You will use it to boot from SD card (recommended) or replace the one in your flash. Last make command will build you kernel modules.

And (almost) finally :

rm /path/to/your/pandora/filesystem/boot/uImage
cp arch/arm/boot/uImage /path/to/your/pandora/filesystem/boot/
INSTALL_MOD_PATH="/path/to/your/pandora/filesystem/" make modules_install


Building Wi-Fi modules

Come back to your main directory, then clone the Wi-Fi git:

cd ..
git clone git://openpandora.org/pandora-wifi.git
cd pandora-wifi
git checkout --track -b pandora-wifi

Build (change env variables if needed):

export PATH=$PATH:/usr/local/angstrom/arm/bin/
export CROSS_COMPILE=arm-angstrom-linux-gnueabi-
make clean
make ARCH=arm KLIB=../pandora-kernel KLIB_BUILD=../pandora-kernel

And copy to your OP filesystem, ie if it's on /media/OS/ :

mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/compat/
cp compat/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/compat/
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/compat/*.ko

mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/mac80211/
cp net/mac80211/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/mac80211/
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/mac80211/*.ko

mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/wireless/
cp net/wireless/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/wireless/
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/wireless/*.ko

mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/rfkill/
cp net/rfkill/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/rfkill/
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/net/rfkill/*.ko

mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/wl12xx/
cp drivers/net/wireless/wl12xx/wl1251.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/wl12xx/
cp drivers/net/wireless/wl12xx/wl1251_sdio.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/wl12xx/
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/wl12xx/wl1251*.ko

# some bonus not wl1251 related drivers

cp drivers/net/wireless/at76c50x-usb.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/at76c50x-usb.ko

mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/rt2x00/
cp drivers/net/wireless/rt2x00/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/rt2x00/
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/rt2x00/*.ko

mkdir -p /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/p54/
cp drivers/net/wireless/p54/*.ko /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/p54/
chmod 0644 /media/OS/lib/modules/2.6.27.46-omap1/updates/kernel/drivers/net/wireless/p54/*.ko


First Boot

At the first boot, if modules don't load, type as root :

depmod -ae

And reboot.


- One forum thread about kernel recompilation here:.