3 # Get lots of predefined environment variables and shell functions.
5 source sources
/include.sh ||
exit 1
7 for tool
in lzop dfu-util autoconf automake libtool
gettext mkimage
9 [ -z $
(which "$tool") ] && echo "$tool not found in \$PATH" && exit 1
12 .
/download.sh ||
exit 1
14 if [ -z $
(which "$CC") ]; then
15 if [[ ! $
(uname
-m) == arm
* ]]; then
16 if [ ! -d "cross-compiler-$ARCH" ]; then
17 tar xjf
"$SRCDIR/cross-compiler-$ARCH.tar.bz2"
19 export PATH
="$PATH:$TOP/cross-compiler-$ARCH/bin"
21 echo "Compiler '$CC' not found in \$PATH." && exit 1
31 rm -f "$TOP/initramfs-files"
32 blank_tempdir
"$STAGING_DIR"
33 ln -s "usr/lib" "$STAGING_DIR/lib"
34 blank_tempdir
"$ROOT_DIR"
37 if [[ ! -d "$ROOT_DIR" ||
! -d "$ROOT_DIR/usr" ]]
39 mkdir
-p "$ROOT_DIR"/{tmp
,proc
,sys
,dev
,mnt
,home
/root
} || dienow
40 for i
in bin sbin lib etc
42 mkdir
-p "$ROOT_DIR/usr/$i" || dienow
43 ln -s "usr/$i" "$ROOT_DIR/$i" || dienow
56 # build initramfs content
58 build_package linux-headers
61 build_package kexec-tools
65 build_package freetype
69 build_package qi-bootmenu
70 build_package dropbear
72 # copy the the root-overlay drectory over the initramfs and generate
73 # a file called 'initramfs-files' which can be specified as
74 # CONFIG_INITRAMFS_SOURCE during the kernel build
76 cd "$TOP" && .
/initramfs.sh
78 # build kernel which embedds the previously built initramfs content