@@ -14,10 +14,19 @@ TBFW_SIZE=1048575
1414ME_DOWNLOAD_HASH=" ddfbc51430699e0dfcb24a60bcb5b6e5481b325ebecf1ac177e069013189e4b0"
1515# ...and the cleaned and deguarded version from that blob.
1616DEGUARDED_ME_BIN_HASH=" 1990b42df67ba70292f4f6e2660efb909917452dcb9bd4b65ea2f86402cfa16b"
17- # Integrity checks for the vendor provided Thunderbolt blob...
18- TB_DOWNLOAD_HASH=" a500a93fe6a3728aa6676c70f98cf46785ef15da7c5b1ccd7d3a478d190a28a8"
19- # ...and the padded and flashable version from that blob.
20- TB_BIN_HASH=" fc9c47ff4b16f036a7f49900f9da1983a5db44ca46156238b7b42e636d317388"
17+
18+ if [[ " ${BOARD} " == " t480-" * ]]; then
19+ # Integrity checks for the vendor provided Thunderbolt blob...
20+ TB_DOWNLOAD_HASH=" a500a93fe6a3728aa6676c70f98cf46785ef15da7c5b1ccd7d3a478d190a28a8"
21+ # ...and the padded and flashable version from that blob.
22+ TB_BIN_HASH=" fc9c47ff4b16f036a7f49900f9da1983a5db44ca46156238b7b42e636d317388"
23+ elif [[ " ${BOARD} " == " t480s" * ]]; then
24+ # Integrity checks for the vendor provided Thunderbolt blob...
25+ TB_DOWNLOAD_HASH=" 090d0085af4a20bcdfba8a75f1bce735ff80afbfea968bbe276a80a0c4c18706"
26+ # ...and the padded and flashable version from that blob.
27+ TB_BIN_HASH=" b53e4670327e076ef879b2abef0efd9aade20da88d0c0976921b9f32378c0119"
28+ fi
29+
2130
2231function usage() {
2332 echo -n \
@@ -116,18 +125,33 @@ function download_and_pad_tb() {
116125 # extract the TB blob.
117126 pushd " $( mktemp -d) " || exit
118127
119- # Download the installer that contains the TB blob
120- tb_installer_filename=" " n24th13w.exe" "
121- user_agent=" Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
122- curl -A " $user_agent " -s -O " https://download.lenovo.com/pccbbs/mobiles/${tb_installer_filename} "
123- chk_sha256sum " $TB_DOWNLOAD_HASH " " $tb_installer_filename "
124-
125- # https://www.reddit.com/r/thinkpad/comments/9rnimi/ladies_and_gentlemen_i_present_to_you_the/
126- innoextract n24th13w.exe -d .
127- mv ./code\$ GetExtractPath\$ /TBT.bin tb.bin
128- # pad with zeros
129- dd if=/dev/zero of=tb.bin bs=1 seek=" $TBFW_SIZE " count=1
130- mv " tb.bin" " $tb_output "
128+ if [[ " ${BOARD} " == " t480-" * ]]; then
129+ # Download the installer that contains the TB blob
130+ tb_installer_filename=" " n24th13w.exe" "
131+ user_agent=" Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
132+ curl -A " $user_agent " -s -O " https://download.lenovo.com/pccbbs/mobiles/${tb_installer_filename} "
133+ chk_sha256sum " $TB_DOWNLOAD_HASH " " $tb_installer_filename "
134+
135+ # https://www.reddit.com/r/thinkpad/comments/9rnimi/ladies_and_gentlemen_i_present_to_you_the/
136+ innoextract n24th13w.exe -d .
137+ mv ./code\$ GetExtractPath\$ /TBT.bin tb.bin
138+ # pad with zeros
139+ dd if=/dev/zero of=tb.bin bs=1 seek=" $TBFW_SIZE " count=1
140+ mv " tb.bin" " $tb_output "
141+ elif [[ " ${BOARD} " == " t480s" * ]]; then
142+ # Download the installer that contains the T480s TB blob
143+ tb_installer_filename=" " n22th11w.exe" "
144+ user_agent=" Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
145+ curl -A " $user_agent " -s -O " https://download.lenovo.com/pccbbs/mobiles/${tb_installer_filename} "
146+ chk_sha256sum " $TB_DOWNLOAD_HASH " " $tb_installer_filename "
147+
148+ # https://www.reddit.com/r/thinkpad/comments/9rnimi/ladies_and_gentlemen_i_present_to_you_the/
149+ innoextract n22th11w.exe -d .
150+ mv ./code\$ GetExtractPath\$ /TBT.bin tb.bin
151+ # pad with zeros
152+ dd if=/dev/zero of=tb.bin bs=1 seek=" $TBFW_SIZE " count=1
153+ mv " tb.bin" " $tb_output "
154+ fi
131155
132156 rm -rf ./*
133157 popd || exit
0 commit comments