author | Xindong Xu <xindong.xu@amlogic.com> | 2017-11-01 01:51:01 (GMT) |
---|---|---|
committer | Xindong Xu <xindong.xu@amlogic.com> | 2017-11-01 05:32:52 (GMT) |
commit | 96190387711ea6f3851d2970a09cfc8dc2078864 (patch) | |
tree | 6b991c096d6815ea3e64eba07c9d13c46fc72356 | |
parent | 94373a40843e72fcef53a5130626c1249e855d23 (diff) | |
download | amlogic-o-96190387711ea6f3851d2970a09cfc8dc2078864.zip amlogic-o-96190387711ea6f3851d2970a09cfc8dc2078864.tar.gz amlogic-o-96190387711ea6f3851d2970a09cfc8dc2078864.tar.bz2 |
device: add scripts for make boot.img by input ramdisk.img [1/1]
PD# 153505
add scripts for make boot.img by input ramdisk.img
Change-Id: I6ce93cbb69c0092630358904be924c04de50115b
-rwxr-xr-x | p212/make_boot.sh | 41 | ||||
-rwxr-xr-x | p230/make_boot.sh | 39 |
2 files changed, 80 insertions, 0 deletions
diff --git a/p212/make_boot.sh b/p212/make_boot.sh new file mode 100755 index 0000000..90d6e83 --- a/dev/null +++ b/p212/make_boot.sh @@ -0,0 +1,41 @@ +#!/bin/bash -ex + +# Run from top of kitkat source + +ROOTFS=$1 +PREFIX_CROSS_COMPILE=/opt/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- +DTBTOOL=vendor/amlogic/tools/dtbTool + +if [ "$ROOTFS" == "" -o ! -f "$ROOTFS" ]; then + echo "Usage: $0 <ramdisk.img> [m]" + exit 1 +fi + +KERNEL_OUT=out/target/product/p212/obj/KERNEL_OBJ +mkdir -p $KERNEL_OUT + +if [ ! -f $KERNEL_OUT/.config ]; then + make -C common O=../$KERNEL_OUT meson64_defconfig ARCH=arm64 CROSS_COMPILE=$PREFIX_CROSS_COMPILE +fi + +make -C common O=../$KERNEL_OUT ARCH=arm64 -j6 CROSS_COMPILE=$PREFIX_CROSS_COMPILE modules Image.gz + +cp $KERNEL_OUT/arch/arm64/boot/Image.gz out/target/product/p212/kernel + +if [ "$2" != "m" ]; then + make -C common O=../$KERNEL_OUT gxl_p212_1g.dtb ARCH=arm64 CROSS_COMPILE=$PREFIX_CROSS_COMPILE + make -C common O=../$KERNEL_OUT gxl_p212_2g.dtb ARCH=arm64 CROSS_COMPILE=$PREFIX_CROSS_COMPILE + #cp -f $KERNEL_OUT/arch/arm64/boot/dts/amlogic/gxl_p212_2g.dtb out/target/product/p212/dtb.img + $DTBTOOL -o out/target/product/p212/dtb.img -p $KERNEL_OUT/scripts/dtc/ $KERNEL_OUT/arch/arm64/boot/dts/amlogic/ +fi + +if [ "$2" != "m" ]; then + out/host/linux-x86/bin/mkbootimg --kernel common/../$KERNEL_OUT/arch/arm64/boot/Image.gz \ + --base 0x0 \ + --kernel_offset 0x1080000 \ + --ramdisk ${ROOTFS} \ + --second out/target/product/p212/dtb.img \ + --output ./out/target/product/p212/boot.img + ls -l ./out/target/product/p212/boot.img + echo "boot.img done" +fi diff --git a/p230/make_boot.sh b/p230/make_boot.sh new file mode 100755 index 0000000..5872f56 --- a/dev/null +++ b/p230/make_boot.sh @@ -0,0 +1,39 @@ +#!/bin/bash -ex + +# Run from top of kitkat source + +ROOTFS=$1 +PREFIX_CROSS_COMPILE=/opt/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- +DTBTOOL=vendor/amlogic/tools/dtbTool + +if [ "$ROOTFS" == "" -o ! -f "$ROOTFS" ]; then + echo "Usage: $0 <ramdisk.img> [m]" + exit 1 +fi + +KERNEL_OUT=out/target/product/p230/obj/KERNEL_OBJ +mkdir -p $KERNEL_OUT + +if [ ! -f $KERNEL_OUT/.config ]; then + make -C common O=../$KERNEL_OUT meson64_defconfig ARCH=arm64 CROSS_COMPILE=$PREFIX_CROSS_COMPILE +fi + +make -C common O=../$KERNEL_OUT ARCH=arm64 -j6 CROSS_COMPILE=$PREFIX_CROSS_COMPILE modules Image.gz + +cp $KERNEL_OUT/arch/arm64/boot/Image.gz out/target/product/p230/kernel + +if [ "$2" != "m" ]; then + make -C common O=../$KERNEL_OUT gxl_p230_2g.dtb ARCH=arm64 CROSS_COMPILE=$PREFIX_CROSS_COMPILE + cp -f $KERNEL_OUT/arch/arm64/boot/dts/amlogic/gxl_p230_2g.dtb out/target/product/p230/dtb.img +fi + +if [ "$2" != "m" ]; then + out/host/linux-x86/bin/mkbootimg --kernel common/../$KERNEL_OUT/arch/arm64/boot/Image.gz \ + --base 0x0 \ + --kernel_offset 0x1080000 \ + --ramdisk ${ROOTFS} \ + --second out/target/product/p230/dtb.img \ + --output ./out/target/product/p230/boot.img + ls -l ./out/target/product/p230/boot.img + echo "boot.img done" +fi |