From f0d85ba2d732a4944c8d2065aee6def74996b28c Mon Sep 17 00:00:00 2001 From: Sebastian McMillan <22755892+SebastianMcMillan@users.noreply.github.com> Date: Wed, 19 Feb 2020 11:04:56 -0600 Subject: [PATCH] Flash.sh cleanup : flashrom specifics now in board configs (#592) Flash.sh cleanup : flashrom specifics now in board configs (#592) --- boards/kgpe-d16/kgpe-d16.config | 1 + boards/librem13v2/librem13v2.config | 1 + boards/librem13v4/librem13v4.config | 1 + boards/librem15v3/librem15v3.config | 1 + boards/librem15v4/librem15v4.config | 1 + boards/x220/x220.config | 1 + boards/x230-flash/x230-flash.config | 1 + boards/x230/x230.config | 1 + initrd/bin/flash.sh | 12 +++--------- 9 files changed, 11 insertions(+), 9 deletions(-) diff --git a/boards/kgpe-d16/kgpe-d16.config b/boards/kgpe-d16/kgpe-d16.config index 466fdf01..40c5f737 100644 --- a/boards/kgpe-d16/kgpe-d16.config +++ b/boards/kgpe-d16/kgpe-d16.config @@ -30,4 +30,5 @@ export CONFIG_BOOT_KERNEL_REMOVE="" export CONFIG_BOOT_DEV="/dev/sda1" export CONFIG_USB_BOOT_DEV="/dev/sdb1" export CONFIG_BOOT_RECOVERY_SERIAL="/dev/ttyS0" +export FLASHROM_OPTIONS='--force --noverify -p internal' #export CONFIG_BOOT_STATIC_IP=192.168.1.2 diff --git a/boards/librem13v2/librem13v2.config b/boards/librem13v2/librem13v2.config index e37d506b..0e562f4f 100644 --- a/boards/librem13v2/librem13v2.config +++ b/boards/librem13v2/librem13v2.config @@ -35,3 +35,4 @@ export CONFIG_BOOT_GUI_MENU_NAME="Purism Librem 13v2 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='-p internal:laptop=force_I_want_a_brick,ich_spi_mode=hwseq' diff --git a/boards/librem13v4/librem13v4.config b/boards/librem13v4/librem13v4.config index f78f13a9..f76dd328 100644 --- a/boards/librem13v4/librem13v4.config +++ b/boards/librem13v4/librem13v4.config @@ -35,3 +35,4 @@ export CONFIG_BOOT_GUI_MENU_NAME="Purism Librem 13v2 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='-p internal:laptop=force_I_want_a_brick,ich_spi_mode=hwseq' diff --git a/boards/librem15v3/librem15v3.config b/boards/librem15v3/librem15v3.config index f9d05253..d4d47163 100644 --- a/boards/librem15v3/librem15v3.config +++ b/boards/librem15v3/librem15v3.config @@ -37,3 +37,4 @@ export CONFIG_BOOT_GUI_MENU_NAME="Purism Librem 15v3 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='-p internal:laptop=force_I_want_a_brick,ich_spi_mode=hwseq' diff --git a/boards/librem15v4/librem15v4.config b/boards/librem15v4/librem15v4.config index 5f79a91d..23e77671 100644 --- a/boards/librem15v4/librem15v4.config +++ b/boards/librem15v4/librem15v4.config @@ -37,3 +37,4 @@ export CONFIG_BOOT_GUI_MENU_NAME="Purism Librem 15v4 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='-p internal:laptop=force_I_want_a_brick,ich_spi_mode=hwseq' diff --git a/boards/x220/x220.config b/boards/x220/x220.config index 0b901bdb..f731c0e6 100644 --- a/boards/x220/x220.config +++ b/boards/x220/x220.config @@ -28,3 +28,4 @@ export CONFIG_BOOT_KERNEL_ADD="intel_iommu=on" export CONFIG_BOOT_KERNEL_REMOVE="quiet" export CONFIG_BOOT_DEV="/dev/sda1" export CONFIG_USB_BOOT_DEV="/dev/sdb1" +export FLASHROM_OPTIONS='--force --noverify-all -p internal:laptop=force_I_want_a_brick,ich_spi_mode=hwseq --ifd --image bios' diff --git a/boards/x230-flash/x230-flash.config b/boards/x230-flash/x230-flash.config index b10d17af..e8a9abf6 100644 --- a/boards/x230-flash/x230-flash.config +++ b/boards/x230-flash/x230-flash.config @@ -17,6 +17,7 @@ CONFIG_LINUX_E1000E=y export CONFIG_USB_BOOT_DEV="/dev/sdb1" export CONFIG_BOOTSCRIPT=/bin/x230-flash.init +export FLASHROM_OPTIONS='--force --noverify-all -p internal:laptop=force_I_want_a_brick,ich_spi_mode=hwseq --ifd --image bios' # This board is "special" in that we only want the top 4 MB of the ROM # for flashing into SPI flash 1 on the mainboard. This is enough to diff --git a/boards/x230/x230.config b/boards/x230/x230.config index 1d46ba92..acbf3dba 100644 --- a/boards/x230/x230.config +++ b/boards/x230/x230.config @@ -34,6 +34,7 @@ export CONFIG_BOOT_GUI_MENU_NAME="Thinkpad X230 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,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 diff --git a/initrd/bin/flash.sh b/initrd/bin/flash.sh index 121b42b1..f73bda98 100755 --- a/initrd/bin/flash.sh +++ b/initrd/bin/flash.sh @@ -6,15 +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' - ;; - "kgpe-d16" ) - FLASHROM_OPTIONS='--force --noverify --programmer internal' +case "$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."