1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-11-02 06:10:14 +01:00
Files
flashrom/util/flashrom.bash-completion.tmpl
Matt DeVillier bc3f2f84f9 cli-classic: Add new '--fmap-verify' option
Add a new layout option, --fmap-verify, to be used when writing to
flash, which will compare the FMAP on the flash chip to the one in
the file being flashed, and abort if there are any differences.
The comparison ensures that number of regions and start/end addresses
are all identical.

Add documentation for the new option as well.

TEST: tested with the following commands:
flashrom -p internal -r coreboot.rom --fmap-verify -i COREBOOT (fails w/error)
flashrom -p internal -v coreboot.rom --fmap-verify -i COREBOOT (fails w/error)
flashrom -p internal -r coreboot.rom --fmap -i COREBOOT (ok)
flashrom -p internal -w coreboot.rom --fmap-verify -i COREBOOT (fails w/error - no FMAP)
flashrom -p internal -r coreboot.rom (fails w/error, active ME)
flashrom -p internal -r coreboot.rom --ifd -i bios (ok)
flashrom -p internal -w coreboot.rom --fmap-verify -i COREBOOT -N (ok)

Change-Id: I34f69d848869cf236b7e57cf8f60c2aaad79c385
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/89536
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2025-10-28 22:39:09 +00:00

69 lines
1.3 KiB
Cheetah

# Completion file for bash
#
# This file is part of the flashrom project.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2022 Alexander Goncharov <chat@joursoir.net>
_flashrom()
{
local cur prev OPTS
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-r'|'--read'|'-w'|'--write'|'-v'|'--verify'|'-l'|'--layout'| \
'--fmap-file'|'-o'|'--output'|'--flash-contents')
local IFS=$'\n'
compopt -o filenames
COMPREPLY=( $(compgen -f -- $cur) )
return 0
;;
'-c'|'--chip'|'--wp-range'|'--wp-region'|'-i'|'--include')
return 0
;;
'-p'|'--programmer')
COMPREPLY=( $(compgen -W "@PROGRAMMERS@" -- $cur) )
return 0
;;
'-h'|'--help'|'-R'|'--version'|'-L'|'--list-supported')
return 0
;;
esac
OPTS="--help
--version
--read
--write
--verify
--erase
--verbose
--chip
--force
--noverify
--noverify-all
--extract
--layout
--wp-disable
--wp-enable
--wp-list
--wp-status
--wp-range
--wp-region
--flash-name
--flash-size
--fmap
--fmap-file
--fmap-verify
--ifd
--include
--output
--flash-contents
--list-supported
--progress
--programmer"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
}
complete -F _flashrom flashrom