@@ -453,6 +453,57 @@ the touchpad firmware, otherwise the touchpad will not work."
453
453
fi
454
454
}
455
455
456
+ # ######################
457
+ # Upgrade Touchpad FW #
458
+ # ######################
459
+ function upgrade_touchpad_fw()
460
+ {
461
+ # offer to upgrade touchpad firmware on EVE
462
+ if [[ " ${device^^} " = " EVE" ]]; then
463
+ echo_green " \nUpgrade Touchpad Firmware"
464
+ echo_yellow " If you plan to restore ChromeOS on your Pixelbook, it is necessary to upgrade
465
+ the touchpad firmware, otherwise the touchpad will not work."
466
+ echo_yellow " You should do this after restoring the stock firmware, but before rebooting."
467
+ read -rep " Do you wish to upgrade the touchpad firmware now? [y/N] "
468
+ if [[ " $REPLY " = " y" || " $REPLY " = " Y" ]] ; then
469
+ # ensure firmware write protect disabled
470
+ [[ " $wpEnabled " = true ]] && { exit_red " \nHardware write-protect enabled, cannot upgrade touchpad firmware." ; return 1; }
471
+ # download TP firmware
472
+ echo_yellow " \nDownloading touchpad firmware\n(${touchpad_eve_fw_stock} )"
473
+ $CURL -s -LO " ${other_source}${touchpad_eve_fw_stock} "
474
+ $CURL -s -LO " ${other_source}${touchpad_eve_fw_stock} .sha1"
475
+ # verify checksum on downloaded file
476
+ if sha1sum -c ${touchpad_eve_fw_stock} .sha1 > /dev/null 2>&1 ; then
477
+ # flash TP firmware
478
+ echo_green " Flashing touchpad firmware -- do not touch the touchpad while updating!"
479
+ if ${flashromcmd/ ${flashrom_programmer} } -p ec:type=tp -i EC_RW -w ${touchpad_eve_fw_stock} -o /tmp/flashrom.log > /dev/null 2>&1 ; then
480
+ echo_green " Touchpad firmware successfully upgraded."
481
+ echo_yellow " Please reboot your Pixelbook now."
482
+ else
483
+ # try with older eve flashrom
484
+ [[ " $isChromeOS " == " true" ]] && tpPath=" /usr/local/bin" || tpPath=" /tmp"
485
+ (
486
+ cd $tpPath
487
+ $CURL -sLO " ${util_source} flashrom_eve_tp"
488
+ chmod +x flashrom_eve_tp
489
+ )
490
+ if $tpPath /flashrom_eve_tp -p ec:type=tp -i EC_RW -w ${touchpad_eve_fw_stock} -o /tmp/flashrom.log > /dev/null 2>&1 ; then
491
+ echo_green " Touchpad firmware successfully upgraded."
492
+ echo_yellow " Please reboot your Pixelbook now."
493
+ else
494
+ echo_red " Error flashing touchpad firmware:"
495
+ cat /tmp/flashrom.log
496
+ echo_yellow " \nThis function sometimes doesn't work under Linux, in which case it is\nrecommended to try under ChromeOS."
497
+ fi
498
+ fi
499
+ else
500
+ echo_red " Touchpad firmware download checksum fail; download corrupted, cannot flash."
501
+ fi
502
+ fi
503
+ read -rep " Press [Enter] to return to the main menu."
504
+ fi
505
+ }
506
+
456
507
# #########################
457
508
# Restore Stock Firmware #
458
509
# #########################
@@ -950,6 +1001,7 @@ function stock_menu() {
950
1001
fi
951
1002
if [[ " ${device^^} " = " EVE" ]]; then
952
1003
echo -e " ${MENU} **${WP_TEXT} [WP]${NUMBER} D)${MENU} Downgrade Touchpad Firmware ${NORMAL} "
1004
+ echo -e " ${MENU} **${WP_TEXT} [WP]${NUMBER} U)${MENU} Upgrade Touchpad Firmware ${NORMAL} "
953
1005
fi
954
1006
if [[ " $unlockMenu " = true || ( " $isFullRom " = false && " $isBootStub " = false ) ]]; then
955
1007
echo -e " ${MENU} **${WP_TEXT} [WP]${NUMBER} 3)${MENU} Set Boot Options (GBB flags) ${NORMAL} "
@@ -993,6 +1045,12 @@ function stock_menu() {
993
1045
menu_fwupdate
994
1046
;;
995
1047
1048
+ [uU]) if [[ " ${device^^} " = " EVE" ]]; then
1049
+ upgrade_touchpad_fw
1050
+ fi
1051
+ menu_fwupdate
1052
+ ;;
1053
+
996
1054
3) if [[ " $unlockMenu " = true || " $isChromeOS " = true || " $isUnsupported " = false \
997
1055
&& " $isFullRom " = false && " $isBootStub " = false ]]; then
998
1056
set_boot_options
@@ -1066,6 +1124,7 @@ function uefi_menu() {
1066
1124
fi
1067
1125
if [[ " ${device^^} " = " EVE" ]]; then
1068
1126
echo -e " ${MENU} **${WP_TEXT} [WP]${NUMBER} D)${MENU} Downgrade Touchpad Firmware ${NORMAL} "
1127
+ echo -e " ${MENU} **${WP_TEXT} [WP]${NUMBER} U)${MENU} Upgrade Touchpad Firmware ${NORMAL} "
1069
1128
fi
1070
1129
if [[ " $unlockMenu " = true || " $isUEFI " = true ]]; then
1071
1130
echo -e " ${MENU} **${WP_TEXT} ${NUMBER} C)${MENU} Clear UEFI NVRAM ${NORMAL} "
@@ -1098,6 +1157,13 @@ function uefi_menu() {
1098
1157
uefi_menu
1099
1158
;;
1100
1159
1160
+ [uU]) if [[ " ${device^^} " = " EVE" ]]; then
1161
+ upgrade_touchpad_fw
1162
+ fi
1163
+ uefi_menu
1164
+ ;;
1165
+
1166
+
1101
1167
[rR]) echo -e " \nRebooting...\n" ;
1102
1168
cleanup
1103
1169
reboot
0 commit comments