[PATCH] Add build script and documentation.

Timo Juhani Lindfors timo.lindfors at iki.fi
Mon Jul 12 11:00:31 CEST 2010


Hi,

since om-gta02-2.6.32 does not contain andy's build script I'm afraid
many users don't know how to build it. I figured out how to build it
but used the wrong defconfig file:

http://docs.openmoko.org/trac/ticket//2344

The attached patch adds documentation and a build script for compiling
Linux. In the future it should be updated to always default to the
kernel configuration file that works.

-Timo

---
 README.openmoko |   30 ++++++++++++++++++++++++++++++
 build.openmoko  |   30 ++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 0 deletions(-)
 create mode 100644 README.openmoko
 create mode 100644 build.openmoko

diff --git a/README.openmoko b/README.openmoko
new file mode 100644
index 0000000..98c0e8a
--- /dev/null
+++ b/README.openmoko
@@ -0,0 +1,30 @@
+	Linux for Openmoko hardware
+
+BUILDING
+
+You can build Linux by running
+
+./build.openmoko
+
+and following the instructions that are printed to you after
+build. Optionally you can set one of the following environment
+variables:
+
+CROSS_COMPILE
+	Prefix of the cross-compiler you are using. Defaults to
+	/usr/local/openmoko/arm/bin/arm-angstrom-linux-gnueabi-. Under
+	Debian you typically want to use
+	"CROSS_COMPILE=arm-linux-gnueabi- ./build.openmoko"
+
+BUILDROOT
+	Directory where object files and build results will be placed. Defaults to
+	build-$VERSION where $VERSION includes your git branch and revision.
+
+CONFIG
+	Linux configuration file to use. Defaults to
+	arch/arm/configs/gta02_defconfig.
+
+If you need to make changes to the script you probably should copy it
+as "build.openmoko.local" or something so that git does not complain
+about your modifications and also consider mailing
+openmoko-kernel at lists.openmoko.org.
diff --git a/build.openmoko b/build.openmoko
new file mode 100644
index 0000000..a58b058
--- /dev/null
+++ b/build.openmoko
@@ -0,0 +1,30 @@
+#!/bin/bash
+set -x
+set -e
+HEAD=$(git show --pretty=oneline | head -n1 | cut -d' ' -f1 | cut -b1-16)
+# TODO: check for uncommitted changes by default?
+BRANCH=$(git branch | grep ^\* | cut -d' ' -f2)
+VERSION=$BRANCH\_$HEAD
+: ${BUILDROOT:=build-$VERSION}
+: ${CONFIG:=arch/arm/configs/gta02_defconfig}
+: ${PARALLEL:=4}
+: ${CROSS_COMPILE:=/usr/local/openmoko/arm/bin/arm-angstrom-linux-gnueabi-}
+export CROSS_COMPILE
+
+rm -fr $BUILDROOT
+mkdir $BUILDROOT
+cp $CONFIG $BUILDROOT/.config
+make O=$BUILDROOT ARCH=arm silentoldconfig
+make -j$PARALLEL O=$BUILDROOT ARCH=arm CONFIG_DEBUG_SECTION_MISMATCH=y EXTRAVERSION=$VERSION
+${CROSS_COMPILE}objcopy -O binary -R .note -R .comment -S $BUILDROOT/arch/arm/boot/compressed/vmlinux $BUILDROOT/linux.bin
+mkimage -A arm -O linux -T kernel -C none -a 30008000 -e 30008000 -n $VERSION -d $BUILDROOT/linux.bin $BUILDROOT/uImage-$VERSION.bin
+mkdir -p $BUILDROOT/staging
+make O=$BUILDROOT ARCH=arm modules_install INSTALL_MOD_PATH=staging
+cd $BUILDROOT/staging
+tar czf ../modules-$VERSION.tar.gz .
+
+echo Congratulations, your kernel has now been built.
+echo Please unpack $BUILDROOT/modules-$VERSION.tar.gz to the root of your Openmoko
+echo and then boot $BUILDROOT/uImage-$VERSION.bin using either U-boot or Qi.
+echo Alternatively you can boot $BUILDROOT/arch/arm/boot/zImage with kexec.
+
-- 
1.5.6.5




More information about the openmoko-kernel mailing list