From 2a0356510ac1e995b8d9841b45de3b7304b229bc Mon Sep 17 00:00:00 2001 From: Hoegeun Kwon Date: Thu, 16 May 2019 14:32:14 +0900 Subject: [PATCH] scripts: mkbootimg_rpi3.sh: Support 32bit boot image. Support 32bit boot image, and add rule that check the bit between 32 and 64bit as '.config' file. Change-Id: I247583233eb617c3f7f1695d8c5060d27934bcdd Signed-off-by: Hoegeun Kwon --- scripts/mkbootimg_rpi3.sh | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/scripts/mkbootimg_rpi3.sh b/scripts/mkbootimg_rpi3.sh index 106e98a..490d7d8 100755 --- a/scripts/mkbootimg_rpi3.sh +++ b/scripts/mkbootimg_rpi3.sh @@ -3,6 +3,7 @@ BOOT_PATH="rpi3/boot" USER_ID=`id -u` GROUP_ID=`id -g` +IS_64BIT=`cat .config | grep CONFIG_64BIT` rm -f boot.img rm -rf tmp @@ -11,19 +12,34 @@ mkdir tmp # Create boot.img 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_64bit.txt ./tmp/config.txt +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_32bit.txt ./tmp/config.txt +fi cp -a $BOOT_PATH/LICENCE.broadcom ./tmp cp -a $BOOT_PATH/bootcode.bin ./tmp cp -a $BOOT_PATH/start*.elf ./tmp cp -a $BOOT_PATH/fixup*.dat ./tmp -cp -a arch/arm64/boot/Image ./tmp -cp -a arch/arm64/boot/dts/broadcom/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-rpi3 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/aarch64/ +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-rpi3` @@ -31,9 +47,11 @@ wget ${REPO_URL}${UBOOT} unrpm ${UBOOT} # install u-boot.img having optee.bin extracted from atf-rpi3 rpm package in download.tizen.org. -ATF=`awk -F\" '{ print $2 }' index.html | grep atf-rpi3` -wget ${REPO_URL}${ATF} -unrpm ${ATF} +if [ -n "$IS_64BIT" ]; then + ATF=`awk -F\" '{ print $2 }' index.html | grep atf-rpi3` + wget ${REPO_URL}${ATF} + unrpm ${ATF} +fi popd cp -a ${TMP_UBOOT_PATH}/boot/* ./tmp @@ -49,7 +67,11 @@ mkdir -p tmp/lib/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 -sudo make modules_install ARCH=arm64 INSTALL_MOD_PATH=./tmp INSTALL_MOD_STRIP=1 CROSS_COMPILE=aarch64-linux-gnu- +if [ -n "$IS_64BIT" ]; then + sudo make modules_install ARCH=arm64 INSTALL_MOD_PATH=./tmp INSTALL_MOD_STRIP=1 CROSS_COMPILE=aarch64-linux-gnu- +else + sudo make modules_install ARCH=arm INSTALL_MOD_PATH=./tmp INSTALL_MOD_STRIP=1 CROSS_COMPILE=arm-linux-gnueabi- +fi sudo -n chown root:root ./tmp/lib/modules -R sync -- 2.7.4