User Tools

Site Tools


building_uimage_and_debian_linux_kernel_package_for_internet_space_v1

We assume on this page than you are familiar with getting and building the Linux kernel for arm.
If you're not, you can go there for your first steps.

Patching kernel

U-Boot issue

Lacie U-Boot is old and don't work with device tree.
It passes a device number to Linux kernel. This number is used to identify device and initialize hardware.
The Internet space v1 is very similar to the edminiv2 board.
The last kernel supporting edminiv2 without device tree is v3.6
So we must use the id passed by Lacie U-Boot for identifying the edminiv2.
This number is already used by another device. It has been changed for avoiding colision.

commit e467520cdf729a9fca1e4f5f8271457cc27afb64
Author: Frédéric Leroy <fredo@starox.org>
Date:   Wed May 1 18:18:46 2013 +0200
 
    Change Machine ID to make it work with Lacie Internet Space v1 / Orange Homelibrary
 
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 2997e56..ce6b9b6 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -117,7 +117,7 @@ omap_h3                     MACH_OMAP_H3            OMAP_H3                 509
 omap_h4                        MACH_OMAP_H4            OMAP_H4                 510
 omap_osk               MACH_OMAP_OSK           OMAP_OSK                515
 tosa                   MACH_TOSA               TOSA                    520
-avila                  MACH_AVILA              AVILA                   526
+avila                  MACH_AVILA              AVILA                   525
 edb9302                        MACH_EDB9302            EDB9302                 538
 husky                  MACH_HUSKY              HUSKY                   543
 shepherd               MACH_SHEPHERD           SHEPHERD                545
@@ -314,7 +314,7 @@ ezx_a1200           MACH_EZX_A1200          EZX_A1200               1742
 ezx_e6                 MACH_EZX_E6             EZX_E6                  1743
 ezx_e2                 MACH_EZX_E2             EZX_E2                  1744
 ezx_a910               MACH_EZX_A910           EZX_A910                1745
-edmini_v2              MACH_EDMINI_V2          EDMINI_V2               1756
+edmini_v2              MACH_EDMINI_V2          EDMINI_V2               526
 zipit2                 MACH_ZIPIT2             ZIPIT2                  1757
 omap3_pandora          MACH_OMAP3_PANDORA      OMAP3_PANDORA           1761
 mss2                   MACH_MSS2               MSS2                    1766

Cross-building debian package issue

There is a problem when cross-building debian package in Linux source.
Here is the patch to fix it :

commit 977052f78754e6b52fc09098d36e459f5e4b0798
Author: Frédéric Leroy <fredo@starox.org>
Date:   Wed May 1 18:39:33 2013 +0200
 
    patch builddeb to build package for foreign arch
 
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index acb8650..d269778 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -252,7 +252,12 @@ mkdir -p "$destdir"
 (cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -)
 ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
 rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
-arch=$(dpkg --print-architecture)
+
+if [ -n "$KBUILD_DEBARCH" ] ; then
+       arch="$KBUILD_DEBARCH"
+else
+       arch=$(dpkg --print-architecture)
+fi
 
 cat <<EOF >> debian/control

Building kernel

make ARCH=arm KBUILD_DEBARCH=armel CROSS_COMPILE=arm-linux-gnueabi- deb-pkg
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux_is uImage-$( cat include/config/kernel.release )
building_uimage_and_debian_linux_kernel_package_for_internet_space_v1.txt · Last modified: 2013/07/04 10:28 by starox