added new mode for factory flashing
This commit is contained in:
parent
b2d88f7134
commit
210f269ed8
@ -6,6 +6,7 @@ source $SCRIPTDIR/common.sh
|
|||||||
FEL=fel
|
FEL=fel
|
||||||
|
|
||||||
METHOD=${METHOD:-fel}
|
METHOD=${METHOD:-fel}
|
||||||
|
AFTER_FLASHING=${AFTER_FLASHING:-boot}
|
||||||
|
|
||||||
echo "BUILDROOT_OUTPUT_DIR = $BUILDROOT_OUTPUT_DIR"
|
echo "BUILDROOT_OUTPUT_DIR = $BUILDROOT_OUTPUT_DIR"
|
||||||
|
|
||||||
@ -85,15 +86,21 @@ prepare_uboot_script() {
|
|||||||
echo "nand slc-mode on" >> "${UBOOT_SCRIPT_SRC}"
|
echo "nand slc-mode on" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
echo "nand write.trimffs $UBI_MEM_ADDR 0x1000000 $UBI_SIZE" >> "${UBOOT_SCRIPT_SRC}"
|
echo "nand write.trimffs $UBI_MEM_ADDR 0x1000000 $UBI_SIZE" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
echo "mw \${scriptaddr} 0x0" >> "${UBOOT_SCRIPT_SRC}"
|
echo "mw \${scriptaddr} 0x0" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
echo "boot" >> "${UBOOT_SCRIPT_SRC}"
|
|
||||||
else
|
else
|
||||||
echo "echo going to fastboot mode" >>"${UBOOT_SCRIPT_SRC}"
|
echo "echo going to fastboot mode" >>"${UBOOT_SCRIPT_SRC}"
|
||||||
echo "fastboot" >>"${UBOOT_SCRIPT_SRC}"
|
echo "fastboot" >>"${UBOOT_SCRIPT_SRC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${AFTER_FLASHING}" == "boot" ]]; then
|
||||||
echo "echo " >>"${UBOOT_SCRIPT_SRC}"
|
echo "echo " >>"${UBOOT_SCRIPT_SRC}"
|
||||||
echo "echo *****************[ BOOT ]*****************" >>"${UBOOT_SCRIPT_SRC}"
|
echo "echo *****************[ BOOT ]*****************" >>"${UBOOT_SCRIPT_SRC}"
|
||||||
echo "echo " >>"${UBOOT_SCRIPT_SRC}"
|
echo "echo " >>"${UBOOT_SCRIPT_SRC}"
|
||||||
|
echo "boot" >> "${UBOOT_SCRIPT_SRC}"
|
||||||
|
else
|
||||||
echo "echo " >>"${UBOOT_SCRIPT_SRC}"
|
echo "echo " >>"${UBOOT_SCRIPT_SRC}"
|
||||||
echo "boot" >>"${UBOOT_SCRIPT_SRC}"
|
echo "echo *****************[ FLASHING DONE ]*****************" >>"${UBOOT_SCRIPT_SRC}"
|
||||||
|
echo "echo " >>"${UBOOT_SCRIPT_SRC}"
|
||||||
|
echo "while true; do; sleep 10; done;" >>"${UBOOT_SCRIPT_SRC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkimage -A arm -T script -C none -n "flash CHIP" -d "${UBOOT_SCRIPT_SRC}" "${UBOOT_SCRIPT}"
|
mkimage -A arm -T script -C none -n "flash CHIP" -d "${UBOOT_SCRIPT_SRC}" "${UBOOT_SCRIPT}"
|
||||||
@ -103,12 +110,16 @@ prepare_uboot_script() {
|
|||||||
##############################################################
|
##############################################################
|
||||||
# main
|
# main
|
||||||
##############################################################
|
##############################################################
|
||||||
while getopts "f" opt; do
|
while getopts "fl" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
f)
|
f)
|
||||||
echo "fastboot enabled"
|
echo "fastboot enabled"
|
||||||
METHOD=fastboot
|
METHOD=fastboot
|
||||||
;;
|
;;
|
||||||
|
l)
|
||||||
|
echo "factory mode remain in u-boot after flashing"
|
||||||
|
AFTER_FLASHING=loop
|
||||||
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user