r3772 - in trunk/src/target/kernel: . scripts

werner at sita.openmoko.org werner at sita.openmoko.org
Sat Jan 5 05:12:21 CET 2008


Author: werner
Date: 2008-01-05 05:12:17 +0100 (Sat, 05 Jan 2008)
New Revision: 3772

Added:
   trunk/src/target/kernel/scripts/
   trunk/src/target/kernel/scripts/README
   trunk/src/target/kernel/scripts/build
   trunk/src/target/kernel/scripts/update
Log:
Example scripts for the "manual" kernel build process (i.e., without using
OpenEmbedded or anything similar.)

NOTE: this is still unfinished and largely untested work.

- scripts/README: description of what this is
- scripts/build: build the kernel from scratch
- scripts/update: update the OM SVN repository

--Thi line, and those below, will be ignored--

A    scripts
A    scripts/build
A    scripts/update
A    scripts/README


Added: trunk/src/target/kernel/scripts/README
===================================================================
--- trunk/src/target/kernel/scripts/README	2008-01-05 03:35:52 UTC (rev 3771)
+++ trunk/src/target/kernel/scripts/README	2008-01-05 04:12:17 UTC (rev 3772)
@@ -0,0 +1,31 @@
+UNDER DEVELOPMENT - DON'T USE YET
+
+Kernel build scripts
+====================
+
+This is a collection of scripts to build the Linux kernel. This is the "manual"
+build process, which only needs a cross-toolchain and u-boot, but nothing else
+from OpenEmbedded or any similar environment.
+
+They're mainly intended as examples for how the process works and aren't
+necessarily useful "as is" for daily work:
+
+build
+  Build the kernel from scratch, using either the latest or some specific
+  version from the ftp.kernel.org kernel (HTTP) and the OpenMoko patches (SVN).
+
+update
+  Update the kernel sources to either the latest or some specific SVN version.
+
+
+Toolchain
+---------
+
+We use the OpenEmbedded EABI toolchain. See ../../u-boot/scripts/README for
+details.
+
+
+Environment variables
+---------------------
+
+See "build".

Added: trunk/src/target/kernel/scripts/build
===================================================================
--- trunk/src/target/kernel/scripts/build	2008-01-05 03:35:52 UTC (rev 3771)
+++ trunk/src/target/kernel/scripts/build	2008-01-05 04:12:17 UTC (rev 3772)
@@ -0,0 +1,51 @@
+UNDER DEVELOPMENT - DON'T USE YET
+
+#!/bin/sh -e
+#
+# This script illustrates how to build a specific version of the Linux kernel
+# from scratch. This is mainly intended as a template for copy & paste, and as
+# an example for individual scripts.
+#
+# This script uses the gnueabi toolchain, see the file
+# ../../u-boot/scripts/README in this
+#
+#
+# Environment variables:
+#
+# SVN points to the root of the local copy of the OpenMoko SVN tree (the tree
+# must be checked out already), e.g.,
+# SVN=/home/moko/svn.openmoko.org/
+#
+# KERNEL specifies the kernel version we use, e.g.,
+# KERNEL=2.6.22.5
+#
+# KERNELSRC_DIR, if defined, specifies the directory where the kernel source
+# tarball resides. By default, we use ".".
+# KERNELSRC_DIR=/wherever
+#
+# UBOOT_DIR, if defined, specifies the absolute (!) path to the directory where
+# u-boot has been built. By default, we use ./u-boot
+# UBOOT_DIR=/wherever/u-boot
+#
+# SVN_REV, if defined, specifies which SVN revision we use, e.g.,
+# SVN_REV=3770
+#
+
+# wget http://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${KERNEL}.tar.bz2
+
+tar xfj ${KERNELSRC_DIR:-.}/linux-${KERNEL}.tar.bz2
+
+# we need this for "mkimage", which makes uImages
+PATH=$PATH:${UBOOT_DIR:-`pwd`/u-boot}/tools
+
+cd linux-$KERNEL
+
+ln -sf $SVN/trunk/src/target/kernel/patches
+
+[ -z "$SVN_REV" ] ||
+  ( cd patches && svn update -r$SVN_REV; )
+
+quilt push -a
+cp $SVN/trunk/src/target/kernel/config/defconfig-$KERNEL .config
+make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- oldconfig
+make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- uImage

Added: trunk/src/target/kernel/scripts/update
===================================================================
--- trunk/src/target/kernel/scripts/update	2008-01-05 03:35:52 UTC (rev 3771)
+++ trunk/src/target/kernel/scripts/update	2008-01-05 04:12:17 UTC (rev 3772)
@@ -0,0 +1,26 @@
+UNDER DEVELOPMENT - DON'T USE YET
+
+#!/bin/sh -e
+#
+# This script illustrates how to update the Linux kernel to either a specific
+# of the latest OpenMoko version. This is mainly intended as a template for
+# copy & paste, and as an example for individual scripts.
+#
+# See ../../u-boot/scripts/README for the toolchain and "build" for environment
+# variables.
+#
+
+cd linux-$KERNEL
+
+# If there are uncommitted changes, "quilt refresh" them first.
+# If the SVN repository has been updated before running this script,
+# "quilt pop -a" may fail, and you have to use "quilt pop -f" or
+# "quilt pop -a -f".
+#
+quilt pop -a
+
+( cd patches && svn update -r${SVN_REV:-HEAD}; )
+
+quilt push -a
+make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- oldconfig
+make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- uImage





More information about the commitlog mailing list