[oe-commits] Ulf Samuelsson : Add framework for generating board build directories and capability to build multiple boards
git version control
git at git.openembedded.org
Thu Aug 13 07:16:36 UTC 2009
Module: openembedded.git
Branch: ulf/linux-2.6.30.2
Commit: 2bc4ef8c9799adb0ab231569b08a6bcb3a43ebcc
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=2bc4ef8c9799adb0ab231569b08a6bcb3a43ebcc
Author: Ulf Samuelsson <ulf.samuelsson at atmel.com>
Date: Thu Aug 13 09:16:26 2009 +0200
Add framework for generating board build directories and capability to build multiple boards
---
conf/local.conf.sample.patch | 80 ++++++++++++++++++++++++++++++++++
scripts/MAKEALL | 99 ++++++++++++++++++++++++++++++++++++++++++
scripts/board_list-at91.sh | 11 +++++
scripts/environment.sh | 8 +++
scripts/make-local.conf.sh | 45 +++++++++++++++++++
5 files changed, 243 insertions(+), 0 deletions(-)
diff --git a/conf/local.conf.sample.patch b/conf/local.conf.sample.patch
new file mode 100644
index 0000000..f0d7e1f
--- /dev/null
+++ b/conf/local.conf.sample.patch
@@ -0,0 +1,80 @@
+--- local.conf.sample 2009-08-11 18:30:37.000000000 +0200
++++ local.conf 2009-08-13 06:14:03.000000000 +0200
+@@ -20,11 +20,11 @@
+ # expansion. Stuff like starting with ${HOME} or ${TOPDIR} is ok).
+
+ # Use this to specify where BitBake should place the downloaded sources into
+-DL_DIR = "${HOME}/sources"
++DL_DIR = "MYDOWNLOAD"
+
+ # Delete the line below. Then specify which .bb files to consider for
+ # your build. Typically this will be something like BBFILES = "/path/to/openembedded/recipes/*/*.bb"
+-BBFILES := "${@bb.fatal('Edit your conf/local.conf: BBFILES')}"
++BBFILES := "MYCURDIR/openembedded/recipes/*/*.bb"
+
+ # Use the BBMASK below to instruct BitBake to _NOT_ consider some .bb files
+ # This is a regulary expression, so be sure to get your parenthesis balanced.
+@@ -65,7 +65,7 @@
+ # Uncomment this to specify a machine to build for. See the conf directory
+ # for machines currently known to OpenEmbedded. This will automatically take care
+ # of TARGET_ARCH
+-# MACHINE = "c7x0"
++MACHINE = "MYMACHINE"
+
+ # Use this to specify the target architecture. Note that this is only
+ # needed when building for a machine not known to OpenEmbedded. Better use
+@@ -85,7 +85,7 @@
+ # openzaurus-unstable is a so called "versioned" distro, i.e. they
+ # explicitely select specific versions of various packages.
+ # Stay away from unversioned distros unless you really know what you are doing
+-# DISTRO = "angstrom-2008.1"
++DISTRO = "angstrom-2008.1"
+
+ # So far, angstrom.conf sets ENABLE_BINARY_LOCALE_GENERATION
+ # to generate binary locale packages at build time using qemu-native and
+@@ -97,12 +97,12 @@
+ # qemus lack patches needed to work with various OE targets.
+ # ENABLE_BINARY_LOCALE_GENERATION = "0"
+ # ASSUME_PROVIDED += "qemu-native"
+
+ # If ENABLE_BINARY_LOCALE_GENERATION is set to "1", you can limit locales
+ # generated to the list provided by GLIBC_GENERATE_LOCALES. This is huge
+ # time-savior for developmental builds. Format: list of locale.encoding pairs
+ # with spaces as separators.
+-# GLIBC_GENERATE_LOCALES = "en_US.UTF-8 en_GB.UTF-8 de_DE.UTF-8"
++GLIBC_GENERATE_LOCALES = "en_US.UTF-8 en_GB.UTF-8 de_DE.UTF-8"
+
+ # Uncomment this to select a particular major kernel version if the MACHINE setting
+ # supports more than one major kernel version. Currently this is suported by the
+@@ -125,7 +127,7 @@
+ # IMAGE_KEEPROOTFS = "1"
+
+ # Uncomment this to disable the parse cache (not recommended).
+-# CACHE = ""
++CCACHE=""
+
+ # Uncomment this if you want BitBake to emit debugging output
+ # BBDEBUG = "yes"
+@@ -150,13 +152,13 @@
+ # This allows make to spawn mutliple processes to take advantage of multiple
+ # processors. Useful on SMP machines. This may break some packages - we're
+ # in the process of marking these so let us know if you find any.
+-# PARALLEL_MAKE = "-j 4"
++PARALLEL_MAKE = "-j MYMAKEJOBS"
+
+ # Uncomment to run multiple bitbake threads in parallel.
+ # Bitbake can do multiple jobs in parallel: Its a good idea make use of
+ # all available resources: e.g. to download sources while some other
+ # piece of software is compiled.
+-# BB_NUMBER_THREADS = "2"
++BB_NUMBER_THREADS = "MYTHREADS"
+
+ # Uncomment this if you want BitBake to emit the log if a build fails.
+ BBINCLUDELOGS = "yes"
+@@ -170,4 +172,5 @@
+ # PACKAGE_SNAP_LIB_SYMLINKS = "1"
+
+ # EDIT THIS FILE and then remove the line below before using!
+-REMOVE_THIS_LINE:="${@bb.fatal('Read the comments in your conf/local.conf')}"
++# EXTRA_OECONF += "--target-list=arm-linux-user,arm-softmmu"
++PREFERRED_VERSION_linux-libc-headers = "MYKERNEL"
diff --git a/scripts/MAKEALL b/scripts/MAKEALL
new file mode 100755
index 0000000..457c45d
--- /dev/null
+++ b/scripts/MAKEALL
@@ -0,0 +1,99 @@
+#!/bin/sh
+TOPDIR=`pwd`
+LOGFILE=build.log
+OLDLOG=old.log
+METHOD=do_rebuild
+
+
+function log_time()
+{
+ printf "%-50s\n" $1 | tee -a ${LOGFILE} | tee -a $2.log
+ printf "%-10s\n" "`date +%T`" | tee -a ${LOGFILE} | tee -a $2.log
+ if test -e ${TOPDIR}/build-$1/FAIL ; then
+ printf "%-10s\n" "[FAIL]" | tee -a ${LOGFILE} | tee -a $2.log
+ else
+ printf "%-10s\n" "[OK]" | tee -a ${LOGFILE} | tee -a $2.log
+ fi
+}
+
+function log_time_sts()
+{
+ printf "%-50s\n" $1 | tee -a ${LOGFILE} | tee -a $2.log
+ printf "%-10s" "`date +%T`" | tee -a ${LOGFILE} | tee -a $2.log
+}
+
+function prepare ()
+{
+ cd ${TOPDIR}
+ rm -f build
+ ln -s build-$1 build
+ cd build
+}
+
+function action ()
+{
+ printf "%-40s\n" "$1 running from build-$1" | tee -a ${LOGFILE} | tee -a $2.log
+
+# printf "%-50s\n" "Start building $2 at" | tee -a ${LOGFILE} | tee -a $2.log
+ log_time "$1 start building $2 at" $2
+ bitbake $2 > build.log 2>&1 || touch FAIL
+
+# printf "%-50s\n" "Start building u-boot at" | tee -a ${LOGFILE} | tee -a $2.log
+ log_time "$1 start building u-boot at" $2
+ bitbake u-boot > u-boot.log 2>&1 || touch FAIL
+
+# printf "%-50s\n" "Stop building $2 at" | tee -a ${LOGFILE} | tee -a $2.log
+ log_time "$1 stop building $2 at" $2
+}
+
+function remove_tmp ()
+{
+ printf "%-50s" "$1 removing tmp from build-$1" | tee -a ${LOGFILE} | tee -a $2.log
+ rm -fr tmp/cache ; printf "0"
+ rm -fr tmp/cross ; printf "1"
+ rm -fr tmp/deploy ; printf "2"
+ rm -fr tmp/pkgdata ; printf "3"
+ rm -fr tmp/rootfs ; printf "4"
+ rm -fr tmp/staging ; printf "5"
+ rm -fr tmp/stamps ; printf "6"
+ rm -fr tmp/usr ; printf "7"
+ rm -fr tmp/work ; printf "8"
+ rm -fr tmp ; printf "9"
+ printf "%-10s\n" "[DONE]" | tee -a ${LOGFILE} | tee -a $2.log
+}
+
+function do_rebuild ()
+{
+ prepare $1 $2
+ cd ${TOPDIR}/build
+ rm -f *.log
+ rm -f FAIL
+ remove_tmp $1 $2
+ action $1 $2
+}
+
+function do_build ()
+{
+ prepare $1 $2
+ cd ${TOPDIR}/build
+ touch ${LOGFILE}
+ cat ${LOGFILE} >> ${OLDLOG}
+ rm -f ${LOGFILE}
+ action $1 $2
+}
+
+function build_board ()
+{
+
+# printf "%-50s" "$1 started at" | tee -a ${LOGFILE} | tee -a $2.log
+ log_time "$1 started at" $2
+ ${METHOD} $1 $2
+
+
+# printf "%-50s" "$1 completed at" | tee -a ${LOGFILE} | tee -a $2.log
+ log_time_sts "$1 completed at" $2
+}
+
+source board_list.sh
+
+
diff --git a/scripts/board_list-at91.sh b/scripts/board_list-at91.sh
new file mode 100644
index 0000000..16664b5
--- /dev/null
+++ b/scripts/board_list-at91.sh
@@ -0,0 +1,11 @@
+#/bin/sh
+
+build_board sam9263dfc x11-gpe-image
+#build_board sam9g45ek x11-gpe-image
+#build_board sam9g10df x11-gpe-image
+#build_board sam9g20dfc console-image
+#build_board sam9260dfc console-image
+#build_board sam9261df x11-gpe-image
+#build_board sam9xedfc console-image
+
+
diff --git a/scripts/environment.sh b/scripts/environment.sh
new file mode 100755
index 0000000..c30b501
--- /dev/null
+++ b/scripts/environment.sh
@@ -0,0 +1,8 @@
+#/bin/sh
+# Example environment.sh
+
+DOWNLOAD=/usr/local/install/downloads
+MAKEJOBS=4
+THREADS=4
+KERNEL=2.6.30
+
diff --git a/scripts/make-local.conf.sh b/scripts/make-local.conf.sh
new file mode 100755
index 0000000..bad5c69
--- /dev/null
+++ b/scripts/make-local.conf.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+MACHINE=$1
+TOPDIR=`pwd`
+source environment.sh
+
+OE_CONF_DIR=${TOPDIR}/openembedded/conf
+CONF_DIR=${TOPDIR}/build-$1/conf
+SED="sed -i"
+CONF_FILE=local.conf.sample
+CONF_SRC=${OE_CONF_DIR}/${CONF_FILE}
+CONF_PATCH=${OE_CONF_DIR}/${CONF_FILE}.patch
+
+
+function edit ()
+{
+ sed -r -i -e $2 $1
+}
+
+mkdir -p ${CONF_DIR}
+cp ${CONF_SRC} ${CONF_DIR}
+cd ${CONF_DIR}
+cat ${CONF_PATCH} | patch
+mv ${CONF_FILE} $1.conf
+ln -s $1.conf local.conf
+
+
+echo MACHINE=${MACHINE}
+${SED} "s#MYMACHINE#${MACHINE}#g" $1.conf
+echo KERNEL=${KERNEL}
+${SED} "s#MYKERNEL#${KERNEL}#g" $1.conf
+echo TOPDIR=${TOPDIR}
+${SED} "s#MYCURDIR#${TOPDIR}#g" $1.conf
+echo DOWNLOAD=${DOWNLOAD}
+${SED} "s#MYDOWNLOAD#${DOWNLOAD}#g" $1.conf
+echo MAKEJOBS=${MAKEJOBS}
+${SED} "s#MYMAKEJOBS#${MAKEJOBS}#g" $1.conf
+echo THREADS=${THREADS}
+${SED} "s#MYTHREADS#${THREADS}#g" $1.conf
+
+# Example local.conf
+
+# DOWNLOAD=/usr/local/install/downloads
+# MAKEJOBS=4
+# THREADS=4
+# KERNEL=2.6.30
More information about the Openembedded-commits
mailing list