FALSE=1
SUPERFS=""
+if [ -z $BLKID_PRINT ]; then
+ BLKID_PRINT="/usr/bin/blkid-print"
+fi
+
#------------------------------------------------
# critical_log msg [file]
#------------------------------------------------
}
check_if_super() {
- if SUPERFS="$(/usr/bin/blkid-print "$EMMC_DEVICE" super a)"; then
+ if SUPERFS="$("$BLKID_PRINT" "$EMMC_DEVICE" super a)"; then
local MAPPED_DEVICES=""
MAPPED_DEVICES=$(dmsetup ls)
CURRENT_PARTITION="/dev/mapper/${partition_name}_${CURRENT_AB}"
NEXT_PARTITION="/dev/mapper/${partition_name}_${NEXT_AB}"
else
- if ! CURRENT_PARTITION="$(/usr/bin/blkid-print "$EMMC_DEVICE" "$partition_name" "$CURRENT_AB")"; then
+ if ! CURRENT_PARTITION="$("$BLKID_PRINT" "$EMMC_DEVICE" "$partition_name" "$CURRENT_AB")"; then
flog "[Error] Unable to find: $partition_name current partition on $EMMC_DEVICE device on $CURRENT_AB slot"
check_optional_partition "$partition_name" 1
continue
fi
- if ! NEXT_PARTITION="$(/usr/bin/blkid-print "$EMMC_DEVICE" "$partition_name" "$NEXT_AB")"; then
+ if ! NEXT_PARTITION="$("$BLKID_PRINT" "$EMMC_DEVICE" "$partition_name" "$NEXT_AB")"; then
flog "[Error] Unable to find: $partition_name next partition on $EMMC_DEVICE device on $CURRENT_AB slot"
check_optional_partition "$partition_name" 1
continue
NEXT_PARTITION="/dev/mapper/${PART_NAME}_${NEXT_AB}"
CURR_PARTITION="/dev/mapper/${PART_NAME}_${CURRENT_AB}"
else
- NEXT_PARTITION="$(/usr/bin/blkid-print "$EMMC_DEVICE" "$PART_NAME" "$NEXT_AB")"
- CURR_PARTITION="$(/usr/bin/blkid-print "$EMMC_DEVICE" "$PART_NAME" "$CURRENT_AB")"
+ NEXT_PARTITION="$("$BLKID_PRINT" "$EMMC_DEVICE" "$PART_NAME" "$NEXT_AB")"
+ CURR_PARTITION="$("$BLKID_PRINT" "$EMMC_DEVICE" "$PART_NAME" "$CURRENT_AB")"
fi
flog "[Info] Flashing $DELTA_NAME... to $NEXT_PARTITION"
local DST="$2"
local MOUNT_OPTIONS="$3"
local SRC
- if ! SRC="$(/usr/bin/blkid-print "$EMMC_DEVICE" "$GPT_LABEL" "$NEXT_AB")"; then
+ if ! SRC="$("$BLKID_PRINT" "$EMMC_DEVICE" "$GPT_LABEL" "$NEXT_AB")"; then
flog "[Error] Unable to find $GPT_LABEL partition on $EMMC_DEVICE device for $NEXT_AB slot"
return 1
fi
SCRIPT_UPGRADE_PREPARE_PARTITIONS="upgrade-prepare-partitions.sh"
SCRIPT_UPGRADE_PARTIAL="upgrade-partial.sh"
SCRIPT_UPGRADE_FOTA="upgrade-fota.sh"
+BLKID_PRINT_FILE="blkid-print"
FLOCK_PATH="/var/lock/clone_partitions.lock"
DELTA_VERIFIER="/usr/bin/delta-verifier"
+export BLKID_PRINT="$FOTA_DIR/$BLKID_PRINT_FILE"
prepare_fota_dir() {
if [ -d "$FOTA_DIR" ]; then
if is_ab_upgrade; then
set_upgrade_status 5
+ unpack_file "${DOWNLOAD_DELTA}" "${BLKID_PRINT_FILE}"
+ chmod +x "$FOTA_DIR/$BLKID_PRINT_FILE"
+
if [ "$(device_board_get_partition_ab_cloned)" -eq 0 ]; then
log "Starting to prepare the partitions for upgrade.." "$LOG_FILE"