Loading flash/FP4/flash_FP4_factory.sh +33 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ set -e set -u CLEAN_FLASH="true" # Control data wipe behavior. Default is "true". # Target device info PRODUCT="Fairphone 4" PRODUCT_ID="FP4" Loading Loading @@ -111,8 +113,11 @@ flash_device() { flash_image_ab_or_abort "${sn}" xbl_config "${IMAGES_DIR}/xbl_config.img" flash_image_ab_or_abort "${sn}" core_nhlos "${IMAGES_DIR}/core_nhlos.img" if [ "${CLEAN_FLASH}" = "true" ] then "$FASTBOOT_BIN" -s "${sn}" erase userdata "$FASTBOOT_BIN" -s "${sn}" erase metadata fi "$FASTBOOT_BIN" -s "${sn}" --set-active=a Loading Loading @@ -174,6 +179,31 @@ reboot_device() { echo "" } # Warn about data wipe, and ask for confirmation data_wipe_check() { if [ "${CLEAN_FLASH}" = "true" ] then echo "" echo "WARNING: Flashing this image wipes all user data and settings on the phone." echo " Are you sure you want to wipe data and continue?" echo "" # Read user's input read -rp " Type \"Yes\" (case sensitive) and press enter to wipe data and continue. Else, just press enter: " a echo "" if [ "_${a:-"No"}" != '_Yes' ] # NOTE: $a is being set by the read command above, # so the check for a to be set is mostly redundant then echo "WARNING: You DID NOT type \"Yes\", proceeding without data wipe." echo "" CLEAN_FLASH="false" else echo "WARNING: You typed \"Yes\", proceeding with data wipe." CLEAN_FLASH="true" fi fi } echo "" echo "*** ${PRODUCT} flashing script ***" echo "" Loading @@ -188,6 +218,9 @@ os_checks # If only one device is found $sn will store its serial number find_device # Call function to look for data wipe check data_wipe_check # Flash the device flash_device Loading Loading
flash/FP4/flash_FP4_factory.sh +33 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ set -e set -u CLEAN_FLASH="true" # Control data wipe behavior. Default is "true". # Target device info PRODUCT="Fairphone 4" PRODUCT_ID="FP4" Loading Loading @@ -111,8 +113,11 @@ flash_device() { flash_image_ab_or_abort "${sn}" xbl_config "${IMAGES_DIR}/xbl_config.img" flash_image_ab_or_abort "${sn}" core_nhlos "${IMAGES_DIR}/core_nhlos.img" if [ "${CLEAN_FLASH}" = "true" ] then "$FASTBOOT_BIN" -s "${sn}" erase userdata "$FASTBOOT_BIN" -s "${sn}" erase metadata fi "$FASTBOOT_BIN" -s "${sn}" --set-active=a Loading Loading @@ -174,6 +179,31 @@ reboot_device() { echo "" } # Warn about data wipe, and ask for confirmation data_wipe_check() { if [ "${CLEAN_FLASH}" = "true" ] then echo "" echo "WARNING: Flashing this image wipes all user data and settings on the phone." echo " Are you sure you want to wipe data and continue?" echo "" # Read user's input read -rp " Type \"Yes\" (case sensitive) and press enter to wipe data and continue. Else, just press enter: " a echo "" if [ "_${a:-"No"}" != '_Yes' ] # NOTE: $a is being set by the read command above, # so the check for a to be set is mostly redundant then echo "WARNING: You DID NOT type \"Yes\", proceeding without data wipe." echo "" CLEAN_FLASH="false" else echo "WARNING: You typed \"Yes\", proceeding with data wipe." CLEAN_FLASH="true" fi fi } echo "" echo "*** ${PRODUCT} flashing script ***" echo "" Loading @@ -188,6 +218,9 @@ os_checks # If only one device is found $sn will store its serial number find_device # Call function to look for data wipe check data_wipe_check # Flash the device flash_device Loading