summaryrefslogtreecommitdiff
authorXindong Xu <xindong.xu@amlogic.com>2018-01-29 10:32:34 (GMT)
committer Xindong Xu <xindong.xu@amlogic.com>2018-02-01 05:24:27 (GMT)
commit4b80c4c1c86c060f07f1b984d1ef3f48ca733e61 (patch)
tree2d7c95f58d124462fc4f45bdf7ab8b2c668c8ad4
parentf826e9b110fa70c5b5a2e70b2220353b2eb51272 (diff)
downloadcommon-4b80c4c1c86c060f07f1b984d1ef3f48ca733e61.zip
common-4b80c4c1c86c060f07f1b984d1ef3f48ca733e61.tar.gz
common-4b80c4c1c86c060f07f1b984d1ef3f48ca733e61.tar.bz2
fastboot: add flash-all.sh & flash-all.bat [1/1]
PD# 159844 add flash-all.sh & flash-all.bat Change-Id: I4bed79113c19589194f8b2804d105aa3e96004ef
Diffstat
-rw-r--r--factory.mk34
-rwxr-xr-xflash-all.bat29
-rwxr-xr-xflash-all.sh25
3 files changed, 81 insertions, 7 deletions
diff --git a/factory.mk b/factory.mk
index 16ea378..5bde894 100644
--- a/factory.mk
+++ b/factory.mk
@@ -276,15 +276,18 @@ else
INSTALLED_AML_UPGRADE_PACKAGE_TARGET :=
endif
-INSTALLED_AML_FASTBOOT_ZIP := $(PRODUCT_OUT)/$(TARGET_PRODUCT)-fastboot-$(BUILD_NUMBER).zip
+INSTALLED_AML_FASTBOOT_ZIP := $(PRODUCT_OUT)/$(TARGET_PRODUCT)-fastboot-image-$(BUILD_NUMBER).zip
-FASTBOOT_IMAGES := android-info.txt system.img
-ifeq ($(TARGET_NO_RECOVERY),true)
-FASTBOOT_IMAGES += boot.img
-else
-FASTBOOT_IMAGES += boot.img recovery.img
+FASTBOOT_IMAGES := boot.img
+ifneq ($(TARGET_NO_RECOVERY),true)
+ FASTBOOT_IMAGES += recovery.img
endif
+ifeq ($(PRODUCT_BUILD_SECURE_BOOT_IMAGE_DIRECTLY),true)
+ FASTBOOT_IMAGES := $(addsuffix .encrypt, $(FASTBOOT_IMAGES))
+endif#ifeq ($(PRODUCT_BUILD_SECURE_BOOT_IMAGE_DIRECTLY),true)
+
+FASTBOOT_IMAGES += android-info.txt system.img
ifneq ($(BOARD_OLD_PARTITION),true)
FASTBOOT_IMAGES += vendor.img
@@ -311,7 +314,24 @@ endif
ifeq ($(TARGET_PRODUCT),darwin)
echo "board=txlx_skt" > $(PRODUCT_OUT)/fastboot/android-info.txt
endif
- cd $(PRODUCT_OUT)/fastboot; zip -r ../$(TARGET_PRODUCT)-fastboot-$(BUILD_NUMBER).zip $(FASTBOOT_IMAGES)
+ cd $(PRODUCT_OUT)/fastboot; zip -r ../$(TARGET_PRODUCT)-fastboot-image-$(BUILD_NUMBER).zip $(FASTBOOT_IMAGES)
+ zipnote $@ | sed 's/@ \([a-z]*.img\).encrypt/&\n@=\1\n/' | zipnote -w $@
+ mkdir -p $(PRODUCT_OUT)/fastboot_auto
+ cp $(PRODUCT_OUT)/$(TARGET_PRODUCT)-fastboot-image-$(BUILD_NUMBER).zip $(PRODUCT_OUT)/fastboot_auto/
+ifeq ($(PRODUCT_BUILD_SECURE_BOOT_IMAGE_DIRECTLY),true)
+ cp $(PRODUCT_OUT)/u-boot.bin.encrypt $(PRODUCT_OUT)/fastboot_auto/
+ cp $(PRODUCT_OUT)/dtb.img.encrypt $(PRODUCT_OUT)/fastboot_auto/
+else
+ cp $(PRODUCT_OUT)/u-boot.bin $(PRODUCT_OUT)/fastboot_auto/
+ cp $(PRODUCT_OUT)/dtb.img $(PRODUCT_OUT)/fastboot_auto/
+endif
+ cp $(PRODUCT_OUT)/odm.img $(PRODUCT_OUT)/fastboot_auto/
+ cp $(PRODUCT_OUT)/upgrade/logo.img $(PRODUCT_OUT)/fastboot_auto/
+ cp device/amlogic/common/flash-all.sh $(PRODUCT_OUT)/fastboot_auto/
+ cp device/amlogic/common/flash-all.bat $(PRODUCT_OUT)/fastboot_auto/
+ sed -i 's/fastboot -w update fastboot.zip/fastboot -w update $(TARGET_PRODUCT)-fastboot-image-$(BUILD_NUMBER).zip/' $(PRODUCT_OUT)/fastboot_auto/flash-all.sh
+ sed -i 's/fastboot -w update fastboot.zip/fastboot -w update $(TARGET_PRODUCT)-fastboot-image-$(BUILD_NUMBER).zip/' $(PRODUCT_OUT)/fastboot_auto/flash-all.bat
+ cd $(PRODUCT_OUT)/fastboot_auto; zip -r ../$(TARGET_PRODUCT)-fastboot-$(BUILD_NUMBER).zip *
droidcore: $(INSTALLED_AML_UPGRADE_PACKAGE_TARGET) $(INSTALLED_MANIFEST_XML) $(INSTALLED_AML_FASTBOOT_ZIP)
otapackage: $(INSTALLED_AML_UPGRADE_PACKAGE_TARGET) $(INSTALLED_MANIFEST_XML) $(INSTALLED_AML_FASTBOOT_ZIP)
diff --git a/flash-all.bat b/flash-all.bat
new file mode 100755
index 0000000..f6b6b66
--- a/dev/null
+++ b/flash-all.bat
@@ -0,0 +1,29 @@
+@ECHO OFF
+:: Copyright 2012 The Android Open Source Project
+::
+:: 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.
+
+PATH=%PATH%;"%SYSTEMROOT%\System32"
+fastboot flash _aml_dtb dtb.img
+fastboot flash bootloader u-boot.bin
+fastboot reboot-bootloader
+ping -n 5 127.0.0.1 >nul
+fastboot flash odm odm.img
+fastboot flash logo logo.img
+fastboot reboot-bootloader
+ping -n 5 127.0.0.1 >nul
+fastboot -w update fastboot.zip
+
+echo Press any key to exit...
+pause >nul
+exit
diff --git a/flash-all.sh b/flash-all.sh
new file mode 100755
index 0000000..5b2eedd
--- a/dev/null
+++ b/flash-all.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Copyright 2012 The Android Open Source Project
+#
+# 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.
+
+fastboot flash _aml_dtb dtb.img
+fastboot flash bootloader u-boot.bin
+fastboot reboot-bootloader
+sleep 5
+fastboot flash odm odm.img
+fastboot flash logo logo.img
+fastboot reboot-bootloader
+sleep 5
+fastboot -w update fastboot.zip