forked from sindygong/testgit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ME11R6VPRO.nsh
1861 lines (1625 loc) · 58.7 KB
/
ME11R6VPRO.nsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
##########################################################################################
# ME11R6VPRO.NSH - EFI Shell Script for Intel Kabylake ME 11.6 MFG Flow at Box MFG
#
# Usage: ME11R6VPRO.NSH FW_PKG FW_BLD FW_VER FW_MODE SKU_CFG LK_CTRL [ToolPath] [LogPath]
#
# where FW_PKG(%1) - Name of ME FW Package
# FW_BLD(%2) - MEFW Build ID to be updated
# FW_VER(%3) - MEFW Version to be verified
# FW_MODE(%4) - ME FW Update Mode
# FORCE - Always update FW regardless of current FW version
# (Only when the flash descriptor was still unlocked)
# AUTO - Update FW only when FW version does not match with
# the expected version
# SKU_CFG(%5) - vPro/Non-vPro SKU Configuration for Shipment
# VPRO - Configure as vPro System
# VPRONOWLAN - Configure as vPro System w/o WLAN (for Shell)
# NONVPRO - Configure as Non-vPro System
# LK_CTRL(%6) - Flash Descriptor Lock-down control (LOCK/UNLOCK)
# LOCK will be set as default if not specified
# ToolPath(%7) - Folder where all required tool reside
# Current working folder shall be used as Default if not specified
# LogPath(%8) - Destination folder where Test Log/Result file shall be created
# Current working folder shall be used as Default if not specified
#
# Output:
# TESTER.LOG - Test Log
# ME11R6VPRO.DON - Test Result Flag for PASS case
# ME11R6VPRO.ERR - Test Result Flag for FAIL case
#
# Support ME FW:
#
# FW Build ID Product MEFW SKU %MEFW_SKU% %PCH_SKU%
# -------------- ------------- ---------- ---------- ---------
# R0IMBxxW WV-4 Corporate VPRO LP
# R0INBxxW WV-4 Consumer NONVPRO LP
# R0GMVxxW Larue-3 Corporate VPRO LP
# R0GMFxxW Larue-3 Consumer NONVPRO LP
# N1MRMxxW Yoda-1 Corporate VPRO LP
# N1MRNxxW Yoda-1 Consumer NONVPRO LP
# N1QRMxxW Windu-1 Corporate VPRO LP
# N1QRNxxW Windu-1 Consumer NONVPRO LP
# N1WRMxxW Thorpe-2 Corporate VPRO LP
# N1WRNxxW Thorpe-2 Consumer NONVPRO LP
# R0FMVxxW Taylor-2 Corporate VPRO H
# R0FMFxxW Taylor-2 Consumer NONVPRO H
# N1URMxxW Walter/Payton-2 Corporate VPRO H
# N1URNxxW Walter/Payton-2 Consumer NONVPRO H
# R0HRMxxW Storm-2 Corporate VPRO LP
# R0HRNxxW Storm-2 Consumer NONVPRO LP
# N1NRMxxW Raven-2 Corporate VPRO LP
# N1NRNxxW Raven-2 Consumer NONVPRO LP
# N1XRMxxW LIN-2 Corporate VPRO LP
# N1XRNxxW LIN-2 Consumer NONVPRO LP
#
# Support Products:
# - WV-4 (R0IMBxxW/R0INBxxW)
# - Larue-3 (R0GMVxxW/R0GMFxxW)
# - Yoda-1 (N1MRMxxW/N1MRNxxW)
# - Windu-1 (N1QRMxxW/N1QRNxxW)
# - Thorpe-2 (N1WRMxxW/N1WRNxxW)
# - Taylor-2 (R0FMVxxW/R0FMFxxW)
# - Walter/Payton-2 (N1URMxxW/N1URNxxW)
# - Storm-2 (R0HRMxxW/R0HRNxxW)
# - Raven-2 (N1NRMxxW/N1NRNxxW)
# - LIN-2 (N1XRMxxW/N1XRNxxW)
#
# History:
# 2016-08-29 S.Ikeda Initial based on below ME11.6 MFG FLOW
# KBL_Intel ME 11.6 MFG Flow_2016.08.26_Yoda1_Raven2.xlsx
# KBL_Intel ME 11.6 MFG Flow_2016.08.18_LCFC.xlsx (Windu-1/PTWT-2)
# 2016-09-06 S.Ikeda Fixed invalid option to chkdesc.efi at PCH_VER check step
# option must be lower case
# 2016-11-09 S.Ikeda Added Step9_5 for Global Reset after Wireless u-code update
# based on the updated ME11.6 MFG FLOW below
# KBL_Intel ME 11.6 MFG Flow_2016.11.09_Yoda1_Raven2_v2.xlsx
# 2016-11-10 S.Ikeda Added the code to initialize desc.bin/me.bin/me_upd.bin on root folder
# Added the code to handle desc_LK.bin as default descriptor file name
# for some MEFW packages
# 2017-01-18 S.Ikeda Added ME Unconfiguration Step into STEP1
# for vPro customization order support in MP
# 2017-02-12 S.Ikeda Added descriptor condition check at STEP11
# to handle system with ME locked already
# 2017-02-13 Jacky.L Update Validation for Specified MEFW Package against Target System for Thorpe-2
# 2017-02-13 Jacky.L Update Use Method for Variables to Fix "Syntax after analyzing ==" error with using UDK UEFI SHELL.
# 2017-04-10 Jacky.L Update Validation for Specified MEFW Package against Target System for WV3/Larue-3/Taylor-2/Walter-2/Patyon-2
# 2017-05-16 Sindy.G Update Validation for Specified MEFW Package against Target System for Storm-2
# 2017-06-06 Sindy.G Update Validation for Specified MEFW Package against Target System for Raven-2
# 2017-05-23 S.Ikeda Added the code to use MEINFO.OVR as MEINFO.EFI if exist
# This is temp W/A for the issue of MEINFO.EFI v11.6.29.3287
# 2017-07-13 Sindy.G Update Validation for Specified MEFW Package against Target System for LIN-2
# 2017-11-02 S.Ikeda Update for ME 11.8.50.3425 deployment for KBL/SKB
# Removed W/A code for ME 11.6.29.3287
# 2017-11-06 S.Ikeda Update for ME 11.8.50.3425 with following below ME11.x MFG Flow
# KBL_Intel ME 11.x MFG Flow_2017.11.02_Yoda1_Raven2.xlsx
# 2017-11-10 S.Ikeda Added the code to use MEManuf.116 as MEManuf.EFI if descriptor already locked with ME11.6
# KBL_Intel ME 11.x MFG Flow_2017.11.10_Yoda1_Raven2.xlsx
##########################################################################################
echo -off
##########################
# SETUP
##########################
set -v NSHNAME ME11R6VPRO
set -v NSHVER 2017-11-10-Rev.0
set -v LOGPATH %cwd%
set -v TOOLPATH %cwd%
set -v ORGCWD %cwd%
set -v DLY 10
# Setup for LogPath(%8)
if not %8 == "" then
set -v LOGPATH %8
endif
if not %7 == "" then
set -v TOOLPATH %7
goto PATH_DEFD
else
if not %6 == "" then
goto PATH_DEFD
else
goto E_FEWOPT
endif
endif
:PATH_DEFD
# Setup for FW_PKG(%1)
if not exist %TOOLPATH%%1\FPT.EFI then
goto E_NOPKG
else
set -v MEFWPATH %TOOLPATH%%1\
endif
# Setup FW_BLD(%2)
set -v FW_BLD %2
# Setup FW_VER(%3)
set -v FW_VER %3
# Setup FW_MODE(%4)
if %4 == AUTO then
set -v FW_MODE AUTO
else
if %4 == FORCE then
set -v FW_MODE FORCE
else
goto E_INVOPT
endif
endif
# Setup SKU_CFG(%5)
if %5 == VPRO then
set -v SKU_CFG VPRO
set -v WLAN_CFG WLAN
else
if %5 == VPRONOWLAN then
set -v SKU_CFG VPRO
set -v WLAN_CFG NOWLAN
else
if %5 == NONVPRO then
set -v SKU_CFG NONVPRO
else
goto E_INVOPT
endif
endif
endif
# Setup LK_CTRL(%6)
if %6 == LOCK then
set -v LK_CTRL LOCK
else
if %6 == UNLOCK then
set -v LK_CTRL UNLOCK
else
goto E_INVOPT
endif
endif
# Initialization for Flag File
if exist %LOGPATH%%NSHNAME%.ERR then
del %LOGPATH%%NSHNAME%.ERR
endif
if exist %LOGPATH%%NSHNAME%.DON then
del %LOGPATH%%NSHNAME%.DON
endif
##########################
# START
##########################
date >>a %LOGPATH%TESTER.LOG
time >>a %LOGPATH%TESTER.LOG
echo "Running ME11R6VPRO.NSH -- Dated %NSHVER%"
echo ==================================================================
echo %0 %1 %2 %3 %4 %5 %6 %7 %8
#@si20170118c
echo (Executed from %ORGCWD%)
echo ==================================================================
echo "Running ME11R6VPRO.NSH -- Dated %NSHVER%" >>a %LOGPATH%TESTER.LOG
echo ================================================================== >>a %LOGPATH%TESTER.LOG
echo %0 %1 %2 %3 %4 %5 %6 %7 %8 (Executed from %ORGCWD%) >>a %LOGPATH%TESTER.LOG
echo ================================================================== >>a %LOGPATH%TESTER.LOG
##############################################################
# Preparation/Validation for Required Files/Tools
##############################################################
echo .
echo "Checking for ME FW Utility Package Folder (%MEFWPATH%) ..."
echo "Checking for ME FW Utility Package Folder (%MEFWPATH%) ..." >>a %LOGPATH%TESTER.LOG
if not exist %MEFWPATH%MEINFO.EFI then
goto E_NOPKG
endif
echo .
echo "Copying Other Required Tools in %TOOLPATH% to %MEFWPATH% ..."
echo "Copying Other Required Tools in %TOOLPATH% to %MEFWPATH% ..." >>a %LOGPATH%TESTER.LOG
copy -q %TOOLPATH%FINDSTRG.EFI %MEFWPATH%
copy -q %TOOLPATH%ACSTAT.EFI %MEFWPATH%
copy -q %TOOLPATH%TPMFGFLG.EFI %MEFWPATH%
copy -q %TOOLPATH%MEMFGCTL.EFI %MEFWPATH%
copy -q %TOOLPATH%DELAY.EFI %MEFWPATH%
##@si20171102c -START-
##@si20170523c -START-
#if exist %TOOLPATH%MEINFO.OVR then
# echo .
# echo "Copying %TOOLPATH%MEINFO.OVR as %MEFWPATH%MEINFO.EFI ..."
# echo "Copying %TOOLPATH%MEINFO.OVR as %MEFWPATH%MEINFO.EFI ..." >>a %LOGPATH%TESTER.LOG
# copy -q %TOOLPATH%MEINFO.OVR %MEFWPATH%
# cd %MEFWPATH%
# if not exist MEINFO.ORG then
# copy -q MEINFO.EFI MEINFO.ORG
# endif
# copy -q MEINFO.OVR MEINFO.EFI
# cd %ORGCWD%
#endif
##@si20170523c -END-
##@si20171102c -END-
##@si20171110c -START-
if exist %TOOLPATH%MEManuf.116 then
if not exist %MEFWPATH%MEManuf.116 then
echo .
echo "Copying %TOOLPATH%MEManuf.116 as %MEFWPATH%..."
echo "Copying %TOOLPATH%MEManuf.116 as %MEFWPATH% ..." >>a %LOGPATH%TESTER.LOG
copy -q %TOOLPATH%MEManuf.116 %MEFWPATH%
endif
if not exist %MEFWPATH%vsccommn.116 then
echo .
echo "Copying %TOOLPATH%vsccommn.116 as %MEFWPATH%..."
echo "Copying %TOOLPATH%vsccommn.116 as %MEFWPATH% ..." >>a %LOGPATH%TESTER.LOG
copy -q %TOOLPATH%vsccommn.116 %MEFWPATH%
endif
endif
##@si20171110c -END-
echo .
echo "Verifying for Other Required Tools in ME Package Folder %MEFWPATH% ..."
echo "Verifying for Other Required Tools in ME Package Folder %MEFWPATH% ..." >>a %LOGPATH%TESTER.LOG
if not exist %TOOLPATH%FINDSTRG.EFI then
goto E_NOTOOL
endif
if not exist %TOOLPATH%ACSTAT.EFI then
goto E_NOTOOL
endif
if not exist %TOOLPATH%TPMFGFLG.EFI then
goto E_NOTOOL
endif
if not exist %TOOLPATH%MEMFGCTL.EFI then
goto E_NOTOOL
endif
if not exist %TOOLPATH%DELAY.EFI then
goto E_NOTOOL
endif
if not exist %TOOLPATH%PhyID64e.efi then
goto E_NOTOOL
endif
echo .
echo "Verified. OK"
echo "Verified. OK" >>a %LOGPATH%TESTER.LOG
# Move CWD to ME FW Package Folder
cd %MEFWPATH%
##############################################################
# Validation for Specified MEFW Package against Target System
##############################################################
echo .
echo "Verifying for the specified ME PKG(%FW_BLD%) against ME on Target System ..."
echo "Verifying for the specified ME PKG(%FW_BLD%) against ME on Target System ..." >>a %LOGPATH%TESTER.LOG
# Note - Redirect output needs to be ASCII text format with 'a'
CHKDESC.EFI >a CHKDESC.LOG
echo %FW_BLD% >a FW_BLD.LOG
##@SG20170713 -START-
# LIN-2 N1XRMxxW - VPRO MEFW
:N1XRMxxW
FINDSTRG.EFI "OEMdata0 = N1XRM" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto N1XRNxxW
endif
FINDSTRG.EFI "N1XRM" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU VPRO
set -v PCH_SKU LP
set -v BLD_ID N1X
goto PKGVFYOK
# LIN-2 N1XRNxxW - NON-VPRO MEFW
:N1XRNxxW
FINDSTRG.EFI "OEMdata0 = N1XRN" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto N1NRMxxW
endif
FINDSTRG.EFI "N1XRN" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU NONVPRO
set -v PCH_SKU LP
set -v BLD_ID N1X
goto PKGVFYOK
##@SG20170713 -END-
##@SG20170606 -START-
# RVN-2 N1NRMxxW - VPRO MEFW
:N1NRMxxW
FINDSTRG.EFI "OEMdata0 = N1NRM" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto N1NRNxxW
endif
FINDSTRG.EFI "N1NRM" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU VPRO
set -v PCH_SKU LP
set -v BLD_ID N1N
goto PKGVFYOK
# RVN-2 N1NRNxxW - NON-VPRO MEFW
:N1NRNxxW
FINDSTRG.EFI "OEMdata0 = N1NRN" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto R0HRMxxW
endif
FINDSTRG.EFI "N1NRN" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU NONVPRO
set -v PCH_SKU LP
set -v BLD_ID N1N
goto PKGVFYOK
##@SG20170606 -END-
##@SG20170516 -START-
# STM-2 R0HRMxxW - VPRO MEFW
:R0HRMxxW
FINDSTRG.EFI "OEMdata0 = R0HRM" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto R0HRNxxW
endif
FINDSTRG.EFI "R0HRM" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU VPRO
set -v PCH_SKU LP
set -v BLD_ID R0H
goto PKGVFYOK
# STM-2 R0HRNxxW - NON-VPRO MEFW
:R0HRNxxW
FINDSTRG.EFI "OEMdata0 = R0HRN" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto R0IMBxxW
endif
FINDSTRG.EFI "R0HRN" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU NONVPRO
set -v PCH_SKU LP
set -v BLD_ID R0H
goto PKGVFYOK
##@SG20170606 -END-
# WV-4 R0IMBxxW - VPRO MEFW
:R0IMBxxW
FINDSTRG.EFI "OEMdata0 = R0IMB" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto R0INBxxW
endif
FINDSTRG.EFI "R0IMB" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU VPRO
set -v PCH_SKU LP
set -v BLD_ID R0I
goto PKGVFYOK
# WV-4 R0INBxxW - NON-VPRO MEFW
:R0INBxxW
FINDSTRG.EFI "OEMdata0 = R0INB" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto R0GMVxxW
endif
FINDSTRG.EFI "R0INB" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU NONVPRO
set -v PCH_SKU LP
set -v BLD_ID R0I
goto PKGVFYOK
# Larue-3 R0GMVxxW - VPRO MEFW
:R0GMVxxW
FINDSTRG.EFI "OEMdata0 = R0GMV" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto R0GMFxxW
endif
FINDSTRG.EFI "R0GMV" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU VPRO
set -v PCH_SKU LP
set -v BLD_ID R0G
goto PKGVFYOK
# Larue-3 R0GMFxxW - NON-VPRO MEFW
:R0GMFxxW
FINDSTRG.EFI "OEMdata0 = R0GMF" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto N1MRMxxW
endif
FINDSTRG.EFI "R0GMF" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU NONVPRO
set -v PCH_SKU LP
set -v BLD_ID R0G
goto PKGVFYOK
# Yoda-1 N1MRMxxW - VPRO MEFW
:N1MRMxxW
FINDSTRG.EFI "OEMdata0 = N1MRM" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto N1MRNxxW
endif
FINDSTRG.EFI "N1MRM" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU VPRO
set -v PCH_SKU LP
set -v BLD_ID N1M
goto PKGVFYOK
# Yoda-1 N1MRNxxW - Non-VPRO MEFW
:N1MRNxxW
FINDSTRG.EFI "OEMdata0 = N1MRN" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto N1QRMxxW
endif
FINDSTRG.EFI "N1MRN" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU NONVPRO
set -v PCH_SKU LP
set -v BLD_ID N1M
goto PKGVFYOK
# Windu-1 N1QRMxxW - VPRO MEFW
:N1QRMxxW
FINDSTRG.EFI "OEMdata0 = N1QRM" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto N1QRNxxW
endif
FINDSTRG.EFI "N1QRM" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU VPRO
set -v PCH_SKU LP
set -v BLD_ID N1Q
goto PKGVFYOK
# Windu-1 N1QRNxxW - NON-VPRO MEFW
:N1QRNxxW
FINDSTRG.EFI "OEMdata0 = N1QRN" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto N1WRMxxW
endif
FINDSTRG.EFI "N1QRN" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU NONVPRO
set -v PCH_SKU LP
set -v BLD_ID N1Q
goto PKGVFYOK
# Thorpe-2 N1WRMxxW - VPRO MEFW
:N1WRMxxW
FINDSTRG.EFI "OEMdata0 = N1WRM" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto N1WRNxxW
endif
FINDSTRG.EFI "N1WRM" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU VPRO
set -v PCH_SKU LP
set -v BLD_ID N1W
goto PKGVFYOK
# Thorpe-2 N1WRNxxW - NON-VPRO MEFW
:N1WRNxxW
FINDSTRG.EFI "OEMdata0 = N1WRN" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto R0FMVxxW
endif
FINDSTRG.EFI "N1WRN" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU NONVPRO
set -v PCH_SKU LP
set -v BLD_ID N1W
goto PKGVFYOK
# Taylor-2 R0FMVxxW - VPRO MEFW
:R0FMVxxW
FINDSTRG.EFI "OEMdata0 = R0FMV" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto R0FMFxxW
endif
FINDSTRG.EFI "R0FMV" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU VPRO
set -v PCH_SKU H
set -v BLD_ID R0F
goto PKGVFYOK
# Taylor-2 R0FMFxxW - NON-VPRO MEFW
:R0FMFxxW
FINDSTRG.EFI "OEMdata0 = R0FMF" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto N1URMxxW
endif
FINDSTRG.EFI "R0FMF" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU NONVPRO
set -v PCH_SKU H
set -v BLD_ID R0F
goto PKGVFYOK
# Walter/Payton-2 N1URMxxW - VPRO MEFW
:N1URMxxW
FINDSTRG.EFI "OEMdata0 = N1URM" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto N1URNxxW
endif
FINDSTRG.EFI "N1URM" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU VPRO
set -v PCH_SKU H
set -v BLD_ID N1U
goto PKGVFYOK
# Walter/Payton-2 N1URNxxW - NON-VPRO MEFW
:N1URNxxW
FINDSTRG.EFI "OEMdata0 = N1URN" CHKDESC.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
FINDSTRG.EFI "N1URN" FW_BLD.LOG /INV >>a %LOGPATH%TESTER.LOG
if not %lasterror% == 0 then
goto E_INVPKG
endif
set -v MEFW_SKU NONVPRO
set -v PCH_SKU H
set -v BLD_ID N1U
goto PKGVFYOK
:PKGVFYOK
echo .
echo "Specified ME PKG(%FW_BLD%) matched with MEFW Build ID on Target System ..."
echo "Specified ME PKG(%FW_BLD%) matched with MEFW Build ID on Target System ..." >>a %LOGPATH%TESTER.LOG
echo "Verified OK."
echo "Verified OK." >>a %LOGPATH%TESTER.LOG
#type CHKDESC.LOG >>a %LOGPATH%TESTER.LOG
#MEINFO.EFI >>a %LOGPATH%TESTER.LOG
# PCH(CPU) Version Check
##@si20160906c
CHKDESC.EFI -oemdata4 ES >>a %LOGPATH%TESTER.LOG
if %lasterror% == 0 then
set -v PCH_VER ES
else
set -v PCH_VER QS
endif
# Log shell variables
echo "============= EFI Shell Variables ============" >>a %LOGPATH%TESTER.LOG
set >>a %LOGPATH%TESTER.LOG
echo "==============================================" >>a %LOGPATH%TESTER.LOG
# AC/DC Presence Check before starting process
echo .
echo "Checking for AC/DC Presence ..."
:NO_AC
DELAY.EFI 3
ACSTAT.EFI ATTACH
if not %lasterror% == 0 then
goto NO_AC
else
echo "Attached. OK"
endif
#############################
# Flow Control
#############################
:FlowDispatch
# Check for Flow Control Flag
if not exist %LOGPATH%AMTSTATE.CTL then
echo "%NSHNAME%.NSH - AMTSTATE.CTL file missing -- Start from STEP1_0"
set AMTSTATE STEP1_0
else
# Check for Test Control Flag
if '%AMTSTATE%' == '' then
echo "%NSHNAME%.NSH - AMTSTATE is NULL -- Set to STEP1_0"
set AMTSTATE STEP1_0
endif
endif
goto %AMTSTATE%
# ========================================================================
# STEP-1 : ME UnConfiguration
# ========================================================================
:STEP1_0
date >>a %LOGPATH%TESTER.LOG
time >>a %LOGPATH%TESTER.LOG
echo [%AMTSTATE%] >>a %LOGPATH%TESTER.LOG
# Initialize Update State Variables
if not '%DESCUPDT%' == '' then
set -d DESCUPDT
endif
if not '%MEFWUPDT%' == '' then
set -d MEFWUPDT
endif
if not '%FWUPDLCL%' == '' then
set -d FWUPDLCL
endif
echo .
echo "STEP:1_0 Logging for Initial Descriptor Status ..."
echo "STEP:1_0 Logging for Initial Descriptor Status ..." >>a %LOGPATH%TESTER.LOG
type CHKDESC.LOG >>a %LOGPATH%TESTER.LOG
echo .
echo "STEP:1_0 Logging for Initial ME Status ..."
echo "STEP:1_0 Logging for Initial ME Status ..." >>a %LOGPATH%TESTER.LOG
MEINFO.EFI >a MEINFO.LOG
if not %lasterror% == 0 then
goto E_MESTAT
endif
type MEINFO.LOG >>a %LOGPATH%TESTER.LOG
#@si20170118c -START-
:STEP1_1
if /i NOT '%LK_CTRL%' == 'LOCK' then
set AMTSTATE STEP2_0
echo %AMTSTATE% >a %LOGPATH%AMTSTATE.CTL
goto IPL
endif
# ME Unconfiguration Request
:STEP1_2
set AMTSTATE STEP1_2
echo %AMTSTATE% >a %LOGPATH%AMTSTATE.CTL
echo .
echo "STEP:1_2 Requesting ME Unconfiguration at next boot ..."
echo "STEP:1_2 Requesting ME Unconfiguration at next boot ..." >>a %LOGPATH%TESTER.LOG
MEMFGCTL.EFI UNCFGME >a MEMFGCTL.Log
if not %lasterror% == 0 then
goto E_EEPLKD
endif
echo "Done."
echo "Done." >>a %LOGPATH%TESTER.LOG
set AMTSTATE STEP1_3
echo %AMTSTATE% >a %LOGPATH%AMTSTATE.CTL
goto IPL
# Clear MFG Mode Flag
:STEP1_3
date >>a %LOGPATH%TESTER.LOG
time >>a %LOGPATH%TESTER.LOG
echo [%AMTSTATE%] >>a %LOGPATH%TESTER.LOG
echo "STEP:1_3 ME Unconfiguration completed! Clearing MFG Mode Flag ..."
echo "STEP:1_3 ME Unconfiguration completed! Clearing MFG Mode Flag ..." >>a %LOGPATH%TESTER.LOG
# Clear MFG Mode Flag to 0x0000 (default) if not cleared yet
TPMFGFLG.EFI /V 0X0000
if not %lasterror% == 0 then
TPMFGFLG.EFI /S 0X0000
endif
echo "Done."
echo "Done." >>a %LOGPATH%TESTER.LOG
set AMTSTATE STEP2_0
echo %AMTSTATE% >a %LOGPATH%AMTSTATE.CTL
goto IPL
#@si20170118c -END-
# ========================================================================
# STEP-2 : Check ME Version
# ========================================================================
:STEP2_0
set AMTSTATE STEP2_0
echo %AMTSTATE% >a %LOGPATH%AMTSTATE.CTL
date >>a %LOGPATH%TESTER.LOG
time >>a %LOGPATH%TESTER.LOG
echo [%AMTSTATE%] >>a %LOGPATH%TESTER.LOG
if '%FW_MODE%' == 'FORCE' then
goto STEP3_0
endif
:STEP2_1
echo .
echo "STEP:2_1 Checking for ME FW Build ID (%FW_BLD%) ..."
echo "STEP:2_1 Checking for ME FW Build ID (%FW_BLD%) ..." >>a %LOGPATH%TESTER.LOG
CHKDESC.EFI -oemdata0 %FW_BLD%
if not %lasterror% == 0 then
goto STEP3_0
endif
echo "Matched OK!"
echo "Matched OK!" >>a %LOGPATH%TESTER.LOG
:STEP2_2
echo .
echo "STEP:2_2 Checking for ME FW Version (%FW_VER% %PCH_SKU%) ..."
echo "STEP:2_2 Checking for ME FW Version (%FW_VER% %PCH_SKU%) ..." >>a %LOGPATH%TESTER.LOG
MEINFO.efi -FEAT "FW Version" -VALUE "%FW_VER% %PCH_SKU%"
if not %lasterror% == 0 then
goto STEP3_0
endif
echo "Matched OK!"
echo "Matched OK!" >>a %LOGPATH%TESTER.LOG
goto STEP7_0
# ========================================================================
# STEP-3 : Check Descriptor Lock State ( & Firmware Update Local )
# ========================================================================
:STEP3_0
set AMTSTATE STEP3_0
echo %AMTSTATE% >a %LOGPATH%AMTSTATE.CTL
date >>a %LOGPATH%TESTER.LOG
time >>a %LOGPATH%TESTER.LOG
echo [%AMTSTATE%] >>a %LOGPATH%TESTER.LOG
:STEP3_1
echo .
echo "STEP:3_1 Checking for Flash Descriptor Condition..."
echo "STEP:3_1 Checking for Flash Descriptor Condition..." >>a %LOGPATH%TESTER.LOG
MEINFO.efi -FEAT "Host Write Access to ME" -VALUE "Disabled" >a MEINFO.LOG
if %lasterror% == 0 then
echo "ME LOCKed."
echo "ME LOCKed." >>a %LOGPATH%TESTER.LOG
type MEINFO.LOG >>a %LOGPATH%TESTER.LOG
set -v LK_STAT LOCKED
else
echo "ME UNLOCKEDed."
echo "ME UNLOCKEDed." >>a %LOGPATH%TESTER.LOG
type MEINFO.LOG >>a %LOGPATH%TESTER.LOG
set -v LK_STAT UNLOCKED
goto STEP4_0
endif
##@si20171110c -START-
chkdesc.efi >a chkdesc.log
if exist chkdesc.log then
FINDSTRG.EFI "OEMdata1 = 11.6" chkdesc.log /INV
if %lasterror% == 0 then
type chkdesc.log >>a %LOGPATH%TESTER.LOG
if exist MEManuf.116 then
if not exist MEManuf.org then
copy -q MEManuf.EFI MEManuf.ORG
endif
echo .
echo "Copying %TOOLPATH%MEManuf.116 as %MEFWPATH%MEManuf.EFI ..."
echo "Copying %TOOLPATH%MEManuf.116 as %MEFWPATH%MEManuf.EFI ..." >>a %LOGPATH%TESTER.LOG
copy -q MEManuf.116 MEManuf.EFI
if not exist vsccommn.org then
copy -q vsccommn.bin vsccommn.ORG
endif
echo .
echo "Copying %TOOLPATH%vsccommn.116 as %MEFWPATH%vsccommn.bin ..."
echo "Copying %TOOLPATH%vsccommn.116 as %MEFWPATH%vsccommn.bin ..." >>a %LOGPATH%TESTER.LOG
copy -q vsccommn.116 vsccommn.bin
endif
endif
endif
##@si20171110c -END-
:STEP3_2
echo .
echo "STEP:3_2 Updating ME FW with FWUpdLcl.efi with ME_UPD_%PCH_VER%.BIN ..."
echo "STEP:3_2 Updating ME FW with FWUpdLcl.efi with ME_UPD_%PCH_VER%.BIN ..." >>a %LOGPATH%TESTER.LOG
#@si20161110c
del \ME_UPD.bin
copy -q ME_UPD_%PCH_VER%.bin \ME_UPD.bin
if not exist \ME_UPD.bin then
echo .
echo "\ME_UPD_%PCH_VER%.bin not found then use \ME_UPD.bin instead"
echo "\ME_UPD_%PCH_VER%.bin not found then use \ME_UPD.bin instead" >>a %LOGPATH%TESTER.LOG
copy -q ME_UPD.bin \
if not exist \ME_UPD.bin then
echo "Neither \ME_UPD_%PCH_VER%.bin nor \ME_UPD.bin found."
echo "Neither \ME_UPD_%PCH_VER%.bin nor \ME_UPD.bin found." >>a %LOGPATH%TESTER.LOG
goto E_NOPKG
endif
endif
FWUpdLcl.efi -f ME_UPD.bin -OEMID 4C656E6F-766F-0000-0000-000000000000 -allowsv
if not %lasterror% == 0 then
goto E_FWLCL
endif
set FWUPDLCL UPDT
echo "Success."
echo "Success." >>a %LOGPATH%TESTER.LOG
:STEP3_3
echo .
echo "STEP:3_3 Invoking Global Reset with FPT.EXE -GReset ..."
echo "STEP:3_3 Invoking Global Reset with FPT.EXE -GReset ..." >>a %LOGPATH%TESTER.LOG
#Delay for Write Access to Storage Devices
DELAY.efi %DLY%
# Recheck ME FW version
set AMTSTATE STEP2_2
echo %AMTSTATE% >a %LOGPATH%AMTSTATE.CTL
FPT.efi -GReset
:STEP3_4
echo .
echo "STEP:3_4 Global Reset did not happened by FPT.EXE -GReset. Try again ..."
echo "STEP:3_4 Global Reset did not happened by FPT.EXE -GReset. Try again ..." >>a %LOGPATH%TESTER.LOG
set AMTSTATE STEP3_3
echo %AMTSTATE% >a %LOGPATH%AMTSTATE.CTL
goto IPL
# ========================================================================
# STEP-4 : Descriptor Update
# ========================================================================
:STEP4_0
set AMTSTATE STEP4_0
echo %AMTSTATE% >a %LOGPATH%AMTSTATE.CTL
date >>a %LOGPATH%TESTER.LOG
time >>a %LOGPATH%TESTER.LOG
echo [%AMTSTATE%] >>a %LOGPATH%TESTER.LOG
echo .
echo "STEP:4_0 Checking for ME FW Build ID (%FW_BLD%) ..."
echo "STEP:4_0 Checking for ME FW Build ID (%FW_BLD%) ..." >>a %LOGPATH%TESTER.LOG
#@si20161110c
CHKDESC.EFI >>a %LOGPATH%TESTER.LOG
CHKDESC.EFI -oemdata0 %FW_BLD%
if not %lasterror% == 0 then
goto STEP4_1
else
echo "Matched OK!"
echo "Matched OK!" >>a %LOGPATH%TESTER.LOG
if '%FW_MODE%' == 'FORCE' then
if not '%DESCUPDT%' == 'UPDT' then
goto STEP4_1
endif
endif
goto STEP5_0
endif
:STEP4_1
echo .
echo "STEP:4_1 Updating Flash Descriptor with desc_%PCH_VER%.bin (%FW_BLD%)..."
echo "STEP:4_1 Updating Flash Descriptor with desc_%PCH_VER%.bin (%FW_BLD%)..." >>a %LOGPATH%TESTER.LOG
#@si20161110c
del \desc.bin
copy -q fparts.txt \
copy -q desc_%PCH_VER%.bin \desc.bin
if not exist \desc.bin then
echo "\desc_%PCH_VER%.bin not found then use \desc.bin instead."
echo "\desc_%PCH_VER%.bin not found then use \desc.bin instead." >>a %LOGPATH%TESTER.LOG
copy -q desc.bin \
if not exist \desc.bin then
echo "Neither \desc_%PCH_VER%.bin nor \desc.bin found."
echo "Neither \desc_%PCH_VER%.bin nor \desc.bin found." >>a %LOGPATH%TESTER.LOG
goto E_NOPKG
endif
endif
FPT.efi -desc -f desc.bin
if not %lasterror% == 0 then
goto E_UPDESC
endif
set DESCUPDT UPDT
echo "Success."
echo "Success." >>a %LOGPATH%TESTER.LOG
# Recheck Descriptor Version
goto STEP4_0
# ========================================================================
# STEP-5 : ME FW Update
# ========================================================================
:STEP5_0
set AMTSTATE STEP5_0
echo %AMTSTATE% >a %LOGPATH%AMTSTATE.CTL
date >>a %LOGPATH%TESTER.LOG
time >>a %LOGPATH%TESTER.LOG
echo [%AMTSTATE%] >>a %LOGPATH%TESTER.LOG
echo .
echo "STEP:5_0 Checking for ME FW Version (%FW_VER% %PCH_SKU%) ..."
echo "STEP:5_0 Checking for ME FW Version (%FW_VER% %PCH_SKU%) ..." >>a %LOGPATH%TESTER.LOG
MEINFO.efi -FEAT "FW Version" -VALUE "%FW_VER% %PCH_SKU%"
if not %lasterror% == 0 then
goto STEP5_1
else
echo "Matched OK!"
echo "Matched OK!" >>a %LOGPATH%TESTER.LOG
if '%FW_MODE%' == 'FORCE' then
if not '%MEFWUPDT%' == 'UPDT' then
goto STEP5_1
endif
endif
# Update State Counter to Next Step
if '%MEFW_SKU%' == 'NONVPRO' then
set AMTSTATE STEP10_0
else
set AMTSTATE STEP7_0
endif
echo %AMTSTATE% >a %LOGPATH%AMTSTATE.CTL
goto %AMTSTATE%
endif
:STEP5_1
echo .
echo "STEP:5_1 ME Firmware with ME_%PCH_VER%.bin (%FW_BLD%)..."
echo "STEP:5_1 ME Firmware with ME_%PCH_VER%.bin (%FW_BLD%)..." >>a %LOGPATH%TESTER.LOG
#@si20161110c
del \ME.bin
copy -q fparts.txt \
copy -q ME_%PCH_VER%.bin \ME.bin
if not exist \ME.bin then
echo "\ME_%PCH_VER%.bin not found then use \ME.bin instead."
echo "\ME_%PCH_VER%.bin not found then use \ME.bin instead." >>a %LOGPATH%TESTER.LOG