[PATCH] Add build script and documentation.

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


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:


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.


 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
+You can build Linux by running
+and following the instructions that are printed to you after
+build. Optionally you can set one of the following environment
+	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"
+	Directory where object files and build results will be placed. Defaults to
+	build-$VERSION where $VERSION includes your git branch and revision.
+	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 @@
+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)
+: ${CONFIG:=arch/arm/configs/gta02_defconfig}
+: ${PARALLEL:=4}
+: ${CROSS_COMPILE:=/usr/local/openmoko/arm/bin/arm-angstrom-linux-gnueabi-}
+rm -fr $BUILDROOT
+cp $CONFIG $BUILDROOT/.config
+make O=$BUILDROOT ARCH=arm silentoldconfig
+${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.

More information about the openmoko-kernel mailing list