| #!/bin/sh |
| set -x |
| |
| # Copyright (C) 2015. Marvell International Ltd |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| KERNEL_LOAD=0x00808000 |
| KERNEL_IMAGE=uImage |
| KERNEL_OUT=${ANDROID_PRODUCT_OUT}/obj/KERNEL_OBJ |
| dtb_files=${KERNEL_OUT}/arch/arm/boot/dts/pxa1908-dkb.dtb |
| local_dtb_files_padded=${dtb_files}.padded |
| DTB_PADDING_BOOTIMG_SIZE=131072 |
| TARGET_DEVICE=abox_edge |
| TARGET_KERNEL_ARCH=arm |
| KERNEL_BIN=${KERNEL_OUT}/arch/arm/boot/zImage-dtb |
| |
| echo "Proceeding the dtb files: "+${dtb_files} |
| cp ${dtb_files} ${dtb_files}.orig && \ |
| cat ${dtb_files}.orig /dev/zero |head -c ${DTB_PADDING_BOOTIMG_SIZE} > ${dtb_files}.padded; |
| echo "Patching the out dtb files: "+${local_dtb_files_padded}+" to the kernel image" |
| ${ANDROID_BUILD_TOP}/vendor/bsp/marvell/device/abox_edge/kernel/mkimage -A arm -O linux -C gzip -a ${KERNEL_LOAD} -e ${KERNEL_LOAD} -n "${TARGET_DEVICE} linux" -d ${KERNEL_OUT}/arch/arm/boot/compressed/piggy.gzip ${KERNEL_OUT}/arch/arm/boot/${KERNEL_IMAGE} |
| cat ${KERNEL_OUT}/arch/${TARGET_KERNEL_ARCH}/boot/${KERNEL_IMAGE} /dev/zero|head -c `expr \`ls -l ${KERNEL_OUT}/arch/${TARGET_KERNEL_ARCH}/boot/${KERNEL_IMAGE} | awk -F' ' '{print $5}'\` + 2048 - \`ls -l ${KERNEL_OUT}/arch/${TARGET_KERNEL_ARCH}/boot/${KERNEL_IMAGE} | awk -F' ' '{print $5}'\` % 2048` > ${KERNEL_OUT}/arch/${TARGET_KERNEL_ARCH}/boot/${KERNEL_IMAGE}.padded |
| cat ${KERNEL_OUT}/arch/${TARGET_KERNEL_ARCH}/boot/${KERNEL_IMAGE}.padded ${local_dtb_files_padded} > ${KERNEL_BIN} |
| |
| ${ANDROID_BUILD_TOP}/out/host/linux-x86/bin/acp -fp ${KERNEL_BIN} ${ANDROID_PRODUCT_OUT}/kernel |
| ${ANDROID_BUILD_TOP}/out/host/linux-x86/bin/mkbootimg --kernel ${ANDROID_PRODUCT_OUT}/kernel --ramdisk ${ANDROID_PRODUCT_OUT}/ramdisk.img --cmdline "androidboot.console=ttyS1 console=ttyS1,115200 panic_debug uart_dma crashkernel=4k@0x8140000 user_debug=31 earlyprintk=uart8250-32bit,0xd4017000 androidboot.lcd=720p cma=20M cgroup_disable=memory ddr_mode=2 RDCA=08140400 cpmem=32M@0x06000000 androidboot.exist.cp=18 androidboot.hardware=iap140" --output ${ANDROID_PRODUCT_OUT}/boot.img |
| |
| ${ANDROID_BUILD_TOP}/vendor/bsp/marvell/device/abox_edge/bin/make_ext4fs -s -T -1 -S ${ANDROID_PRODUCT_OUT}/root/file_contexts.bin -L system -l 1073741824 -a system ${ANDROID_PRODUCT_OUT}/obj/PACKAGING/systemimage_intermediates/system.img ${ANDROID_PRODUCT_OUT}/system ${ANDROID_PRODUCT_OUT}/system |
| |
| ${ANDROID_BUILD_TOP}/vendor/bsp/marvell/device/abox_edge/bin/make_ext4fs -s -T -1 -L userdata -l 4343595008 -a userdata ${ANDROID_PRODUCT_OUT}/userdata.img |
| |
| ${ANDROID_BUILD_TOP}/vendor/bsp/marvell/device/abox_edge/bin/make_ext4fs -s -T -1 -L cache -l 268435456 -a cache ${ANDROID_PRODUCT_OUT}/cache.img |
| |
| ${ANDROID_BUILD_TOP}/out/host/linux-x86/bin/acp -fp ${ANDROID_PRODUCT_OUT}/obj/PACKAGING/systemimage_intermediates/system.img ${ANDROID_PRODUCT_OUT}/system.img |