aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Pfeffer <zach.pfeffer@linaro.org>2013-02-21 21:42:22 -0600
committerZach Pfeffer <zach.pfeffer@linaro.org>2013-02-21 21:42:22 -0600
commit2397a4fe3f9a1d9b9bb3b8aa3dad46d8b53851a2 (patch)
tree44cc87ab7829b609b6a6f1046a6ff4d19569553e
parent31337923f507bb8c34e8eb6aeb35236f72e8f317 (diff)
downloadat-2397a4fe3f9a1d9b9bb3b8aa3dad46d8b53851a2.tar.gz
Fix and streamline kernel only builds
Signed-off-by: Zach Pfeffer <zach.pfeffer@linaro.org>
-rw-r--r--tools.sh71
1 files changed, 22 insertions, 49 deletions
diff --git a/tools.sh b/tools.sh
index 1d903bf..a7ebbdd 100644
--- a/tools.sh
+++ b/tools.sh
@@ -210,25 +210,17 @@ You can get one by downloading a boot.tar.bz2 from:
Downloads > target > vexpress
tar -jxvf boot.tar.bz2
"
+ local ramdisk=1
if [ ! -e out/target/product/vexpress/obj/kernel/arch/arm64/boot/Image ]; then
- echo "Build your kernel first with ./bk.sh"
- exit
+ echo "Build your kernel first with bk"
+ return
fi
- if [ -z "$1" ]; then
- if [ ! -e out/target/product/vexpress/ramdisk.img ]; then
- echo "Pass the full path to a ramdisk.img or make a ramdisk.img"
- echo "$MSG"
- exit
- fi
- else
- if [ ! -e "$1" ]; then
- echo "The path $1 doesn't exist."
- echo "Please pass a path to a ramdisk that does exist."
- echo "$MSG"
- exit
- fi
+ if [ ! -e out/target/product/vexpress/ramdisk.img ]; then
+ echo "The ramdisk doesn't exist at: out/target/product/vexpress/ramdisk.img"
+ echo "Building without ramdisk"
+ ramdisk=0
fi
ln -sf $(pwd)/out/target/product/vexpress/obj/kernel/arch/arm64/boot/Image out/target/product/vexpress/kernel
@@ -237,17 +229,27 @@ You can get one by downloading a boot.tar.bz2 from:
ln -sf $(pwd)/kernel/arch/arm64/boot/dts/vexpress-v2m-rs1.dtsi ./boot-wrapper/vexpress-v2m-rs1.dtsi
ln -sf $(pwd)/kernel/arch/arm64/boot/dts/skeleton.dtsi ./boot-wrapper/skeleton.dtsi
ln -sf $(pwd)/out/target/product/vexpress/kernel ./boot-wrapper/Image
- ln -sf $(pwd)/out/target/product/vexpress/ramdisk.img ./boot-wrapper/filesystem.cpio.gz
- PATH=$(pwd)/gcc-linaro-aarch64-linux-gnu-4.7/bin:$PATH && \
- make -C ./boot-wrapper clean && \
- make -C ./boot-wrapper CROSS_COMPILE=aarch64-linux-android-
+ if [ $ramdisk == 1 ]; then
+ ln -sf $(pwd)/out/target/product/vexpress/ramdisk.img ./boot-wrapper/filesystem.cpio.gz
+ PATH=$(pwd)/gcc-linaro-aarch64-linux-gnu-4.7/bin:$PATH && \
+ make -C ./boot-wrapper clean && \
+ make -C ./boot-wrapper CROSS_COMPILE=aarch64-linux-android-
+ else
+ PATH=$(pwd)/gcc-linaro-aarch64-linux-gnu-4.7/bin:$PATH && \
+ make -C ./boot-wrapper clean && \
+ sed 's/^INITRD_FLAGS/#INITRD_FLAGS/' <./boot-wrapper/Makefile | \
+ make -C ./boot-wrapper CROSS_COMPILE=aarch64-linux-android- -f-
+ fi
+ mkdir -p out/target/product/vexpress/boot
cp -fa ./boot-wrapper/linux-system.axf out/target/product/vexpress/boot/linux-system.axf
rm ./boot-wrapper/dtc
rm ./boot-wrapper/vexpress-v2p-aarch64.dts
rm ./boot-wrapper/vexpress-v2m-rs1.dtsi
rm ./boot-wrapper/skeleton.dtsi
rm ./boot-wrapper/Image
- rm ./boot-wrapper/filesystem.cpio.gz
+ if [ $ramdisk == 1 ]; then
+ rm ./boot-wrapper/filesystem.cpio.gz
+ fi
}
function targetterm() {
@@ -476,35 +478,6 @@ function ck() {
make -j${CPUS} -C kernel O=$KERNEL_OUT ARCH=arm64 menuconfig
}
-
-
-export REMAKE_BOOT_DOC="Remakes the boot-wrapper
-Dosen't need an Android checkout
-Puts the files in the boot-wrapper directory, not in the build"
-function remake_boot() {
- export ANDROID_DIR=$(pwd)
- export KERNEL_OUT=$ANDROID_DIR/out/target/product/vexpress/obj/kernel
- export BOOT_DIR=$ANDROID_DIR/boot
- export KERNEL_DIR=$ANDROID_DIR/kernel
- export TOOLCHAIN_DIR=$ANDROID_DIR/gcc-linaro-aarch64-linux-gnu-4.7/bin
- export BOOT_WRAPPER_DIR=$ANDROID_DIR/boot-wrapper
- pushd $BOOT_WRAPPER_DIR
- ln -sf $KERNEL_OUT/scripts/dtc/dtc dtc
- ln -sf $KERNEL_DIR/arch/arm64/boot/dts/vexpress-v2p-aarch64.dts vexpress-v2p-aarch64.dts
- ln -sf $KERNEL_DIR/arch/arm64/boot/dts/vexpress-v2m-rs1.dtsi vexpress-v2m-rs1.dtsi
- ln -sf $KERNEL_DIR/arch/arm64/boot/dts/skeleton.dtsi skeleton.dtsi
- ln -sf $KERNEL_OUT/arch/arm64/boot/Image Image
- ln -sf $BOOT_DIR/ramdisk.img filesystem.cpio.gz
- make CROSS_COMPILE=aarch64-linux-android-
- popd
- rm ./boot-wrapper/dtc
- rm ./boot-wrapper/vexpress-v2p-aarch64.dts
- rm ./boot-wrapper/vexpress-v2m-rs1.dtsi
- rm ./boot-wrapper/skeleton.dtsi
- rm ./boot-wrapper/Image
- rm ./boot-wrapper/filesystem.cpio.gz
-}
-
export UPDATEBOOT_DOC="update boot/ from boot-wrapper/"
function updatebootfrombootwrapper() {
export ANDROID_DIR=$(pwd)