Developer Guide

  • 2021.2
  • 06/11/2021
  • Public
Contents

Capsule Apply Script

The data streams optimizer uses this script on the target system to apply a capsule.
To support the Windows* OS as a target, the Intel® TCC Tools package contains an example of a modified script.
If you have a Windows OS target with UEFI BIOS, you can use the example without modifications to run data streams optimizer.
You can copy and modify the script to support another firmware or OS. The script must meet the following requirements to maintain compatibility with the data streams optimizer:
  • Input: The first parameter is a capsule version. Other parameters are paths to capsules on the target system.
    When a capsule is copied to the target, the capsule name is specified by the
    capsule_create
    script, but the destination is specified in the
    target_capsules_path
    field in the environment file.
    The capsule version is important for Windows* operating systems. The data streams optimizer uses capsule version “1” for Linux* operating systems.
    usage: capsule_apply_uefi.sh VERSION CAPSULE_FILE_1 CAPSULE_FILE_2 ... CAPSULE_FILE_N VERSION Capsule version to apply CAPSULE_FILE_N Path to the capsule file
  • Output: Return code must be 0 when the capsule is applied successfully.
  • Error handling: Any nonzero value returned from the script will be interpreted as an error. Any additional logging should be printed to STDERR.
Example:
Command line: c:\APPS\TCCSDK\tools\target_scripts_win\capsule_apply_win.py 1 my_on_target_capsule.capsule STDOUT: some-output-there Return value: 0 STDERR: empty
To make the script work, follow the steps below.

Configure System Settings

  1. Enable test mode on the target system:
    1. Launch the command shell with administrative privileges and execute the following command:
      > bcdedit /set testsigning on
    2. After you have finished using data streams optimizer to tune the system, you can disable test mode:
      > bcdedit /set testsigning off
  2. Update the User Account Control (UAC) settings to “Never notify” to allow the data streams optimizer to enable remote Administrative access:
    1. Launch
      User Account Control Settings
      in the Control Panel and update the settings to
      Never notify/not recommended
      .
    2. After you have finished using data streams optimizer to tune the system, you can restore UAC to the original/required setting.
  3. The PowerShell module
    DeviceManagement
    is required and provides
    Install-DeviceDriver
    cmdlet used for installing the generated and signed Firmware Update driver. To install the
    DeviceManagement
    module:
    1. Run PowerShell with Administrative permissions.
    2. Run the following command:
      PS> Install-Module -Name DeviceManagement

Install EDK2 and Dependencies

The data streams optimizer uses EDK2 software to create and sign the Firmware Update driver. Visual Studio*, Windows SDK*, and Windows Driver Kit (WDK)* are dependencies of EDK2. You will need to install all components on the target system.
To install EDK2 and dependencies:
  1. Go to official Microsoft site to download and install these components on the target system:
    • Visual Studio
    • Windows SDK (can be installed as a part of Visual Studio)
    • Windows Driver Kit (WDK)
  2. Add the path for the Windows* Driver Kit to the
    PATH
    environment variable. The default Windows Driver Kit installation path is
    C:\Program Files (x86)\Windows Kits\10\bin\<version>\x64
    .
  3. Install EDK2:
    1. Extract the archive onto the target, in
      C:\DATA\edk2
      .
    2. Install the runtime Python dependencies:
      > pip install edk2-pytool-library
    3. Create the system environment variable
      EDK2_ROOT
      pointing to the root of the extracted EDK2 component.
    4. Update the system environment variable
      PYTHONPATH
      by adding a path to the following folder in EDK2:
      C:\DATA\edk2\BaseTools\Source\Python
      .
    5. Reboot the system.

Install the Self-Signed Test Certificate

You will need to create and install a self-signed test certificate for signing the Firmware Update driver. This is a one-time step.
To create and install the self-signed test certificate:
  1. Make sure the following steps are executed only once, and there is no certificate with the common name “FirmwareUpdate_Test” in
    C:\APPS\TCCSDK\cert
    . If you launch the
    makecert.exe
    more than once with the “CN=FirmwareUpdate_Test” parameter, you will need to clean up the
    PrivateCertStore
    , before you can continue.
  2. Open a command-line shell with administrative privileges.
  3. Create and install the self-signed test certificate:
    > mkdir C:\APPS\TCCSDK\cert > cd C:\APPS\TCCSDK\cert > makecert -r -pe -ss PrivateCertStore -n CN=FirmwareUpdate_Test -eku 1.3.6.1.5.5.7.3.3 firmware.cer > CertMgr.exe /add C:\APPS\TCCSDK\cert\firmware.cer /s /r localMachine root /all > CertMgr.exe /add C:\APPS\TCCSDK\cert\firmware.cer /s /r localMachine trustedpublisher

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.