From 15f8d5fa255f46cf18e3f16b553082b295cd37c9 Mon Sep 17 00:00:00 2001 From: Marc Andre Tanner Date: Mon, 4 Oct 2010 20:19:37 +0200 Subject: [PATCH] Integrate pre built Aboriginal Linux uclibc cross toolchain If we find no $CC download an uclibc based armv4tl cross toolchain from the Aboriginal Linux project. Signed-off-by: Marc Andre Tanner --- README | 76 +++++++++++++++++++++++-------------------------------------- build.sh | 11 ++++++++- download.sh | 8 +++++++ 3 files changed, 47 insertions(+), 48 deletions(-) diff --git a/README b/README index 3dae86b..3a95646 100644 --- a/README +++ b/README @@ -9,45 +9,16 @@ Qi Bootmenu System the bootmenu application) and kernel which can be flashed to your device. -Pre-Requirements -================ - - uClibc armv4tl cross toolchain - ------------------------------ - - The boot system is uclibc based you can therefore _not_ use the - openmoko toolchain. Instead you need to build your own cross - compiler. This is however out of scope of this project. - - I strongly recommend you to use a toolchain from the FWL project - - http://www.landley.net/code/firmware/ - - It is relocatable and uses a gcc wrapper script to make the gcc path - logic somewhat sane (if that's possible at all). It is currently - the only tested and supported toolchain. - - You can now either download a pre built uclibc toolchain from: - - http://impactlinux.com/fwl/downloads/binaries/cross-compiler-armv4tl.tar.bz2 - - or build one from scratch with the following instructions: - - 1. Download and extract +Quick Start +=========== - http://impactlinux.com/fwl/downloads/firmware-0.9.10.tar.bz2 + In theory all you need to do is run ./build.sh which should + create an uImage-GTA02.bin ready to flash to your device. - 2. Build the cross compiler + Make sure to have the pre-requirements installed. - ./download.sh && ./simple-cross-compiler.sh armv4tl - - 3. Copy the build/simple-cross-compiler-armv4tl directory to a - place of your choice. - - Now that you have a cross toolchain add it's bin directory to - your $PATH. - - cd simple-cross-compiler-armv4tl/bin && export PATH=`pwd`:$PATH +Pre-Requirements +================ Host tools ---------- @@ -59,20 +30,31 @@ Pre-Requirements git svn cvs lzop dfu-util autoconf automake libtool gettext mkimage pkg-config (>= 0.23) -Building the boot system -======================== + uClibc armv4tl cross toolchain + ------------------------------ - Environment setup - ----------------- + The boot system is uclibc based we can therefore _not_ use the + openmoko toolchain. Instead we need an uclibc based armv4tl + cross toolchain. Building one from scratch is however out of + scope of this project. - Make sure you have your cross toolchain somewhere in your $PATH, - if this is not the case then add it. + By default the scripts download a pre built toolchain from the + Aboriginal Linux project. + + http://www.landley.net/code/aboriginal/ - cd cross-compiler-armv4tl/bin && export PATH=`pwd`:$PATH + It is relocatable and uses a gcc wrapper script to make the gcc path + logic somewhat sane (if that's possible at all). It is the only tested + and supported toolchain. - By default the scripts assume 'armv4tl-' as toolchain prefix if your - toolchain uses something different then set the $CROSS environment - variable accordingly. + If for whatever reason you don't want to run a pre built toolchain + you can run ./build.sh aboriginal which compiles one from scratch. + Altneratively you can also build one according to the Aboriginal Linux + documentation, make sure to add the toolchains bin directory to your + $PATH. + +Building the boot system +======================== Configuring the build --------------------- @@ -88,7 +70,7 @@ Building the boot system $STATIC build qi-bootmenu statically and don't install shared libraries. This results in a slightly smaller + faster - initramfs. + initramfs. This is enabled by default. Building the initramfs content, kernel and bootloader ----------------------------------------------------- diff --git a/build.sh b/build.sh index 432ba12..075c13b 100755 --- a/build.sh +++ b/build.sh @@ -6,7 +6,16 @@ source sources/include.sh || exit 1 ./download.sh || exit 1 -[ -z $(which "$CC") ] && echo "Compiler '$CC' not found in \$PATH." && exit 1 +if [ -z $(which "$CC") ]; then + if [[ ! $(uname -m) == arm* ]]; then + if [ ! -d "cross-compiler-$ARCH" ]; then + tar xjf "$SRCDIR/cross-compiler-$ARCH.tar.bz2" + fi + export PATH="$PATH:$TOP/cross-compiler-$ARCH/bin" + else + echo "Compiler '$CC' not found in \$PATH." && exit 1 + fi +fi echo "=== Building" diff --git a/download.sh b/download.sh index af0ff69..a9030ad 100755 --- a/download.sh +++ b/download.sh @@ -19,6 +19,14 @@ MIRROR_LIST= # a new version of a file, set SHA1= and update the URL, run ./download.sh, # then cut and paste the sha1 from the output and run it again to confirm. +URL=http://landley.net/code/aboriginal/downloads/binaries/cross-compiler-armv4tl.tar.bz2 \ +SHA1=317e1fc1b01e915097beaefeb7f578733c651835 \ +download || dienow + +URL=http://www.impactlinux.com/aboriginal/downloads/aboriginal-1.0.0.tar.bz2 \ +SHA1=7eb41f7c42119712c074e0665bb1e7bd04c16e88 \ +download || dienow + URL='http://git.openmoko.org/?p=kernel.git;a=snapshot;h=e4182f3551f1b8e8f8bd07a2d68e49a0ec4cd04a;sf=tgz' \ SHA1= \ RENAME="s/.*h=(.*);.*/kernel-\1.tar.gz/" \ -- 2.11.4.GIT