ec2-build/build-kernel: clean up directory handling and 3.2 branch
[beagleboard-validation:scripts.git] / ec2-build / build-kernel.sh
1 #!/bin/sh
2 set -e
3 set -x
4 PATH=/usr/local/angstrom/arm/bin:/mnt/u-boot/tools:$PATH
5 BUILD=/mnt/build
6 node --version
7 git clone git://github.com/jadonk/kernel.git $BUILD/kernel
8 git clone git://github.com/jadonk/u-boot.git $BUILD/u-boot
9 git clone git://github.com/jadonk/am33x-cm3.git $BUILD/am33x-cm3
10 cd $BUILD/u-boot
11 make -j16 tools
12 cd $BUILD/kernel
13 git checkout beaglebone-3.2
14 ./patch.sh
15 cp $BUILD/kernel/configs/beaglebone $BUILD/kernel/kernel/arch/arm/configs/beaglebone_defconfig
16 cp $BUILD/am33x-cm3/bin/am335x-pm-firmware.bin $BUILD/kernel/kernel/firmware/am335x-pm-firmware.bin
17 mkdir -p $BUILD/kernel/kernel/rootfs
18 cd $BUILD/kernel/kernel
19 make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- beaglebone_defconfig
20 make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- -j16 uImage dtbs
21 make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- -j16 modules
22 make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- INSTALL_MOD_PATH=$BUILD/kernel/kernel/rootfs modules_install
23 make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- uImage-dtb.am335x-bone
24 make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- uImage-dtb.am335x-bonelt
25 cd $BUILD/kernel/kernel/rootfs
26 tar -cvzf modules.tgz lib