Developer Guide

  • 2021.3
  • 11/18/2021
  • Public

Capsule Upload and 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
    script, but the destination is specified in the
    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: 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.
Command line: tools/host_scripts/ 1 my_on_host_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
    is required and provides
    cmdlet used for installing the generated and signed Firmware Update driver. To install the
    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
    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
    2. Install the runtime Python dependencies:
      > pip install edk2-pytool-library
    3. Create the system environment variable
      pointing to the root of the extracted EDK2 component.
    4. Update the system environment variable
      by adding a path to the following folder in EDK2:
    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
    . If you launch the
    more than once with the “CN=FirmwareUpdate_Test” parameter, you will need to clean up the
    , 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 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


Performance varies by use, configuration and other factors. Learn more at