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

Commit bdc52b36 authored by Frank Preel's avatar Frank Preel
Browse files

Functionnal Linux process

parent 247a4a28
Loading
Loading
Loading
Loading
+64 −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: FASTBOOT_PATH 
# $2: E_IMAGE_PATH need twrp path 
# Exit status
# - 0 : Recovery installed
# - 101 : FASTBOOT_PATH missing
# - 102 : E_IMAGE_PATH missing

#This script performs the same kind of job like `install-e-recovery` on the boot partion (rather than recovery patition)

FASTBOOT_PATH=$1
E_IMAGE_PATH=$2

if [ -z "$FASTBOOT_PATH" ]
then
	echo "Fastboot path is empty"
  	exit 101
fi

if [ -z "$E_IMAGE_PATH" ]
then
	echo "E Image path is empty"
  	exit 102
fi

#"$FASTBOOT_CMD" reboot bootloader
#sleep 10

# Build fastboot and adb commands
FASTBOOT_CMD=${FASTBOOT_PATH}"fastboot"
ADB_CMD=${FASTBOOT_PATH}"adb"

# Wipe user data
#if ! "$FASTBOOT_CMD" erase userdata ;
#then 
#  exit 11
#fi

#echo "user data wiped"
#sleep 1

#if ! "$FASTBOOT_CMD" erase metadata ;
#then 
#  exit 12
#fi

"$FASTBOOT_CMD" flash boot ${E_IMAGE_PATH}
+65 −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 unlocked 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"

if [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q yes; echo $?)" = 1 ]
then 
  # Unlock bootloader
  if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flashing unlock
  then
    exit 2
  fi
else
  exit 0
fi

while [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q yes; echo $?)" = 1 ]
do
  echo "locked"
  sleep 1
done

echo "unlock.."
sleep 1
+16 −90
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
## along with this program.  If not, see <https://www.gnu.org/licenses/>.
## Author: Frank Preel
---
stepsCount: 12
stepsCount: 8
steps:
    f0:
        type: custom
@@ -57,8 +57,7 @@ steps:
            - install_instr_unlockingOem
            - install_instr_selectUnlockBootloader
            - install_instr_unlockBootloader
            - install_instr_unlockBootloader_already
        script: oneplus-flashingUnlock
        script: pixel-flashingUnlock
        parameters:
          device_id: ${DEVICE_ID}
          fastboot_folder_path: ${ADB_FOLDER_PATH}
@@ -70,51 +69,14 @@ steps:
            101: script_error_serialNumber_missing
            102: script_error_fastboot_path_missing
    f3:
        type: custom
        type: load
        stepNumber: 4
        nextStepKey: f4
        titleKey: devMode_mTitle_main
        titleIconName: icon-download.png
        instructions:
            - devMode_main 
            - devMode_lbl
            - devMode_instr_settings
            - devMode_instr_build
            - devMode_instr_tap7
            - debugADB_instr_settings
            - debugADB_instr_search
            - debugADB_instr_androidDebug
            - debugADB_instr_debugOn
            - debugADB_instr_tapeOK
            - debugADB_instr_acceptCertificate
    f4:
        type: load
        stepNumber: 5
        nextStepKey: f5
        titleKey: stepTitle_rebootBootloader
        instructions:
          - install_instr_rebootingOnBootloader
        averageTime: 8
        script: reboot-fastboot
        parameters:
            device_id: ${DEVICE_ID}
            fastboot_folder_path: ${ADB_FOLDER_PATH}
        okCodes:
            0: ~
        koCodes:
            1: script_error_unknown
            10: script_error_cantRebootBootloader
            101: script_error_serialNumber_missing
            102: script_error_fastboot_path_missing
    f5:
        type: load
        stepNumber: 6
        nextStepKey: f6
        titleKey: stepTitle4On7
        instructions: 
            - install_instr_recoveryInstall
        averageTime: 3
        script: install-e-recovery 
        script: install-e-recovery-boot
        parameters: 
            fastboot_folder_path: ${ADB_FOLDER_PATH}
            twrp_image_path: ${TWRP_IMAGE_PATH}
@@ -123,52 +85,16 @@ steps:
        koCodes: 
            1: script_error_unknown
            101: script_error_installRecovery_101
    f6:
    f4:
        type: custom-executable
        stepNumber: 7
        nextStepKey: f7
        stepNumber: 5
        nextStepKey: f5
        titleKey: stepTitle5On7
        instructions: 
            - install_instr_choose_e_recovery_select
            - install_instr_choose_e_recovery_select_details
            - install_instr_choose_e_recovery_validate
            - install_instr_choose_e_recovery_validate_wait_for_result
            - install_instr_e_recovery_apply_update
            - install_instr_e_recovery_apply_update_from_adb
            - install_instr_e_recovery_apply_update_from_adb_wait_for_result
        titleKeyIconName: icon-download.png
        script: wait-e-recovery-sideload 
        parameters: 
            device_id: ${DEVICE_ID}
            adb_folder_path: ${ADB_FOLDER_PATH}
        okCodes:
            0: ~
        koCodes: 
            101: script_error_waitSideload_101
    f7:
        type: load
        stepNumber: 8
        nextStepKey: f8
        titleKey: install_instr_eosInstall
        instructions: 
            - install_instr_e_recovery_oneplus_select_recovery
        averageTime: 150
        script: install-from-e-recovery 
        parameters: 
            device_id: ${DEVICE_ID}
            archive_path: ${PATCH_PATH}
            adb_folder_path: ${ADB_FOLDER_PATH}
        okCodes:
            0: ~
        koCodes: 
            1: script_error_installFromSideload
    f8:
        type: custom-executable
        stepNumber: 9
        nextStepKey: f9
        titleKey: stepTitle_installation
        instructions: 
            - install_instr_e_recovery_back
            - install_instr_e_recovery_factory_reset
            - install_instr_e_recovery_factory_reset_format_data
            - install_instr_e_recovery_factory_reset_format_data_validate
@@ -185,13 +111,13 @@ steps:
            0: ~
        koCodes: 
            101: script_error_waitSideload_101
    f9:
    f5:
        type: load
        stepNumber: 10
        nextStepKey: f10
        stepNumber: 6 
        nextStepKey: f6
        titleKey: install_instr_eosInstall
        instructions: 
            - install_instr_e_recovery_oneplus_select_recovery
            - install_instr_eosInstall
        averageTime: 150
        script: install-from-e-recovery 
        parameters: 
@@ -202,13 +128,13 @@ steps:
            0: ~
        koCodes: 
            1: script_error_installFromSideload
    f10:
    f6:
        type: askAccount
        stepNumber: 11
        nextStepKey: f11
    f11:
        stepNumber: 7
        nextStepKey: f7
    f7:
        type: custom
        stepNumber: 12
        stepNumber: 8
        nextStepKey: end
        titleKey: stepTitle_rebootDevice
        instructions: 
+4 −7
Original line number Diff line number Diff line
@@ -16,11 +16,8 @@
---
sources:
  rom:
    url: https://images.ecloud.global/dev/instantnoodle/e-0.23-r-20220405175826-dev-instantnoodle.zip
    filePath: e-0.23-r-20220405175826-dev-instantnoodle.zip
    url: https://images.ecloud.global/dev/sunfish/e-0.23-r-20220405175826-dev-sunfish.zip
    filePath: e-0.23-r-20220405175826-dev-sunfish.zip
  twrp:
    url: https://images.ecloud.global/dev/instantnoodle/recovery-e-0.23-r-20220405175826-dev-instantnoodle.img
    filePath: recovery-e-0.23-r-20220405175826-dev-instantnoodle.img
  patch: 
    url: https://images.ecloud.global/dev/instantnoodle/e-0.23-r-20220405175826-dev-instantnoodle.zip
    filePath: e-0.23-r-20220405175826-dev-instantnoodle.zip
    url: https://images.ecloud.global/dev/sunfish/recovery-e-0.23-r-20220405175826-dev-sunfish.img
    filePath: recovery-e-0.23-r-20220405175826-dev-sunfish.img