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

Verified Commit cad1866d authored by ESPRI DIGITAL's avatar ESPRI DIGITAL Committed by Nicolas Gelot
Browse files

MacOS process

parent 095c96f9
Loading
Loading
Loading
Loading
+72 −0
Original line number Diff line number Diff line
#!/bin/bash

# Copyright (C) 2022 - Author: Frank
#
# 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: ARCHIVE_PATH path to the /e/ archive to flash
# $2: FASTBOOT_FOLDER_PATH: the path where runnable fastboot is stored
# $3: JAVA_FOLDER_PATH: the path where runnable jar is stored (to unpack ZIP file)

# Exit status
# - 0 : Fastboot functionnal
# - 101 : ARCHIVE_PATH missing

# Context 
#  On MacOS Fastboot starts not to work anymore (in case of fFP4 precisely during the flash of the partitions (it is systematic) 
#  Fastboot is locked and returns < waiting for any device > whereas some time before it still worked)
#  The only remedy I found to continue the process is to restart in recovery from the recovery menu. 
#  This script is a trigger to perform this action 

ARCHIVE_PATH=$1
ARCHIVE_FOLDER_PATH=$(dirname "$1")"/"
FASTBOOT_FOLDER_PATH=$2
FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"

echo "archive path : $ARCHIVE_PATH"
echo "archive folder path : $ARCHIVE_FOLDER_PATH"
echo "fastboot path : $FASTBOOT_PATH"

if [ -z "$ARCHIVE_PATH" ]
then
  exit 101
fi

cd "$ARCHIVE_FOLDER_PATH"

if [[ $OSTYPE == 'darwin'* ]]; then
    CHECK_FASTBOOT=1
    while [ $CHECK_FASTBOOT = 1 ]
    do
        echo "CHECK..."
        ("$FASTBOOT_PATH" flashing get_unlock_ability) & pid=$!
        ( sleep 10 && kill -HUP $pid ) 2>/dev/null & watcher=$!
        if wait $pid 2>/dev/null; then
            echo "fastboot works finished"
            pkill -HUP -P $watcher
            wait $watcher
            CHECK_FASTBOOT=0
        else
            (killall -9 fastboot) &  
            echo "fastboot failed"
            CHECK_FASTBOOT=1
            sleep 10
        fi
    done
fi

exit 0

+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ MURENA_ROM_INFO=${ARCHIVE_FOLDER_PATH}""${device_model}"-rom-info"
# In that case the process will use for compare.
"$ADB_PATH" shell getprop ro.build.version.security_patch> $SECURITY_PATCH

wget https://images.ecloud.global/stable/FP4/e-latest-FP4.zip.prop -O $MURENA_ROM_INFO
curl -o $MURENA_ROM_INFO https://images.ecloud.global/stable/FP4/e-latest-FP4.zip.prop

MURENA__SECURITY_PATCH=`sed -n 's/^ro.build.version.security_patch=//p' $MURENA_ROM_INFO`
echo "MURENA__SECURITY_PATCH=$MURENA__SECURITY_PATCH"
+23 −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

:: Exit status
:: - 0 : Always true

exit /b 0
+3 −0
Original line number Diff line number Diff line
@@ -143,6 +143,9 @@ script_error_store_rom_info_1=Cannot get security patch information.
script_error_store_rom_info_2=The device is locked, please unlock and retry.
stepTitle_checkLock=Checking the lock
install_instr_lockfailed=if you see this message, it means that the bootloader has not been locked. In this case you will see a screen that the bootloader is not locked every time you start the device. You can ignore the message displayed at the startup of the phone and start it normally. 
stepTitle_checkLock_mac_bootloader=Restart in bootloader mode
install_instr_mac_bootloader=Using only the menu on the phone, select "Restart Bootloader" with the volume keys and confirm with "Power". 
install_instr_mac_bootloader_1=The phone will reboot and should proceed to the next step "Installation of /e/". If this is not the case, you must redo the operation below once again.

#
## General
+3 −0
Original line number Diff line number Diff line
@@ -255,6 +255,9 @@ script_error_store_rom_info_1=Impossible d'obtenir des informations sur les corr
script_error_store_rom_info_2=L'appareil est verrouillé, veuillez le déverrouiller et réessayer.
stepTitle_checkLock=Vérification du lock
install_instr_lockfailed=Si vous voyez ce message, cela signifie que le chargeur de démarrage n'a pas été verrouillé. Dans ce cas, vous verrez un écran indiquant que le chargeur de démarrage n'est pas verrouillé chaque fois que vous démarrez l'appareil. Vous pouvez ignorer le message affiché au démarrage du téléphone et le démarrer normalement. 
stepTitle_checkLock_mac_bootloader=Redémarrage en mode bootloader 
install_instr_mac_bootloader=En utilisant uniquement le menu du téléphone, sélectionnez "Restart Bootloader" avec les touches de volume et confirmez avec "Power". 
install_instr_mac_bootloader_1=Le téléphone va redémarrer et devrait passer à l'étape suivante "Installation de /e/". Si ce n'est pas le cas, vous devez refaire l'opération ci dessous une nouvelle fois.

##FP3
install_instr_followOfficialGuidanceAt=Suivez le guide officiel sur
Loading