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.
For Dell this can be found here: https://www.dell.com/support/home/en-us/drivers/driversdetails?driverid=0r8cx
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.
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.
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.
In this template some executables from Dell are used.
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.