Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75c69561 authored by Rohit Sekhar's avatar Rohit Sekhar
Browse files

GS290: Update installation procedure for Linux and Windows

* Modify flash-script for windows and linux (To be compatible with newer images having firmware)
* Modify error codes to match the new script
* Add appropriate translation for newly added errors
parent 04c3f915
Loading
Loading
Loading
Loading
+103 −15
Original line number Diff line number Diff line
@@ -27,11 +27,22 @@
# - 1 : generic error
# - 10: can't unpack system.img
# - 11: can't wipe data
# - 12: can't flash boot
# - 13: can't flash recovery
# - 14: can't flash system
# - 15: can't flash lk
# - 16: can't flash logo
# - 12: can't flash system
# - 13: can't flash vendor
# - 14: can't flash boot
# - 15: can't flash dtbo
# - 16: can't flash recovery
# - 17: can't flash logo
# - 18: can't flash md1dsp
# - 19: can't flash md1img
# - 20: can't flash spmfw
# - 21: can't flash lk
# - 22: can't flash lk2
# - 23: can't flash sspm_1
# - 24: can't flash sspm_2
# - 25: can't flash tee1
# - 26: can't flash tee2
# - 27: can't flash preloader
# - 101 : DEVICE_ID missing
# - 102 : ARCHIVE_PATH missing
# - 103 : fastboot folder path missing
@@ -97,37 +108,114 @@ echo "user data wiped"
sleep 5

# Flash the device
if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash --disable-verity --disable-verification boot boot.img
if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash system system.img
then
  exit 12
fi
sleep 1
echo "Flashed boot"
echo "Flashed system"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash recovery recovery-e-latest-GS290.img
if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash vendor vendor-sparsed.img
then
  exit 13
fi
sleep 1
echo "Flashed recovery"
echo "Flashed vendor"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash system system.img
if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash boot boot.img
then
  exit 14
fi
sleep 1
echo "Flashed system"
echo "Flashed boot"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash lk lk.img
if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash dtbo dtbo.img
then
  exit 15
fi
sleep 1
echo "Flashed lk"
echo "Flashed dtbo"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash logo logo.bin
if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash recovery recovery.img
then
  exit 16
fi
sleep 1
echo "Flashed recovery"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash logo logo.img
then
  exit 17
fi
sleep 1
echo "Flashed logo"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash md1dsp md1dsp.img
then
  exit 18
fi
sleep 1
echo "Flashed md1dsp"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash md1img md1img.img
then
  exit 19
fi
sleep 1
echo "Flashed md1img"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash spmfw spmfw.img
then
  exit 20
fi
sleep 1
echo "Flashed spmfw"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash lk lk.img
then
  exit 21
fi
sleep 1
echo "Flashed lk"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash lk2 lk.img
then
  exit 22
fi
sleep 1
echo "Flashed lk2"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash sspm_1 sspm.img
then
  exit 23
fi
sleep 1
echo "Flashed sspm_1"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash sspm_2 sspm.img
then
  exit 24
fi
sleep 1
echo "Flashed sspm_2"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash tee1 tee.img
then
  exit 25
fi
sleep 1
echo "Flashed tee1"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash tee2 tee.img
then
  exit 26
fi
sleep 1
echo "Flashed tee2"

if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flash preloader preloader.img
then
  exit 27
fi
sleep 1
echo "Flashed preloader"
+80 −23
Original line number Diff line number Diff line
@@ -25,11 +25,22 @@
:: - 1 : generic error
:: - 10: can't unpack system.img
:: - 11: can't wipe data
:: - 12: can't flash boot
:: - 13: can't flash recovery
:: - 14: can't flash system
:: - 15: can't flash lk
:: - 16: can't flash logo
:: - 12: can't flash system
:: - 13: can't flash vendor
:: - 14: can't flash boot
:: - 15: can't flash dtbo
:: - 16: can't flash recovery
:: - 17: can't flash logo
:: - 18: can't flash md1dsp
:: - 19: can't flash md1img
:: - 20: can't flash spmfw
:: - 21: can't flash lk
:: - 22: can't flash lk2
:: - 23: can't flash sspm_1
:: - 24: can't flash sspm_2
:: - 25: can't flash tee1
:: - 26: can't flash tee2
:: - 27: can't flash preloader
:: - 101 : DEVICE_ID missing
:: - 102 : ARCHIVE_PATH missing
:: - 103 : fastboot folder path missing
@@ -66,51 +77,97 @@ for %%a in ("%ARCHIVE_PATH%") do (
	set ARCHIVE_FOLDER_PATH=%%~dpa"
	echo %ARCHIVE_FOLDER_PATH%
)
:: unzip for system.img
:: unzip all images
cd "%ARCHIVE_FOLDER_PATH%"

%JAR_PATH% -x -v -f "%ARCHIVE_PATH%"
if errorLevel 1 ( exit /b 10 )

echo "unpacked archive"

timeout 1 >nul 2>&1

%FASTBOOT_PATH% -w
if errorLevel 1 ( exit /b 11 )

echo "user data wiped"

timeout 5 >nul 2>&1

%FASTBOOT_PATH% -s %DEVICE_ID% flash --disable-verity --disable-verification boot boot.img
:: Flash the device
%FASTBOOT_PATH% -s %DEVICE_ID% flash system system.img
if errorLevel 1 ( exit /b 12 )
timeout 1 >nul 2>&1
echo "Flashed system"

%FASTBOOT_PATH% -s %DEVICE_ID% flash vendor vendor-sparsed.img
if errorLevel 1 ( exit /b 13 )
timeout 1 >nul 2>&1
echo "Flashed vendor"

%FASTBOOT_PATH% -s %DEVICE_ID% flash boot boot.img
if errorLevel 1 ( exit /b 14 )
timeout 1 >nul 2>&1
echo "Flashed boot"

%FASTBOOT_PATH% -s %DEVICE_ID% flash recovery recovery-e-latest-GS290.img
if errorLevel 1 ( exit /b 13 )
%FASTBOOT_PATH% -s %DEVICE_ID% flash dtbo dtbo.img
if errorLevel 1 ( exit /b 15 )
timeout 1 >nul 2>&1
echo "Flashed dtbo"

%FASTBOOT_PATH% -s %DEVICE_ID% flash recovery recovery.img
if errorLevel 1 ( exit /b 16 )
timeout 1 >nul 2>&1
echo "Flashed recovery"

%FASTBOOT_PATH% -s %DEVICE_ID% flash system system.img
if errorLevel 1 ( exit /b 14 )
%FASTBOOT_PATH% -s %DEVICE_ID% flash logo logo.img
if errorLevel 1 ( exit /b 17 )
timeout 1 >nul 2>&1
echo "Flashed logo"

%FASTBOOT_PATH% -s %DEVICE_ID% flash md1dsp md1dsp.img
if errorLevel 1 ( exit /b 18 )
timeout 1 >nul 2>&1
echo "Flashed system"
echo "Flashed md1dsp"

%FASTBOOT_PATH% -s %DEVICE_ID% flash lk lk.img
if errorLevel 1 ( exit /b 15 )
%FASTBOOT_PATH% -s %DEVICE_ID% flash md1img md1img.img
if errorLevel 1 ( exit /b 19 )
timeout 1 >nul 2>&1
echo "Flashed md1img"

%FASTBOOT_PATH% -s %DEVICE_ID% flash spmfw spmfw.img
if errorLevel 1 ( exit /b 20 )
timeout 1 >nul 2>&1
echo "Flashed spmfw"

%FASTBOOT_PATH% -s %DEVICE_ID% flash lk lk.img
if errorLevel 1 ( exit /b 21 )
timeout 1 >nul 2>&1
echo "Flashed lk"

%FASTBOOT_PATH% -s %DEVICE_ID% flash logo logo.bin
if errorLevel 1 ( exit /b 16 )
%FASTBOOT_PATH% -s %DEVICE_ID% flash lk2 lk.img
if errorLevel 1 ( exit /b 22 )
timeout 1 >nul 2>&1
echo "Flashed lk2"

%FASTBOOT_PATH% -s %DEVICE_ID% flash sspm_1 sspm.img
if errorLevel 1 ( exit /b 23 )
timeout 1 >nul 2>&1
echo "Flashed sspm_1"

%FASTBOOT_PATH% -s %DEVICE_ID% flash sspm_2 sspm.img
if errorLevel 1 ( exit /b 24 )
timeout 1 >nul 2>&1
echo "Flashed logo"
echo "Flashed sspm_2"

%FASTBOOT_PATH% -s %DEVICE_ID% flash tee1 tee.img
if errorLevel 1 ( exit /b 25 )
timeout 1 >nul 2>&1
echo "Flashed tee1"

%FASTBOOT_PATH% -s %DEVICE_ID% flash tee2 tee.img
if errorLevel 1 ( exit /b 26 )
timeout 1 >nul 2>&1
echo "Flashed tee2"

%FASTBOOT_PATH% -s %DEVICE_ID% flash preloader preloader.img
if errorLevel 1 ( exit /b 27 )
timeout 1 >nul 2>&1
echo "Flashed preloader"

exit /b 0
+13 −1
Original line number Diff line number Diff line
@@ -230,15 +230,27 @@ script_error_cantRebootBootloader= Failed to reboot into bootloader
script_error_cantUnpackSources=Failed to unpack /e/ sources
script_error_cantWipeData=Failed to wipe data
script_error_cantFlashBoot=Failed to flash Boot partition
script_error_cantFlashDtbo=Failed to flash dtbo partition
script_error_cantFlashRecovery=Failed to flash Recovery
script_error_cantFlashLogo=Failed to flash logo partition
script_error_cantFlashMd1dsp=Failed to flash md1dsp partition
script_error_cantFlashMd1img=Failed to flash md1img partition
script_error_cantFlashSpmfw=Failed to flash spmfw partition
script_error_cantFlashLk=Failed to flash lk partition
script_error_cantFlashLk2=Failed to flash lk2 partition
script_error_cantFlashSspm_1=Failed to flash sspm_1 partition
script_error_cantFlashSspm_2=Failed to flash sspm_2 partition
script_error_cantFlashTee1=Failed to flash tee1 partition
script_error_cantFlashTee2=Failed to flash tee2 partition
script_error_cantFlashPreloader=Failed to flash preloader partition
script_error_cantFlashVbmeta=Failed to flash vb meta partition
script_error_cantFlashVbmeta_system=Failed to flash vb meta system partition
script_error_cantFlashVBmeta_vendor=Failed to flash vb Meta vendor partition
script_error_cantRebootToFastboot=Failed to reboot into fastboot mode
script_error_cantFlashSystem=Failed to flash system partition
script_error_cantFlashproduct=Failed to flash product partition 
script_error_cantFlashVendor=Failed to flash vendor partition
script_error_cantrebootFromFasboot= Failed to reboot from fastboot
script_error_cantRebootToFastboot=Failed to reboot into fastboot mode
java_error_unknow= The installation encounter an internal error
flash_process_cancelled=The installation process has been cancelled

+17 −6
Original line number Diff line number Diff line
@@ -101,11 +101,22 @@ steps:
          1: script_error_unknown
          10: script_error_cantUnpackSources
          11: script_error_cantWipeData
          12: script_error_cantFlashBoot
          13: script_error_cantFlashRecovery
          14: script_error_cantFlashsystem
          15: script_error_cantFlashLk
          16: script_error_cantFlashLogo
          12: script_error_cantFlashSystem
          13: script_error_cantFlashVendor
          14: script_error_cantFlashBoot
          15: script_error_cantFlashDtbo
          16: script_error_cantFlashRecovery
          17: script_error_cantFlashLogo
          18: script_error_cantFlashMd1dsp
          19: script_error_cantFlashMd1img
          20: script_error_cantFlashSpmfw
          21: script_error_cantFlashLk
          22: script_error_cantFlashLk2
          23: script_error_cantFlashSspm_1
          24: script_error_cantFlashSspm_2
          25: script_error_cantFlashTee1
          26: script_error_cantFlashTee2
          27: script_error_cantFlashPreloader
          101: script_error_serialNumber_missing
          102: script_error_installFromFastboot_102
          103: script_error_fastboot_path_missing