Skip to content

Commit

Permalink
Merge pull request #3 from SebastianMcMillan/patch-3
Browse files Browse the repository at this point in the history
Final Touches
  • Loading branch information
flawedworld authored Feb 20, 2020
2 parents 503d746 + a3153bf commit 65c7ea4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion boards/t430/t430.config
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export CONFIG_BOOT_GUI_MENU_NAME="Thinkpad T430 Heads Boot Menu"
export CONFIG_USB_BOOT_DEV="/dev/sdb1"
export CONFIG_WARNING_BG_COLOR="--background-gradient 0 0 0 150 125 0"
export CONFIG_ERROR_BG_COLOR="--background-gradient 0 0 0 150 0 0"
export FLASHROM_OPTIONS='--force --noverify-all -p internal:laptop=force_I_want_a_brick --ifd --image bios'
export CONFIG_FLASHROM_OPTIONS='--force --noverify-all -p internal:laptop=force_I_want_a_brick,ich_spi_mode=hwseq --ifd --image bios'

# This board has two SPI flash chips, an 8 MB that holds the IFD,
# the ME image and part of the coreboot image, and a 4 MB one that
Expand Down
23 changes: 7 additions & 16 deletions initrd/bin/flash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,9 @@ set -e -o pipefail
. /etc/functions
. /tmp/config

case "$CONFIG_BOARD" in
librem* )
FLASHROM_OPTIONS='-p internal:laptop=force_I_want_a_brick,ich_spi_mode=hwseq'
;;
x230* )
FLASHROM_OPTIONS='--force --noverify-all --programmer internal --ifd --image bios'
;;
t430* )
FLASHROM_OPTIONS='--force --noverify-all --programmer internal:laptop=force_I_want_a_brick --ifd --image bios'
;;
"kgpe-d16" )
FLASHROM_OPTIONS='--force --noverify --programmer internal'
case "$CONFIG_FLASHROM_OPTIONS" in
-* )
echo "Board $CONFIG_BOARD detected, continuing..."
;;
* )
die "ERROR: No board has been configured!\n\nEach board requires specific flashrom options and it's unsafe to flash without them.\n\nAborting."
Expand All @@ -27,11 +18,11 @@ esac
flash_rom() {
ROM=$1
if [ "$READ" -eq 1 ]; then
flashrom $FLASHROM_OPTIONS -r "${ROM}.1" \
flashrom $CONFIG_FLASHROM_OPTIONS -r "${ROM}.1" \
|| die "$ROM: Read failed"
flashrom $FLASHROM_OPTIONS -r "${ROM}.2" \
flashrom $CONFIG_FLASHROM_OPTIONS -r "${ROM}.2" \
|| die "$ROM: Read failed"
flashrom $FLASHROM_OPTIONS -r "${ROM}.3" \
flashrom $CONFIG_FLASHROM_OPTIONS -r "${ROM}.3" \
|| die "$ROM: Read failed"
if [ `sha256sum ${ROM}.[123] | cut -f1 -d ' ' | uniq | wc -l` -eq 1 ]; then
mv ${ROM}.1 $ROM
Expand All @@ -53,7 +44,7 @@ flash_rom() {
cbfs -o /tmp/${CONFIG_BOARD}.rom -a serial_number -f /tmp/serial
fi

flashrom $FLASHROM_OPTIONS -w /tmp/${CONFIG_BOARD}.rom \
flashrom $CONFIG_FLASHROM_OPTIONS -w /tmp/${CONFIG_BOARD}.rom \
|| die "$ROM: Flash failed"
fi
}
Expand Down

0 comments on commit 65c7ea4

Please sign in to comment.