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

Commit 800eb306 authored by Romain Hunault's avatar Romain Hunault
Browse files

Flash scripts

parents
Loading
Loading
Loading
Loading

clean-lock-files.sh

0 → 100755
+34 −0
Original line number Diff line number Diff line
#!/bin/bash

# Parameter
# $1: CABLES_LOCKED_PATH device identifier
# $2: DEVICES_LOCKED_PATH path to the /e/ archive to flash
# $3: HEIMDALL_LOCKED_PATH path to the /e/ archive to flash

# Exit status
# - 101 : CABLES_LOCKED_PATH missing
# - 102 : DEVICES_LOCKED_PATH missing
# - 103 : HEIMDALL_LOCKED_PATH missing

CABLES_LOCKED_PATH=$1
DEVICES_LOCKED_PATH=$2
HEIMDALL_LOCKED_PATH=$3

if [ -z $CABLES_LOCKED_PATH ]
then
  exit 101
fi

if [ -z $DEVICES_LOCKED_PATH ]
then
  exit 102
fi

if [ -z $HEIMDALL_LOCKED_PATH ]
then
  exit 103
fi

rm -f ${CABLES_LOCKED_PATH}/*
rm -f ${DEVICES_LOCKED_PATH}/*
rm -f ${HEIMDALL_LOCKED_PATH}

get-e.sh

0 → 100755
+33 −0
Original line number Diff line number Diff line
#!/bin/bash

# Parameter
# $1: E_ARCHIVE_URL
# $2: E_FOLDER (will be created if doesn't exist)

# Exit status
# - 0 : /e/ downloaded
# - 1 : Generic error code (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 2 : Parse error—for instance, when parsing command-line options, the ‘.wgetrc’ or ‘.netrc’... (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 3 : File I/O error (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 4 : Network failure (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 5 : SSL verification failure (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 6 : Username/password authentication failure (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 7 : Protocol errors (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 8 : Server issued an error response (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 101 : E_ARCHIVE_URL missing
# - 102 : E_FOLDER missing

E_ARCHIVE_URL=$1
E_FOLDER=$2

if [ -z ${E_FOLDER} ]
then
  exit 101
fi

if [ -z ${E_ARCHIVE_URL} ]
then
  exit 102
fi

wget -P ${E_FOLDER} -N ${E_ARCHIVE_URL}

get-twrp.sh

0 → 100755
+36 −0
Original line number Diff line number Diff line
#!/bin/bash

# Parameter
# $1: TWRP_IMG_URL
# $2: TWRP_FOLDER (TWRP_IMG/TWRP_IMG_URL)

# Exit status
# - 0 : TWRP downloaded
# - 1 : Generic error code (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 2 : Parse error—for instance, when parsing command-line options, the ‘.wgetrc’ or ‘.netrc’... (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 3 : File I/O error (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 4 : Network failure (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 5 : SSL verification failure (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 6 : Username/password authentication failure (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 7 : Protocol errors (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 8 : Server issued an error response (see wget exit status here: https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html)
# - 101 : TWRP_IMG_URL missing
# - 102 : TWRP_FOLDER missing

TWRP_IMG_URL=$1
TWRP_FOLDER=$2

if [ -z ${TWRP_IMG_URL} ]
then
  exit 101
fi

if [ -z ${TWRP_FOLDER} ]
then
  exit 102
fi

if [ ! -f ${TWRP_FOLDER}/$(basename ${TWRP_IMG_URL}) ]
then
  wget -P ${TWRP_FOLDER} ${TWRP_IMG_URL} --referer='https://dl.twrp.me/BUTTS'
fi

install-e.sh

0 → 100755
+39 −0
Original line number Diff line number Diff line
#!/bin/bash

# Parameter
# $1: DEVICE_ID device identifier
# $2: E_ARCHIVE_PATH path to the /e/ archive to flash

# Exit status
# - 0 : /e/ installed
# - 1 : Problems occurred (adb returns only 1 if an error occurs)
# - 101 : DEVICE_ID missing
# - 102 : E_ARCHIVE_PATH missing

DEVICE_ID=$1
E_ARCHIVE_PATH=$2
E_IMAGE=$(basename $2)

if [ -z $DEVICE_ID ]
then
  exit 101
fi

if [ -z $E_ARCHIVE_PATH ]
then
  exit 102
fi

adb -s ${DEVICE_ID} shell twrp wipe system
adb -s ${DEVICE_ID} shell twrp wipe cache
adb -s ${DEVICE_ID} shell twrp wipe data
adb -s ${DEVICE_ID} push  ${E_ARCHIVE_PATH} /sdcard
adb -s ${DEVICE_ID} shell twrp install /sdcard/${E_IMAGE}

sleep 1

adb -s ${DEVICE_ID} shell rm /sdcard/${E_IMAGE}

sleep 1

adb -s ${DEVICE_ID} reboot

install-recovery.sh

0 → 100755
+18 −0
Original line number Diff line number Diff line
#!/bin/bash

# Parameter
# $1: TWRP_IMAGE_PATH need twrp path (${TWRP_FOLDER}/${TWRP})

# Exit status
# - 0 : Recovery installed
# - 1 : No problems occurred (heimdall returns only 1 if an error occurs)
# - 101 : TWRP_IMAGE_PATH missing

TWRP_IMAGE_PATH=$1

if [ -z $TWRP_IMAGE_PATH ]
then
  exit 101
fi

heimdall flash --RECOVERY ${TWRP_IMAGE_PATH} --no-reboot