File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed
Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 457457
458458# flash Full ROM firmware
459459
460- # flash without verify, to avoid IFD mismatch upon verification
460+ # ensure no issues overwriting log file
461+ rm -f /tmp/flashrom.log
462+
461463echo_yellow " Installing Full ROM firmware (may take up to 90s)"
462- ${flashromcmd} ${flashrom_params} --noverify-all -w " ${coreboot_file} " -o /tmp/flashrom.log > /dev/null 2>&1
464+ # check if flashrom supports --noverify-all
465+ if ${flashromcmd} -h | grep -q " noverify-all" ; then
466+ noverify=" --noverify-all"
467+ else
468+ noverify=" --noverify"
469+ fi
470+ # check if flashrom supports logging to file
471+ if ${flashromcmd} -L -o /dev/null > /dev/null 2>&1 ; then
472+ output_params=" >/dev/null 2>&1 -o /tmp/flashrom.log"
473+ ${flashromcmd} ${flashrom_params} ${noverify} -w ${coreboot_file} > /dev/null 2>&1 -o /tmp/flashrom.log
474+ else
475+ output_params=" >/tmp/flashrom.log 2>&1"
476+ ${flashromcmd} ${flashrom_params} ${noverify} -w ${coreboot_file} > /tmp/flashrom.log 2>&1
477+ fi
463478if [ $? -ne 0 ]; then
464- cat /tmp/flashrom.log
479+ echo_red " Error running cmd: ${flashromcmd} ${flashrom_params} ${noverify} -w ${coreboot_file} ${output_params} "
480+ if [ -f /tmp/flashrom.log ]; then
481+ read -rp " Press enter to view the flashrom log file, then space for next page, q to quit"
482+ more /tmp/flashrom.log
483+ fi
465484 exit_red " An error occurred flashing the Full ROM firmware. DO NOT REBOOT!" ; return 1
466485else
467486 echo_green " Full ROM firmware successfully installed/updated."
Original file line number Diff line number Diff line change 431431# get device firmware info
432432echo -e " \nGetting device/system info..."
433433# try reading only BIOS region
434- [[ " $isChromeoS " = " false" ]] && test_params=" :ich_spi_mode=hwseq" || test_params=" "
434+ [[ " $isChromeOS " = " false" ]] && test_params=" :ich_spi_mode=hwseq" || test_params=" "
435435if ${flashromcmd}${test_params} --ifd -i bios -r /tmp/bios.bin > /dev/null 2>&1 ; then
436436 flashromcmd=" ${flashromcmd}${test_params} "
437437 flashrom_params=" --ifd -i bios"
You can’t perform that action at this time.
0 commit comments