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

Commit 1bf85bc7 authored by Frank Preel's avatar Frank Preel
Browse files

Merge branch '431_432_434_Teracube' into 'master'

431 432 434 teracube

See merge request !183
parents 038c5f99 d8045984
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -46,7 +46,12 @@ developer:

## Changelogs

### v0.15.0 (candidate)
### v0.15.1 (candidate)
- 431 optionally lock bootloader after flashing
- 432 Check the path to the files in MSWindows
- 434 Easy Installer detect 2e as not compatible

### v0.15.0
- No shortcut created when installing from a non-admin account on Windows
- e-recovery assets
- Update German translation - by F. Wildermuth
+53 −0
Original line number Diff line number Diff line
#!/bin/bash

# Copyright (C) 2022 ECORP SAS - Author: Frank Preel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

# Parameter
# $1: device id
# $2: fastboot folder path

# Exit status
# - 0 : bootloader locked
# - 1 : unknown error
# - 2 : Flashing locked failed
# - 101 : $DEVICE_ID missing
# - 102 : $FASTBOOT_FOLDER_PATH is missing

DEVICE_ID=$1
FASTBOOT_FOLDER_PATH=$2

# check serial number has been provided
if [ -z "$DEVICE_ID" ]
then
  exit 101
fi

# Check fastboot parent folder path has been provided
if [ -z "$FASTBOOT_FOLDER_PATH" ]
then
  exit 102
fi

# Build fastboot path
FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"

# Lock bootloader
if ! ${FASTBOOT_PATH} flashing lock ;
then 
  exit 2
fi

sleep 1
+11 −8
Original line number Diff line number Diff line
@@ -27,15 +27,16 @@
# - 1 : generic error
# - 10: can't unpack system.img
# - 11: can't wipe userdata
# - 11: can't wipe metadata
# - 12: can't wipe metadata
# - 13: can't active partition
# - 20-30 : see partition_name index below
# - 101 : DEVICE_ID missing
# - 102 : ARCHIVE_PATH missing
# - 103 : fastboot folder path missing

partition_name=(gz_a lk_a md1img_a scp_a spmfw_a sspm_a tee_a boot_a dtbo_a vbmeta_a super)	
partition_image=(gz.img lk.img md1img.img scp.img spmfw.img sspm.img tee.img boot.img dtbo.img vbmeta.img super.img)
partition_error=(20 21 22 23 24 25 26 27 28 29 30)
partition_name=(boot_a dtbo_a vbmeta_a vbmeta_system_a vbmeta_vendor_a super lk_a logo preloader_a)	
partition_image=(boot.img dtbo.img vbmeta.img vbmeta_system.img vbmeta_vendor.img super.img lk.img logo-verified.bin preloader_yk673v6_lwg62_64.bin)
partition_error=(20 21 22 23 24 25 26 27 28)

DEVICE_ID=$1
ARCHIVE_PATH=$2
@@ -87,7 +88,6 @@ echo "unpacked archive"

sleep 1


# Wipe user data
if ! "$FASTBOOT_PATH" erase userdata ;
then 
@@ -97,12 +97,12 @@ fi
echo "user data wiped"
sleep 5

if ! "$FASTBOOT_PATH" erase metadata ;
if ! "$FASTBOOT_PATH" format md_udc ;
then 
  exit 12
fi

echo "meta data wiped"
echo "format md_udc"
sleep 5

#Flash partition
@@ -116,5 +116,8 @@ for i in ${!partition_name[@]}; do
done


"$FASTBOOT_PATH" --set-active=a
if ! "$FASTBOOT_PATH" --set-active=a ;
then 
  exit 13
fi
+47 −0
Original line number Diff line number Diff line
@echo off

:: Coyright (C) 2022 ECORP SAS - Author: Frank Preel

:: This program is free software: you can redistribute it and/or modify
:: it under the terms of the GNU General Public License as published by
:: the Free Software Foundation, either version 3 of the License, or
:: (at your option) any later version.

:: This program is distributed in the hope that it will be useful,
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
:: GNU General Public License for more details.

:: You should have received a copy of the GNU General Public License
:: along with this program.  If not, see <https://www.gnu.org/licenses/>.

:: Parameter
:: $1: device id
:: $2: fastboot folder path

:: Exit status
:: - 0 : bootloader locked
:: - 1 : unknown error
:: - 2 : Flashing unlocked failed
:: - 101 : $DEVICE_ID missing
:: - 102 : $FASTBOOT_FOLDER_PATH is missing


SET DEVICE_ID=%~1
SET FASTBOOT_FOLDER_PATH=%~2

IF not defined %DEVICE_ID (
  exit /b 101
)
IF not defined %FASTBOOT_FOLDER_PATH (
  exit /b 102
)

SET FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
%FASTBOOT_PATH% -s %DEVICE_ID% flashing lock
if errorlevel 1 ( 
	exit /b 2 
)

timeout 1 >nul 2>&1
exit /b 0
+27 −29
Original line number Diff line number Diff line
@@ -27,35 +27,32 @@
:: - 1 : generic error
:: - 10: can't unpack system.img
:: - 11: can't wipe userdata
:: - 11: can't wipe metadata
:: - 12: can't wipe metadata
:: - 13: can't active partition
:: - 20-30 : see partition_name index below
:: - 101 : DEVICE_ID missing
:: - 102 : ARCHIVE_PATH missing
:: - 103 : fastboot folder path missing

SET partition_name[0]=gz_a 
SET partition_name[1]=lk_a 
SET partition_name[2]=md1img_a 
SET partition_name[3]=scp_a 
SET partition_name[4]=spmfw_a 
SET partition_name[5]=sspm_a 
SET partition_name[6]=tee_a 
SET partition_name[7]=boot_a 
SET partition_name[8]=dtbo_a 
SET partition_name[9]=vbmeta_a 
SET partition_name[10]=super

SET partition_image[0]=gz.img 
SET partition_image[1]=lk.img 
SET partition_image[2]=md1img.img 
SET partition_image[3]=scp.img 
SET partition_image[4]=spmfw.img 
SET partition_image[5]=sspm.img 
SET partition_image[6]=tee.img 
SET partition_image[7]=boot.img 
SET partition_image[8]=dtbo.img 
SET partition_image[9]=vbmeta.img 
SET partition_image[10]=super.img
SET partition_name[0]=boot_a 
SET partition_name[1]=dtbo_a
SET partition_name[2]=vbmeta_a
SET partition_name[3]=vbmeta_system_a
SET partition_name[4]=vbmeta_vendor_a
SET partition_name[5]=super
SET partition_name[6]=lk_a
SET partition_name[7]=logo
SET partition_name[8]=preloader_a

SET partition_image[0]=boot.img 
SET partition_image[1]=dtbo.img 
SET partition_image[2]=vbmeta.img 
SET partition_image[3]=vbmeta_system.img 
SET partition_image[4]=vbmeta_vendor.img 
SET partition_image[5]=super.img 
SET partition_image[6]=lk.img 
SET partition_image[7]=logo-verified.img 
SET partition_image[8]=preloader_yk673v6_lwg62_64.img

SET partition_error[0]=20 
SET partition_error[1]=21 
@@ -66,8 +63,6 @@ SET partition_error[5]=25
SET partition_error[6]=26 
SET partition_error[7]=27 
SET partition_error[8]=28 
SET partition_error[9]=29 
SET partition_error[10]=30

SET DEVICE_ID=%~1
SET ARCHIVE_PATH=%~2
@@ -114,18 +109,21 @@ echo "user data wiped"
timeout 5 >nul 2>&1

:: Wipe meta data
%FASTBOOT_PATH% erase userdata
%FASTBOOT_PATH% format md_udc
if errorLevel 1 ( exit /b 12 )
echo "meta data wiped"
timeout 5 >nul 2>&1

:: Flash partition
(for /L %%i in (0,1,10) do (
	%FASTBOOT_PATH% -s %DEVICE_ID% flash %%partition_name[%%i]%% %%partition_image[%%i]%%
	call %FASTBOOT_PATH% -s %DEVICE_ID% flash %%partition_name[%%i]%% %%partition_image[%%i]%%
	if errorLevel 1 ( exit /b %%partition_error[%%i]%% )
	timeout 1 >nul 2>&1
	call echo "Flashed %%partition_name[%%i]%% "
))

:: Activate
%FASTBOOT_PATH% --set-active=a
if errorLevel 1 ( exit /b 13 )
echo "set acivated"
timeout 5 >nul 2>&1
 No newline at end of file
Loading