Skip to main content
Matrix42 Self-Service Help Center

How to extend BiosUpdateTemplate package script

Entry point of Install.ps1 is the function Main. There you can see a call of function UpdateBios with manufacturer, model, and BIOS version of the current system as arguments. Within that function other manufacturer can be added as a case for the switch.

switch($systemManufacturer.ToUpper())
    {
        "DELL INC."
        {
            $exitCode = UpdateDellBios $systemModel $biosVersion;
        }
    }

Here you can extend with another manufacturer. You also need a dedicated update function for the new manufacturer. Here we use a new UpdateLenovoBios function.

switch($systemManufacturer.ToUpper())
    {
        "DELL INC."
        {
           $exitCode = UpdateDellBios $systemModel $biosVersion;
        }
        "LENOVO"
        {
           $exitCode = UpdateLenovoBios $systemModel $biosVersion;
        }
    }

Check of exit codes must be extended or modified according to documentation of manufacturer's BIOS update or flash utility.

Our new UpdateLenovoBios function could look like the existing UpdateDellBios function and have models of the manufacturer listed and call a method to update a device with that model. Here UpdateLenovo20BW function, which we call with the BIOS version of current system.

switch($systemModel.ToUpper())
    {
        "20BW"
        {
           $exitCode = UpdateLenovo20BW $biosVersion;
        }
    }

Once we have the UpdateLenovoBios function we create also a new UpdateLenovo20BW function where we cover all required BIOS versions of available clients. And create a function which will flash device with new BIOS executable.

switch($biosVersion.ToUpper())
    {
        "JBET67WW"
        {
           $exitCode = UpdateLenovo20BWToJBET67WW;
        }
        default
        {
           $exitCode = UpdateLenovo20BWToJBET67WW;
        }
    }

In such a function UpdateLenovo20BWToJBET67WW we need a flash function for out new manufacturer which will look like existing FlashDellDevice function. New FlashLenovoDevice function would use the BIOS flash utility from website of this manufacturer with required parameters or execute BIOS update executable directly which can run on WinPE.

$exitCode = FlashLenovoDevice "WINUPTP64.exe";

A BIOS password might be required for updates

The Matrix42 PreOS Package BiosUpdateTemplate comes with a package variable BiosPassword. This can be set at the Matrix42 Management Console.

Open the Matrix42 Management Console and navigate to Management > Administration.

Select the Configuration Group that contains the Computer and open the variable dialog via the context menu.

clipboard_e95676b758e882bf0b4317347d8a12bb2.png

The variable dialog shows a User defined variable BiosUpdateTemplate that contains the subordinated variable BiosPassword. Select the BiosUpdateTemplate variable and press Edit to show the variable BiosPassword. Select this variable again an Edit to change the value of the BiosPassword variable.

clipboard_ed52016637d5242b42ebba982981070ab.png

Where to store BIOS flash utility and BIOS update executables

Within BiosUpdateTemplate package update executables and flash utilities can be placed in the BiosUpdateExecutables-folder right under version-folder nearby to Install-folder.

clipboard_ef93f5c7dbc25e350ce725bdb5694dc85.png

In this template some executables from Dell are used.

clipboard_e3d84fda7763687f8326e973171654f21.png

It might be more efficient to create subfolders for each manufacturer there.

Function FlashDellDevice in this BiosUpdateTemplate package demonstrates how to navigate to this folder and execute flash utility with update executables as argument.

 

  • Was this article helpful?