22
presented by Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar and Plugfest March 26-30, 2018 Presented by Bret Barkelew and Keith Kepler Facilitated by Michael Anderson

Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

presented by

Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to

Windows Update (WU)

Spring 2018 UEFI Seminar and PlugfestMarch 26-30, 2018

Presented by Bret Barkelew and Keith KeplerFacilitated by Michael Anderson

Page 2: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

4 Steps to WU (FW Perspective)

• Create the capsule binary payload• Create the Windows system file (.inf)• Package and sign WU deliverables (.bin and

.inf)– If using HLK, this is a .hlkx. Otherwise, use

attestation signing on .cab

• Publishing to Windows Update• NOTE: This will be required for 10 in S mode

UEFI Plugfest – Spring 2018 www.uefi.org 2

Page 3: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

Growing a Capsule, Inside Out

• Start with a payload

• Tools available on GitHub

– Links at end of section

UEFI Plugfest – Spring 2018 www.uefi.org 3

Data, FV_DXE, FV_PEI, Etc.

Page 4: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

MS_FMP_PAYLOAD_HEADER

Data, FV_DXE, FV_PEI, Etc.

Growing a Capsule, Inside Out

• [Optional Step] Use GenMsPayloadHeader.exe to set Version, LSV, etc.

UEFI Plugfest – Spring 2018 www.uefi.org 4

Page 5: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

UEFI Plugfest – Spring 2018 www.uefi.org 5

EFI_FIRMWARE_IMAGE_AUTHENTICATION

AuthInfo

MS_FMP_PAYLOAD_HEADER

Data, FV_DXE, FV_PEI, Etc.

Growing a Capsule, Inside Out

• Use GenFmpImageAuth.py and the capsule driver signing cert to sign capsule

• This signature is for the capsule framework, not Windows. It will be evaluated by the FMP driver

Page 6: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

UEFI Plugfest – Spring 2018 www.uefi.org 6

EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER

EFI_FIRMWARE_IMAGE_AUTHENTICATION

AuthInfo

MS_FMP_PAYLOAD_HEADER

Data, FV_DXE, FV_PEI, Etc.

Growing a Capsule, Inside Out

• Use GenFmpCap.exe to wrap the signed payload with a GUID that indicates at which driver it is targeted

• This GUID is the one declared in the ESRT (and .inf file)

Page 7: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

EFI_CAPSULE_HEADER

EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER

EFI_FIRMWARE_IMAGE_AUTHENTICATION

AuthInfo

MS_FMP_PAYLOAD_HEADER

Data, FV_DXE, FV_PEI, Etc.

UEFI Plugfest – Spring 2018 www.uefi.org 7

Growing a Capsule, Inside Out

• Use GenFv.exe to wrap the FMP payload in a capsule wrapper

• This wrapper uses the gEfiFmpCapsuleGuid to indicate it should be processed by the framework

Page 8: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

EFI_CAPSULE_HEADER

EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER

EFI_FIRMWARE_IMAGE_AUTHENTICATION

AuthInfo

MS_FMP_PAYLOAD_HEADER

Data, FV_DXE, FV_PEI, Etc.

UEFI Plugfest – Spring 2018 www.uefi.org 8

Growing a Capsule, Inside Out

• Et voila...

• This binary payload is now ready for WHQL signing (once we pair it with an .inf and .cat file)

Page 9: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

To .INFinity, and beyond

• Use CreateWindowsCapsule.py to generate the Windows .inf file to accompany the binary payload– Does not consume the payload, but the name

parameter must match

• This utility will also create a .cat file and test-sign it (with .pfx specified in parameters) for validation on test machine [optional for .cab attestation signing]

UEFI Plugfest – Spring 2018 www.uefi.org 9

Page 10: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

Tools on GitHub

UEFI Plugfest – Spring 2018 www.uefi.org 10

MS_UEFI/MsSampleFmpDevicePkg/Tools/ - Build Process and

Windows Toolshttps://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport/MsSampleFmpDevicePkg/Tools

MS_UEFI/MsSampleFmpDevicePkg/Tools/GenTools/ - Capsule

Binary Payload Generation Toolshttps://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport/MsSampleFmpDevicePkg/Tools/GenTool

s

Example: Attestation signing a Windows driver (same process for

Capsule .cab file and EV signing)https://docs.microsoft.com/en-us/windows-hardware/drivers/dashboard/attestation-signing-a-kernel-driver-for-

public-release

Page 11: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

UEFI EFI Signing - Sysdev• https://sysdev.microsoft.com - UEFI help section

• Used for signing .EFI files, not for UpdateCapsule firmware updates

• .CAB must be EV signed before submitting to Sysdev

UEFI Plugfest – Spring 2018 www.uefi.org 11

Page 12: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

Walk through for Signing UEFI Pkg

UEFI Plugfest – Spring 2018 www.uefi.org 12

• https://developer.microsoft.com/dashboard

Page 13: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

Submit new hardwarehttps://developer.microsoft.com/dashboard/hardware

UEFI Plugfest – Spring 2018 www.uefi.org 13

Page 14: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

Submit your HLKx or .CAB capsule package

UEFI Plugfest – Spring 2018 www.uefi.org 14

Page 15: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

Local Testing

UEFI Plugfest – Spring 2018 www.uefi.org 15

• Download your signed capsule update package

• DevMgr->Firmware->Driver->Update Driver or

• Right click the INF and choose Install

Page 16: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

Publish to Windows Update

UEFI Plugfest – Spring 2018 www.uefi.org 16

12

3

4

Page 17: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

Windows Insider Program (WIP)

• All Firmware published to WU goes through WIP (can add up to 2 weeks)

• Status is "Microsoft approval"

• Great opportunity for real world testing with systems

UEFI Plugfest – Spring 2018 www.uefi.org 17

Page 18: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

UEFI Plugfest – Spring 2018 www.uefi.org 18

Two Steps to become an Insider

Best Practice

Support both Released OS and Upcoming OS

Insider Level OS

Fast or Slow Upcoming

Release Preview Released

Sign up athttp://insider.windows.com

1 2 Update each client as needed

Page 19: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

UEFI Plugfest – Spring 2018 www.uefi.org 19

Each Ring has an Intended Experience

Rings enable the broadest set of customers to engage at their own risk level

Release Preview

Windows Insider Slow

Windows Insider Fast

Microsoft Rings

• Large external audiences running on released OS

• Validate product quality driver updates

• Casual Insiders – may require workarounds

• Intended to predict in-market population

• You should have a backup

• Reasonably predicts the experience in SLOW ring

• Earliest validation to catch issues prior to releasing externally

• Not available to Insiders

Page 20: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

UEFI Plugfest – Spring 2018 www.uefi.org 20

Important Terms

Windows InsidersFans of the Windows 10 OS who want to experience latest offerings from Microsoft in

order to guide and shape future releases of the operating system

RingA defined customer experience that guides how drivers are flighted to Windows

FlightingThe automatic distribution, monitoring and evaluation of a driver to a set of customers in

defined rings

Shipping LabelThe concept in DevCenter used to define the destination of a driver and the method of

delivery

Page 21: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

Questions?

www.uefi.org 21UEFI Plugfest – Spring 2018

Page 22: Microsoft Sample Code on GitHub and Walkthrough on ... 2018... · Microsoft Sample Code on GitHub and Walkthrough on Firmware Updates to Windows Update (WU) Spring 2018 UEFI Seminar

Thanks for attending the Spring 2018 UEFI Plugfest

For more information on the UEFI Forum and UEFI Specifications, visit http://www.uefi.org

presented by

www.uefi.org 22UEFI Plugfest – Spring 2018

Questions regarding this presentation mailto:[email protected]