From b6590d35c3c7a2f67b373a6cb6d235602eed9569 Mon Sep 17 00:00:00 2001 From: Hoegeun Kwon Date: Wed, 10 Jun 2020 20:04:00 +0900 Subject: [PATCH] scripts: mkbootimg_rpi4.sh: Add support make boot image for arm64 Support make boot image for arm64. Change-Id: I2cb18a0a383fff21c2f158473a51339b1867338a Signed-off-by: Hoegeun Kwon --- scripts/mkbootimg_rpi4.sh | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/scripts/mkbootimg_rpi4.sh b/scripts/mkbootimg_rpi4.sh index 42d0443..5fbf319 100755 --- a/scripts/mkbootimg_rpi4.sh +++ b/scripts/mkbootimg_rpi4.sh @@ -3,6 +3,7 @@ BOOT_PATH="rpi4/boot" USER_ID=`id -u` GROUP_ID=`id -g` +IS_64BIT=`cat .config | grep CONFIG_64BIT` rm -f boot.img rm -rf tmp @@ -12,26 +13,40 @@ mkdir tmp mkfs.vfat -F 16 -C -n BOOT boot.img 65536 sudo mount -o loop,uid=$USER_ID,gid=$GROUP_ID,showexec boot.img ./tmp -cp -a $BOOT_PATH/config.txt ./tmp +if [ -n "$IS_64BIT" ]; then + echo "Create 64bit boot image" + cp -a $BOOT_PATH/config_64bit.txt ./tmp/config.txt +else + echo "Create 32bit boot image" + cp -a $BOOT_PATH/config.txt ./tmp +fi cp -a $BOOT_PATH/LICENCE.broadcom ./tmp cp -a $BOOT_PATH/start*.elf ./tmp cp -a $BOOT_PATH/fixup*.dat ./tmp -cp -a arch/arm/boot/zImage ./tmp -cp -a arch/arm/boot/dts/bcm*.dtb ./tmp +if [ -n "$IS_64BIT" ]; then + cp -a arch/arm64/boot/Image ./tmp + cp -a arch/arm64/boot/dts/broadcom/bcm*.dtb ./tmp +else + cp -a arch/arm/boot/zImage ./tmp + cp -a arch/arm/boot/dts/bcm*.dtb ./tmp +fi # install u-boot files extracted from u-boot-rpi4 rpm package in download.tizen.org. TMP_UBOOT_PATH=tmp_uboot mkdir -p ${TMP_UBOOT_PATH} pushd ${TMP_UBOOT_PATH} -REPO_URL=http://download.tizen.org/snapshots/tizen/unified/latest/repos/standard/packages/armv7l/ +if [ -n "$IS_64BIT" ]; then + REPO_URL=http://download.tizen.org/snapshots/tizen/unified/latest/repos/standard/packages/aarch64/ +else + REPO_URL=http://download.tizen.org/snapshots/tizen/unified/latest/repos/standard/packages/armv7l/ +fi rm -f index.html* wget ${REPO_URL} UBOOT=`awk -F\" '{ print $2 }' index.html | grep u-boot-rpi4` wget ${REPO_URL}${UBOOT} unrpm ${UBOOT} - -# install u-boot.img having optee.bin extracted from atf-rpi4 rpm package in download.tizen.org. popd + cp -a ${TMP_UBOOT_PATH}/boot/* ./tmp rm -rf ${TMP_UBOOT_PATH} @@ -46,8 +61,14 @@ mkdir -p tmp_modules dd if=/dev/zero of=modules.img bs=1024 count=20480 mkfs.ext4 -q -F -t ext4 -b 1024 -L modules modules.img sudo mount -o loop modules.img ./tmp/lib/modules - -make modules_install ARCH=arm INSTALL_MOD_PATH=./tmp_modules INSTALL_MOD_STRIP=1 CROSS_COMPILE=arm-linux-gnueabi- +if [ -n "$IS_64BIT" ]; then + export ARCH=arm64 + export CROSS_COMPILE=aarch64-linux-gnu- +else + export ARCH=arm + export CROSS_COMPILE=arm-linux-gnueabi- +fi +make modules_install INSTALL_MOD_PATH=./tmp_modules INSTALL_MOD_STRIP=1 sudo mv ./tmp_modules/lib/modules/* ./tmp/lib/modules sudo -n chown root:root ./tmp/lib/modules -R @@ -59,7 +80,11 @@ rm -rf tmp tmp_modules # Create boot tarball for the lthor flashing DATE=`date +%Y%m%d` -BOOT_TARBALL=tizen-local-${DATE}-boot-armv7l-rpi4.tar +if [ -n "$IS_64BIT" ]; then + BOOT_TARBALL=tizen-local-${DATE}-boot-arm64-rpi4.tar +else + BOOT_TARBALL=tizen-local-${DATE}-boot-armv7l-rpi4.tar +fi tar cf ${BOOT_TARBALL} boot.img modules.img if [ "$?" != "0" ]; then -- 2.7.4