@@ -37,6 +37,7 @@ static EC2ROM: &'static str = concat!("\\", env!("BASEDIR"), "\\firmware\\ec2.ro
3737static FIRMWAREDIR : & ' static str = concat ! ( "\\ " , env!( "BASEDIR" ) , "\\ firmware" ) ;
3838static FIRMWARENSH : & ' static str = concat ! ( "\\ " , env!( "BASEDIR" ) , "\\ res\\ firmware.nsh" ) ;
3939static FIRMWAREROM : & ' static str = concat ! ( "\\ " , env!( "BASEDIR" ) , "\\ firmware\\ firmware.rom" ) ;
40+ static H2OFFT : & ' static str = concat ! ( "\\ " , env!( "BASEDIR" ) , "\\ firmware\\ h2offt.efi" ) ;
4041static IFLASHV : & ' static str = concat ! ( "\\ " , env!( "BASEDIR" ) , "\\ firmware\\ iflashv.efi" ) ;
4142static IFLASHVTAG : & ' static str = concat ! ( "\\ " , env!( "BASEDIR" ) , "\\ firmware\\ iflashv.tag" ) ;
4243static IPXEEFI : & ' static str = concat ! ( "\\ " , env!( "BASEDIR" ) , "\\ firmware\\ ipxe.efi" ) ;
@@ -218,6 +219,7 @@ fn inner() -> Result<()> {
218219 } else if ! validations. iter ( ) . any ( |v| * v == ValidateKind :: Found ) {
219220 "* No updates were found *"
220221 } else {
222+ let mut setup_menu = false ;
221223 let c = if find ( ECTAG ) . is_ok ( ) {
222224 // Attempt to remove EC tag
223225 let _ = shell ( & format ! ( "{} {} ec tag" , FIRMWARENSH , FIRMWAREDIR ) ) ;
@@ -227,7 +229,8 @@ fn inner() -> Result<()> {
227229 validations. clear ( ) ;
228230 '\n'
229231 } else if find ( MESETTAG ) . is_ok ( ) {
230- // Skip enter if in manufacturing mode
232+ // Skip enter if ME unlocked, and boot into firmware setup to disable ME
233+ setup_menu = true ;
231234 '\n'
232235 } else if find ( IFLASHVTAG ) . is_ok ( ) {
233236 // Skip enter if flashing a meer5 and flashing already occured
@@ -277,14 +280,16 @@ fn inner() -> Result<()> {
277280 }
278281 }
279282
280- let supported = get_os_indications_supported ( ) . unwrap_or ( 0 ) ;
281- if supported & 1 == 1 {
282- println ! ( "Booting into BIOS setup on next boot" ) ;
283- let mut indications = get_os_indications ( ) . unwrap_or ( 0 ) ;
284- indications |= 1 ;
285- set_os_indications ( Some ( indications) ) ?;
286- } else {
287- println ! ( "Cannot boot into BIOS setup automatically" ) ;
283+ if setup_menu {
284+ let supported = get_os_indications_supported ( ) . unwrap_or ( 0 ) ;
285+ if supported & 1 == 1 {
286+ println ! ( "Booting into BIOS setup on next boot" ) ;
287+ let mut indications = get_os_indications ( ) . unwrap_or ( 0 ) ;
288+ indications |= 1 ;
289+ set_os_indications ( Some ( indications) ) ?;
290+ } else {
291+ println ! ( "Cannot boot into BIOS setup automatically" ) ;
292+ }
288293 }
289294
290295 "* All updates applied successfully *"
@@ -312,7 +317,11 @@ fn inner() -> Result<()> {
312317 }
313318 }
314319
315- if shutdown {
320+ if find ( H2OFFT ) . is_ok ( ) {
321+ // H2OFFT will automatically shut down, so skip success confirmation
322+ println ! ( "System will reboot in 5 seconds to perform capsule update" ) ;
323+ let _ = ( std:: system_table ( ) . BootServices . Stall ) ( 5_000_000 ) ;
324+ } else if shutdown {
316325 println ! ( "Press any key to shutdown..." ) ;
317326 raw_key ( ) ?;
318327
0 commit comments