Support flashing a specific device
This commit is contained in:
parent
76f4a4c29f
commit
80e91d3e85
24
chip-flash
24
chip-flash
@ -13,7 +13,7 @@ done
|
||||
##############################################################
|
||||
# main
|
||||
##############################################################
|
||||
TEMP=`getopt -o "sflu:" --long "fel,fastboot,loop-after-flash,stage:" -- "$@"`
|
||||
TEMP=`getopt -o "sflu:n:" --long "fel,fastboot,loop-after-flash,stage:,chip-path:" -- "$@"`
|
||||
eval set -- "$TEMP"
|
||||
|
||||
while true; do
|
||||
@ -49,6 +49,15 @@ while true; do
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-n|--chip-path)
|
||||
CHIP_PATH=$2
|
||||
FEL_DEVICE="--dev $(udevadm info ${CHIP_PATH} | grep "E\: BUSNUM" | awk -F "=" '{ print $NF }'):$(udevadm info ${CHIP_PATH} | grep "E\: DEVNUM" | awk -F "=" '{ print $NF }')"
|
||||
FASTBOOT_PORT="-s usb:$(udevadm info ${CHIP_PATH} | grep "P\:" | awk -F "/" '{print $NF}')"
|
||||
echo "Fastboot port: ${FASTBOOT_PORT}"
|
||||
echo "FEL device: ${FEL_DEVICE}"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift; break;;
|
||||
*)
|
||||
@ -69,7 +78,7 @@ if ${RUN_ALL_STAGES}; then
|
||||
done
|
||||
fi
|
||||
|
||||
FEL=fel
|
||||
FEL="fel ${FEL_DEVICE}"
|
||||
|
||||
METHOD=${METHOD:-fastboot}
|
||||
AFTER_FLASHING=${AFTER_FLASHING:-wait}
|
||||
@ -234,8 +243,7 @@ if [[ "${METHOD}" == "fel" ]]; then
|
||||
echo == execute the main u-boot binary ==
|
||||
${FEL} exe $UBOOT_MEM_ADDR
|
||||
fi
|
||||
|
||||
echo == write ubi ==
|
||||
rm -rf "${TMPDIR}"
|
||||
else
|
||||
if ${stage[4]}; then
|
||||
echo == execute the main u-boot binary ==
|
||||
@ -250,16 +258,14 @@ else
|
||||
|
||||
echo == waiting for fastboot ==
|
||||
if wait_for_fastboot; then
|
||||
fastboot -i 0x1f3a -u flash UBI ${SPARSE_UBI}
|
||||
fastboot ${FASTBOOT_PORT} -i 0x1f3a -u flash UBI ${SPARSE_UBI}
|
||||
assert_error 134
|
||||
|
||||
fastboot -i 0x1f3a continue
|
||||
fastboot ${FASTBOOT_PORT} -i 0x1f3a continue
|
||||
assert_error 135
|
||||
else
|
||||
rm -rf "${TMPDIR}"
|
||||
exit 1
|
||||
fi
|
||||
rm -rf "${TMPDIR}"
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf "${TMPDIR}"
|
||||
|
Loading…
Reference in New Issue
Block a user