Skip to content

Commit

Permalink
T430 dgpu patch 9.23.22 (#2)
Browse files Browse the repository at this point in the history
patches vbios script dependencies, error reporting, sudo calls
updates board and coreboot configs to match new directory structure of master
changes build dependency to linux-x230-maximized
  • Loading branch information
weyounsix authored Sep 24, 2022
1 parent 3abb9ef commit c8d2950
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 36 deletions.
20 changes: 12 additions & 8 deletions blobs/xx30/vbios_t430.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ cd "$extractdir"

echo "### Installing basic dependencies"
sudo apt update && sudo apt install -y wget ruby ruby-dev ruby-bundler p7zip-full upx-ucl
sudo gem install bundler:1.17.3

echo "### Downloading rom-parser dependency"
wget https://github.com/awilliam/rom-parser/archive/"$ROMPARSER".zip
wget https://github.com/awilliam/rom-parser/archive/"$ROMPARSER".zip || { echo "Failed to download $ROMPARSER" && exit 1; }

echo "### Verifying expected hash of rom-parser"
echo "$ROM_PARSER_SHA256SUM" | sha256sum --check || { echo "Failed sha256sum verification..." && exit 1; }
Expand All @@ -31,7 +32,7 @@ cd rom-parser-"$ROMPARSER" && make
sudo cp rom-parser /usr/sbin/

echo "### Downloading UEFIExtract dependency"
wget https://github.com/LongSoft/UEFITool/releases/download/A58/"$UEFIEXTRACT"
wget https://github.com/LongSoft/UEFITool/releases/download/A58/"$UEFIEXTRACT" || { echo "Failed to download $UEFIEXTRACT" && exit 1; }

echo "### Verifying expected hash of UEFIExtract"
echo "$UEFI_EXTRACT_SHA256SUM" | sha256sum --check || { echo "Failed sha256sum verification..." && exit 1; }
Expand All @@ -41,7 +42,7 @@ unzip "$UEFIEXTRACT"
sudo mv UEFIExtract /usr/sbin/

echo "### Downloading VBiosFinder"
wget https://github.com/coderobe/VBiosFinder/archive/"$VBIOSFINDER".zip
wget https://github.com/coderobe/VBiosFinder/archive/"$VBIOSFINDER".zip || { echo "Failed to download $VBIOSFINDER" && exit 1; }

echo "### Verifying expected hash of VBiosFinder"
echo "$VBIOS_FINDER_SHA256SUM" | sha256sum --check || { echo "Failed sha256sum verification..." && exit 1; }
Expand All @@ -51,23 +52,26 @@ unzip "$VBIOSFINDER".zip
cd VBiosFinder-"$VBIOSFINDER" && bundle install --path=vendor/bundle

echo "### Downloading latest Lenovo bios update for t430"
wget https://download.lenovo.com/pccbbs/mobiles/"$BIOSUPDATE"
wget https://download.lenovo.com/pccbbs/mobiles/"$BIOSUPDATE" || { echo "Failed to download $BIOSUPDATE" && exit 1; }

echo "### Verifying expected hash of bios update"
echo "$BIOS_UPDATE_SHA256SUM" | sha256sum --check || { echo "Failed sha256sum verification..." && exit 1; }

echo "### Extracting bios update"
innoextract "$extractdir"/rom-parser-"$ROMPARSER"/VBiosFinder-"$VBIOSFINDER"/"$BIOSUPDATE" || { echo "Failed to extract $BIOSUPDATE" && exit 1; }

echo "### Finding, extracting and saving vbios"
./vbiosfinder extract "$extractdir"/rom-parser-"$ROMPARSER"/VBiosFinder-"$VBIOSFINDER"/"$BIOSUPDATE"
sudo ./vbiosfinder extract "$extractdir"/rom-parser-"$ROMPARSER"/VBiosFinder-"$VBIOSFINDER"/"app/G1ETC2WW/\$01D2000.FL1" || { echo "Failed to extract FL1" && exit 1; }

echo "Verifying expected hash of extracted roms"
cd output
echo "$DGPU_ROM_SHA256SUM" | sha256sum --check || { echo "dGPU rom failed sha256sum verification..." && exit 1; }
echo "$IGPU_ROM_SHA256SUM" | sha256sum --check || { echo "iGPU rom Failed sha256sum verification..." && exit 1; }

echo "### Moving extracted roms to blobs directory"
mv vbios_10de_0def_1.rom $BLOBDIR/10de,0def.rom
mv vbios_8086_0106_1.rom $BLOBDIR/8086,0106.rom
sudo mv vbios_10de_0def_1.rom $BLOBDIR/10de,0def.rom
sudo mv vbios_8086_0106_1.rom $BLOBDIR/8086,0106.rom

echo "### Cleaning Up"
cd "$BLOBDIR"
rm -rf "$extractdir"
sudo rm -rf "$extractdir"
17 changes: 10 additions & 7 deletions boards/t430-dgpu-hotp-maximized/t430-dgpu-hotp-maximized.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export CONFIG_COREBOOT_VERSION=4.13
export CONFIG_LINUX_VERSION=4.14.62

CONFIG_COREBOOT_CONFIG=config/coreboot-t430-dgpu-hotp-maximized.config
CONFIG_LINUX_CONFIG=config/linux-x230.config
CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config

#Additional hardware support
CONFIG_LINUX_USB=y
Expand Down Expand Up @@ -80,12 +80,15 @@ export CONFIG_FLASHROM_OPTIONS="--force --noverify-all -p internal"
#
# When flashing via an external programmer it is easiest to have
# two separate files for these pieces.
all: $(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom
$(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom: $(build)/$(BOARD)/$(CB_OUTPUT_FILE)
all: $(board_build)/$(CB_OUTPUT_FILE)
@sha256sum $@ | tee -a "$(HASHES)"

all: $(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom
$(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom: $(board_build)/$(CB_OUTPUT_FILE)
$(call do,DD 8MB,$@,dd of=$@ if=$< bs=65536 count=128 skip=0 status=none)
@sha256sum $@
@sha256sum $@ | tee -a "$(HASHES)"

all: $(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom
$(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom: $(build)/$(BOARD)/$(CB_OUTPUT_FILE)
all: $(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom
$(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom: $(board_build)/$(CB_OUTPUT_FILE)
$(call do,DD 4MB,$@,dd of=$@ if=$< bs=65536 count=64 skip=128 status=none)
@sha256sum $@
@sha256sum $@ | tee -a "$(HASHES)"
17 changes: 10 additions & 7 deletions boards/t430-dgpu-maximized/t430-dgpu-maximized.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export CONFIG_COREBOOT_VERSION=4.13
export CONFIG_LINUX_VERSION=4.14.62

CONFIG_COREBOOT_CONFIG=config/coreboot-t430-dgpu-maximized.config
CONFIG_LINUX_CONFIG=config/linux-x230.config
CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config

#Additional hardware support
CONFIG_LINUX_USB=y
Expand Down Expand Up @@ -79,12 +79,15 @@ export CONFIG_FLASHROM_OPTIONS="--force --noverify-all -p internal"
#
# When flashing via an external programmer it is easiest to have
# two separate files for these pieces.
all: $(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom
$(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom: $(build)/$(BOARD)/$(CB_OUTPUT_FILE)
all: $(board_build)/$(CB_OUTPUT_FILE)
@sha256sum $@ | tee -a "$(HASHES)"

all: $(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom
$(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom: $(board_build)/$(CB_OUTPUT_FILE)
$(call do,DD 8MB,$@,dd of=$@ if=$< bs=65536 count=128 skip=0 status=none)
@sha256sum $@
@sha256sum $@ | tee -a "$(HASHES)"

all: $(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom
$(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom: $(build)/$(BOARD)/$(CB_OUTPUT_FILE)
all: $(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom
$(board_build)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom: $(board_build)/$(CB_OUTPUT_FILE)
$(call do,DD 4MB,$@,dd of=$@ if=$< bs=65536 count=64 skip=128 status=none)
@sha256sum $@
@sha256sum $@ | tee -a "$(HASHES)"
14 changes: 7 additions & 7 deletions config/coreboot-t430-dgpu-hotp-maximized.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ CONFIG_STATIC_OPTION_TABLE=y
CONFIG_VENDOR_LENOVO=y
CONFIG_NO_POST=y
CONFIG_CBFS_SIZE=0xB80000
CONFIG_IFD_BIN_PATH="../../blobs/xx30/ifd.bin"
CONFIG_ME_BIN_PATH="../../blobs/xx30/me.bin"
CONFIG_GBE_BIN_PATH="../../blobs/xx30/gbe.bin"
CONFIG_IFD_BIN_PATH="@BLOB_DIR@/xx30/ifd.bin"
CONFIG_ME_BIN_PATH="@BLOB_DIR@/xx30/me.bin"
CONFIG_GBE_BIN_PATH="@BLOB_DIR@/xx30/gbe.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_LENOVO_THINKPAD_T430=y
CONFIG_LINUX_COMMAND_LINE="intel_iommu=igfx_off quiet"
Expand All @@ -15,15 +15,15 @@ CONFIG_HAVE_ME_BIN=y
CONFIG_HAVE_GBE_BIN=y
CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y
CONFIG_VGA_BIOS_DGPU_ID="10de,0def"
CONFIG_VGA_BIOS_DGPU_FILE="../../blobs/xx30/10de,0def.rom"
CONFIG_VGA_BIOS_DGPU_FILE="@BLOB_DIR@/xx30/10de,0def.rom"
CONFIG_VGA_BIOS=y
CONFIG_VGA_BIOS_FILE="../../blobs/xx30/8086,0106.rom"
CONFIG_VGA_BIOS_FILE="@BLOB_DIR@/xx30/8086,0106.rom"
# CONFIG_VGA_BIOS_SECOND is not set
CONFIG_VGA_ROM_RUN_DEFAULT=y
CONFIG_VGA_BIOS_DGPU=y
CONFIG_DRIVERS_PS2_KEYBOARD=y
CONFIG_TPM_MEASURED_BOOT=y
CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x80000
CONFIG_PAYLOAD_LINUX=y
CONFIG_PAYLOAD_FILE="../../build/t430-dgpu-hotp-maximized/bzImage"
CONFIG_LINUX_INITRD="../../build/t430-dgpu-hotp-maximized/initrd.cpio.xz"
CONFIG_PAYLOAD_FILE="@BOARD_BUILD_DIR@/bzImage"
CONFIG_LINUX_INITRD="@BOARD_BUILD_DIR@/initrd.cpio.xz"
14 changes: 7 additions & 7 deletions config/coreboot-t430-dgpu-maximized.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ CONFIG_STATIC_OPTION_TABLE=y
CONFIG_VENDOR_LENOVO=y
CONFIG_NO_POST=y
CONFIG_CBFS_SIZE=0xB80000
CONFIG_IFD_BIN_PATH="../../blobs/xx30/ifd.bin"
CONFIG_ME_BIN_PATH="../../blobs/xx30/me.bin"
CONFIG_GBE_BIN_PATH="../../blobs/xx30/gbe.bin"
CONFIG_IFD_BIN_PATH="@BLOB_DIR@/xx30/ifd.bin"
CONFIG_ME_BIN_PATH="@BLOB_DIR@/xx30/me.bin"
CONFIG_GBE_BIN_PATH="@BLOB_DIR@/xx30/gbe.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_LENOVO_THINKPAD_T430=y
CONFIG_LINUX_COMMAND_LINE="intel_iommu=igfx_off quiet"
Expand All @@ -15,15 +15,15 @@ CONFIG_HAVE_ME_BIN=y
CONFIG_HAVE_GBE_BIN=y
CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y
CONFIG_VGA_BIOS_DGPU_ID="10de,0def"
CONFIG_VGA_BIOS_DGPU_FILE="../../blobs/xx30/10de,0def.rom"
CONFIG_VGA_BIOS_DGPU_FILE="@BLOB_DIR@/xx30/10de,0def.rom"
CONFIG_VGA_BIOS=y
CONFIG_VGA_BIOS_FILE="../../blobs/xx30/8086,0106.rom"
CONFIG_VGA_BIOS_FILE="@BLOB_DIR@/xx30/8086,0106.rom"
# CONFIG_VGA_BIOS_SECOND is not set
CONFIG_VGA_ROM_RUN_DEFAULT=y
CONFIG_VGA_BIOS_DGPU=y
CONFIG_DRIVERS_PS2_KEYBOARD=y
CONFIG_TPM_MEASURED_BOOT=y
CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x80000
CONFIG_PAYLOAD_LINUX=y
CONFIG_PAYLOAD_FILE="../../build/t430-dgpu-maximized/bzImage"
CONFIG_LINUX_INITRD="../../build/t430-dgpu-maximized/initrd.cpio.xz"
CONFIG_PAYLOAD_FILE="@BOARD_BUILD_DIR@/bzImage"
CONFIG_LINUX_INITRD="@BOARD_BUILD_DIR@/initrd.cpio.xz"

0 comments on commit c8d2950

Please sign in to comment.