[script][flash_all] Improve Help
This commit is contained in:
parent
5d942bc74b
commit
6ef1691e56
@ -6,10 +6,17 @@ used_serial=""
|
|||||||
forbidden_serials="b06474cb"
|
forbidden_serials="b06474cb"
|
||||||
|
|
||||||
function usage {
|
function usage {
|
||||||
echo -e "Usage: $(basename $0) [-s serialNumber] [IMGLIST]"
|
echo -e "Usage: $(basename $0) [OPTIONS] [FILES]"
|
||||||
echo -e " IMGLIST is a list of file in .img separated by space"
|
echo -e " Flash Android images"
|
||||||
echo -e " If no IMGLIST provied all the .img in the current directory will be flashed"
|
echo -e ""
|
||||||
echo -e " e.g. $(basename $0) -s 132456789 out/target/device/boot.img out/target/device/system.img"
|
echo -e "Available options:"
|
||||||
|
echo -e " -s Specify the serial number of the device to flash"
|
||||||
|
echo -e " If not provided, only one device should be connected in fastboot mode or in adb mode"
|
||||||
|
echo -e " -w Wipe cache and data partition after flashing"
|
||||||
|
echo -e ""
|
||||||
|
echo -e "FILES is a list of file in .img separated by space"
|
||||||
|
echo -e "If no FILES provied all the .img in the current directory will be flashed"
|
||||||
|
echo -e "e.g. $(basename $0) -s 132456789 out/target/device/boot.img out/target/device/system.img"
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_forbidden_serial {
|
function check_forbidden_serial {
|
||||||
@ -28,11 +35,12 @@ function check_fastboot_serial {
|
|||||||
echo "Cannot find provided serial $serial: Expecting the device to be rebooting in fastboot mode "
|
echo "Cannot find provided serial $serial: Expecting the device to be rebooting in fastboot mode "
|
||||||
fi
|
fi
|
||||||
used_serial=$serial
|
used_serial=$serial
|
||||||
elif [[ $nb_device != 1 ]]; then
|
else
|
||||||
echo "Error: Too much device connected!"
|
if [[ $nb_device != 1 ]]; then
|
||||||
|
echo "Error: Too much or no device connected!"
|
||||||
echo " Provide a serial number with -s option or disconnect a device"
|
echo " Provide a serial number with -s option or disconnect a device"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
fi
|
||||||
used_serial=$serials
|
used_serial=$serials
|
||||||
fi
|
fi
|
||||||
check_forbidden_serial $used_serial
|
check_forbidden_serial $used_serial
|
||||||
|
Loading…
Reference in New Issue
Block a user