diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-23 01:01:32 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-23 01:01:32 +0000 |
commit | ca2a5365af0260e02e2184ffaa6e98d9338e6ddd (patch) | |
tree | bdc346889f77bf17918688727ddc16de4e80a1d6 | |
parent | 8bc559de4b85bdd345086ef81601ca7a6681a7a1 (diff) | |
parent | fecf1d099d9d01b2f9107c68cc3811ccc80bbfcd (diff) | |
download | hikey-ca2a5365af0260e02e2184ffaa6e98d9338e6ddd.tar.gz |
Snap for 7306623 from fecf1d099d9d01b2f9107c68cc3811ccc80bbfcd to sc-releaseandroid-vts-12.0_r9android-vts-12.0_r8android-vts-12.0_r7android-vts-12.0_r6android-vts-12.0_r5android-vts-12.0_r4android-vts-12.0_r3android-vts-12.0_r2android-vts-12.0_r12android-vts-12.0_r11android-vts-12.0_r10android-vts-12.0_r1android-security-12.0.0_r59android-security-12.0.0_r58android-security-12.0.0_r57android-security-12.0.0_r56android-security-12.0.0_r55android-security-12.0.0_r54android-security-12.0.0_r53android-security-12.0.0_r52android-security-12.0.0_r51android-security-12.0.0_r50android-security-12.0.0_r49android-security-12.0.0_r48android-security-12.0.0_r47android-security-12.0.0_r46android-security-12.0.0_r45android-security-12.0.0_r44android-security-12.0.0_r43android-security-12.0.0_r42android-security-12.0.0_r41android-security-12.0.0_r40android-security-12.0.0_r39android-security-12.0.0_r38android-security-12.0.0_r37android-security-12.0.0_r36android-security-12.0.0_r35android-security-12.0.0_r34android-platform-12.0.0_r9android-platform-12.0.0_r8android-platform-12.0.0_r7android-platform-12.0.0_r6android-platform-12.0.0_r5android-platform-12.0.0_r4android-platform-12.0.0_r31android-platform-12.0.0_r30android-platform-12.0.0_r3android-platform-12.0.0_r29android-platform-12.0.0_r28android-platform-12.0.0_r27android-platform-12.0.0_r26android-platform-12.0.0_r25android-platform-12.0.0_r24android-platform-12.0.0_r23android-platform-12.0.0_r22android-platform-12.0.0_r21android-platform-12.0.0_r20android-platform-12.0.0_r2android-platform-12.0.0_r19android-platform-12.0.0_r18android-platform-12.0.0_r17android-platform-12.0.0_r16android-platform-12.0.0_r15android-platform-12.0.0_r14android-platform-12.0.0_r13android-platform-12.0.0_r12android-platform-12.0.0_r11android-platform-12.0.0_r10android-platform-12.0.0_r1android-cts-12.0_r9android-cts-12.0_r8android-cts-12.0_r7android-cts-12.0_r6android-cts-12.0_r5android-cts-12.0_r4android-cts-12.0_r3android-cts-12.0_r2android-cts-12.0_r12android-cts-12.0_r11android-cts-12.0_r10android-cts-12.0_r1android-12.0.0_r9android-12.0.0_r8android-12.0.0_r34android-12.0.0_r33android-12.0.0_r31android-12.0.0_r30android-12.0.0_r3android-12.0.0_r25android-12.0.0_r2android-12.0.0_r11android-12.0.0_r10android-12.0.0_r1android12-tests-releaseandroid12-security-releaseandroid12-s5-releaseandroid12-s4-releaseandroid12-s3-releaseandroid12-s2-releaseandroid12-s1-releaseandroid12-releaseandroid12-platform-release
Change-Id: I632c86daffbf3a4c0f2721a76c0433c51a7705da
-rwxr-xr-x | installer/hikey960/flash-all.sh | 75 | ||||
-rwxr-xr-x | installer/hikey960/legacy-flash-all.sh | 30 | ||||
-rwxr-xr-x | installer/hikey960/uefi-flash-all.sh | 74 |
3 files changed, 91 insertions, 88 deletions
diff --git a/installer/hikey960/flash-all.sh b/installer/hikey960/flash-all.sh index 3f8bf9b4..72112ff8 100755 --- a/installer/hikey960/flash-all.sh +++ b/installer/hikey960/flash-all.sh @@ -1,6 +1,7 @@ #!/bin/bash INSTALLER_DIR="`dirname ${0}`" +ECHO_PREFIX="=== " # for cases that don't run "lunch hikey960-userdebug" if [ -z "${ANDROID_BUILD_TOP}" ]; then @@ -9,22 +10,66 @@ if [ -z "${ANDROID_BUILD_TOP}" ]; then fi if [ ! -d "${ANDROID_PRODUCT_OUT}" ]; then - echo "error in locating out directory, check if it exist" + echo ${ECHO_PREFIX}"error in locating out directory, check if it exist" exit fi -echo "android out dir:${ANDROID_PRODUCT_OUT}" - -fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img -fastboot flash ptable "${INSTALLER_DIR}"/hisi-ptable.img -fastboot flash fastboot "${INSTALLER_DIR}"/hisi-fastboot.img -fastboot reboot-bootloader -fastboot flash nvme "${INSTALLER_DIR}"/hisi-nvme.img -fastboot flash fw_lpm3 "${INSTALLER_DIR}"/hisi-lpm3.img -fastboot flash trustfirmware "${INSTALLER_DIR}"/hisi-bl31.bin -fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img -fastboot flash dts "${ANDROID_PRODUCT_OUT}"/dt.img -fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img -fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img -fastboot format:ext4:10000000 cache +echo ${ECHO_PREFIX}"android out dir:${ANDROID_PRODUCT_OUT}" + +function check_partition_table_version () { + fastboot erase reserved + if [ $? -eq 0 ] + then + IS_PTABLE_1MB_ALIGNED=true + else + IS_PTABLE_1MB_ALIGNED=false + fi +} + +function flashing_atf_uefi () { + fastboot flash ptable "${INSTALLER_DIR}"/prm_ptable.img + fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img + fastboot reboot-bootloader + + fastboot flash fastboot "${INSTALLER_DIR}"/l-loader.bin + fastboot flash fip "${INSTALLER_DIR}"/fip.bin + fastboot flash nvme "${INSTALLER_DIR}"/hisi-nvme.img + fastboot flash fw_lpm3 "${INSTALLER_DIR}"/hisi-lpm3.img + fastboot flash trustfirmware "${INSTALLER_DIR}"/hisi-bl31.bin + fastboot reboot-bootloader + + fastboot flash ptable "${INSTALLER_DIR}"/prm_ptable.img + fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img + fastboot flash fastboot "${INSTALLER_DIR}"/l-loader.bin + fastboot flash fip "${INSTALLER_DIR}"/fip.bin + + fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img + fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img +# fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img + fastboot format cache +} + +function upgrading_ptable_1mb_aligned () { + fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img + fastboot flash ptable "${INSTALLER_DIR}"/hisi-ptable.img + fastboot flash fastboot "${INSTALLER_DIR}"/hisi-fastboot.img + fastboot reboot-bootloader +} + +echo ${ECHO_PREFIX}"Checking partition table version..." +check_partition_table_version + +if [ "${IS_PTABLE_1MB_ALIGNED}" == "true" ] +then + echo ${ECHO_PREFIX}"Partition table is 1MB aligned. Flashing ATF/UEFI..." + flashing_atf_uefi +else + echo ${ECHO_PREFIX}"Partition table is 512KB aligned." + echo ${ECHO_PREFIX}"Upgrading to 1MB aligned version..." + upgrading_ptable_1mb_aligned + echo ${ECHO_PREFIX}"Flashing ATF/UEFI..." + flashing_atf_uefi + echo ${ECHO_PREFIX}"Done" +fi + fastboot reboot diff --git a/installer/hikey960/legacy-flash-all.sh b/installer/hikey960/legacy-flash-all.sh new file mode 100755 index 00000000..3f8bf9b4 --- /dev/null +++ b/installer/hikey960/legacy-flash-all.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +INSTALLER_DIR="`dirname ${0}`" + +# for cases that don't run "lunch hikey960-userdebug" +if [ -z "${ANDROID_BUILD_TOP}" ]; then + ANDROID_BUILD_TOP=${INSTALLER_DIR}/../../../../../ + ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/hikey960" +fi + +if [ ! -d "${ANDROID_PRODUCT_OUT}" ]; then + echo "error in locating out directory, check if it exist" + exit +fi + +echo "android out dir:${ANDROID_PRODUCT_OUT}" + +fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img +fastboot flash ptable "${INSTALLER_DIR}"/hisi-ptable.img +fastboot flash fastboot "${INSTALLER_DIR}"/hisi-fastboot.img +fastboot reboot-bootloader +fastboot flash nvme "${INSTALLER_DIR}"/hisi-nvme.img +fastboot flash fw_lpm3 "${INSTALLER_DIR}"/hisi-lpm3.img +fastboot flash trustfirmware "${INSTALLER_DIR}"/hisi-bl31.bin +fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img +fastboot flash dts "${ANDROID_PRODUCT_OUT}"/dt.img +fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img +fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img +fastboot format:ext4:10000000 cache +fastboot reboot diff --git a/installer/hikey960/uefi-flash-all.sh b/installer/hikey960/uefi-flash-all.sh index c2f06aff..347b5b28 100755 --- a/installer/hikey960/uefi-flash-all.sh +++ b/installer/hikey960/uefi-flash-all.sh @@ -1,75 +1,3 @@ #!/bin/bash - INSTALLER_DIR="`dirname ${0}`" -ECHO_PREFIX="=== " - -# for cases that don't run "lunch hikey960-userdebug" -if [ -z "${ANDROID_BUILD_TOP}" ]; then - ANDROID_BUILD_TOP=${INSTALLER_DIR}/../../../../../ - ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/hikey960" -fi - -if [ ! -d "${ANDROID_PRODUCT_OUT}" ]; then - echo ${ECHO_PREFIX}"error in locating out directory, check if it exist" - exit -fi - -echo ${ECHO_PREFIX}"android out dir:${ANDROID_PRODUCT_OUT}" - -function check_partition_table_version () { - fastboot erase reserved - if [ $? -eq 0 ] - then - IS_PTABLE_1MB_ALIGNED=true - else - IS_PTABLE_1MB_ALIGNED=false - fi -} - -function flashing_atf_uefi () { - fastboot flash ptable "${INSTALLER_DIR}"/prm_ptable.img - fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img - fastboot reboot-bootloader - - fastboot flash fastboot "${INSTALLER_DIR}"/l-loader.bin - fastboot flash fip "${INSTALLER_DIR}"/fip.bin - fastboot flash nvme "${INSTALLER_DIR}"/hisi-nvme.img - fastboot flash fw_lpm3 "${INSTALLER_DIR}"/hisi-lpm3.img - fastboot flash trustfirmware "${INSTALLER_DIR}"/hisi-bl31.bin - fastboot reboot-bootloader - - fastboot flash ptable "${INSTALLER_DIR}"/prm_ptable.img - fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img - fastboot flash fastboot "${INSTALLER_DIR}"/l-loader.bin - fastboot flash fip "${INSTALLER_DIR}"/fip.bin - - fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img - fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img - fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img - fastboot format cache -} - -function upgrading_ptable_1mb_aligned () { - fastboot flash xloader "${INSTALLER_DIR}"/hisi-sec_xloader.img - fastboot flash ptable "${INSTALLER_DIR}"/hisi-ptable.img - fastboot flash fastboot "${INSTALLER_DIR}"/hisi-fastboot.img - fastboot reboot-bootloader -} - -echo ${ECHO_PREFIX}"Checking partition table version..." -check_partition_table_version - -if [ "${IS_PTABLE_1MB_ALIGNED}" == "true" ] -then - echo ${ECHO_PREFIX}"Partition table is 1MB aligned. Flashing ATF/UEFI..." - flashing_atf_uefi -else - echo ${ECHO_PREFIX}"Partition table is 512KB aligned." - echo ${ECHO_PREFIX}"Upgrading to 1MB aligned version..." - upgrading_ptable_1mb_aligned - echo ${ECHO_PREFIX}"Flasing ATF/UEFI..." - flashing_atf_uefi - echo ${ECHO_PREFIX}"Done" -fi - -fastboot reboot +${INSTALLER_DIR}/flash-all.sh |