diff options
author | Jun Yu <yujun@marvell.com> | 2015-10-30 18:44:26 -0700 |
---|---|---|
committer | Mohammed Habibulla <moch@google.com> | 2015-11-04 18:06:59 -0800 |
commit | 999988065d4c152f37b4393a791f90b3a8a1f296 (patch) | |
tree | aa2e3a634859a0bbdacdabee44e3760e7d3e99d9 | |
parent | bb7dae7acc9fddde926f8ddbdc2b8f5b3133b357 (diff) | |
download | abox_edge-999988065d4c152f37b4393a791f90b3a8a1f296.tar.gz |
Added the provision-device
Change-Id: Ib8a0724fba6cff5c2912deb8e64e0943382f8000
-rw-r--r-- | BoardConfig.mk | 4 | ||||
-rwxr-xr-x | mkmrvlimg | 45 | ||||
-rwxr-xr-x | provision-device | 30 |
3 files changed, 78 insertions, 1 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk index 7efca0f..11b25c2 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -28,7 +28,9 @@ BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 PRODUCT_COPY_FILES += \ - device/marvell/abox_edge/fstab:root/fstab.${soc_name} + device/marvell/abox_edge/fstab:root/fstab.${soc_name} \ + device/marvell/abox_edge/mkmrvlimg:mkmrvlimg \ + device/marvell/abox_edge/provision-device:provision-device # Must be defined at the end of the file $(call add_device_packages) diff --git a/mkmrvlimg b/mkmrvlimg new file mode 100755 index 0000000..f5be2b6 --- /dev/null +++ b/mkmrvlimg @@ -0,0 +1,45 @@ +#!/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 diff --git a/provision-device b/provision-device new file mode 100755 index 0000000..491ad4e --- /dev/null +++ b/provision-device @@ -0,0 +1,30 @@ +#!/bin/sh + +# 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. + +${ANDROID_PRODUCT_OUT}/mkmrvlimg + +fastboot \ + flash partition ${ANDROID_BUILD_TOP}/vendor/bsp/marvell/device/abox_edge/bin/primary_gpt \ + flash misc ${ANDROID_BUILD_TOP}/vendor/bsp/marvell/device/abox_edge/bin/misc.bin \ + erase pbootloader \ + flash pbootloader ${ANDROID_BUILD_TOP}/vendor/bsp/marvell/device/abox_edge/bootloader/u-boot.bin \ + erase rbootloader \ + flash rbootloader ${ANDROID_BUILD_TOP}/vendor/bsp/marvell/device/abox_edge/bootloader/u-boot.bin \ + flash boot ${ANDROID_PRODUCT_OUT}/boot.img \ + flash system ${ANDROID_PRODUCT_OUT}/system.img \ + flash userdata ${ANDROID_PRODUCT_OUT}/userdata.img \ + flash cache ${ANDROID_PRODUCT_OUT}/cache.img \ + flash recovery ${ANDROID_PRODUCT_OUT}/recovery.img "$@" |