Intentionally Vaygh

Automatic BIOS Firmware and Settings Updates

One of my big projects this summer at work has been to automatically update the BIOS firmware and settings on our roughly 250 (mostly Dell) workstations. I was finally able to develop a working solution using all free tools, and I’m sharing the results with the Internet in hope they are useful to someone else as well.

This document is designed to explain the process of setting up a Windows PE environment to be used for BIOS update purposes, creating custom automatic BIOS settings files, updating the bios.bat file for new computer types, and deploying BIOS updates based on your customizations.

Setting Up Working Tools

Before you can create your custom BIOS settings files and deploy them to workstations using Windows PE, you’ll need specialized tools available on your technician workstation.

Windows Automated Installation Kit

The WAIK contains components used for deploying Windows 7 systems, including Windows PE, which will be used to create a bootable environment for flashing BIOS updates and automatic BIOS settings files.

  1. Download the WAIK from Microsoft.
  2. Burn the downloaded ISO to disk using your preferred burning utility, or extract the contents to a folder.
  3. Insert the burned disc or launch StartCD.exe from the extracted folder.
  4. Click “Windows AIK Setup” in left navigation pane.
  5. When the setup wizard starts, click Next.
  6. Select the “I Agree” radio button to accept the license agreement, then click Next.
  7. Choose where you’d like to install the software to and who should be able to run it, then click Next, Next again, then Close.
  8. Exit the launcher program by clicking Exit in left navigation pane.

Dell Client Configuration Utility

To create automatic BIOS settings files to deploy to Dell target workstations, you’ll need the Dell Client Configuration Utility.

  1. Download the DCCU from Dell.
  2. Launch the installer by right-clicking and choosing “Run as administrator”
  3. Click Next.
  4. Accept the license agreement by selecting the radio button next to “I accept the license agreement” then click Next.
  5. Enter customization information, choose who may run the program, then click Next.
  6. Click Next, then Finish.
  7. The ASP.net AJAX 2.0 Extensions may install automatically once DCCU installation is finished, if they are not already present on your technician workstation.

BIOS.BAT

The workhorse of the automatic update process is a Windows batch file called bios.bat.

  1. Navigate to http://community.spiceworks.com/scripts/show_download/2669
  2. Click the Download button.
  3. Save the file as bios.bat.

(Optional) WinSCP or FileZilla

If you use FOG as your imaging solution, and you wish to add your BIOS update disc to the PXE boot menu, you’ll need an FTP program like WinSCP or FileZilla.

Gathering Data, Customizing Options, and Generating the BIOS Settings Update Executable

Gathering the data you need to create custom BIOS setting files is a two-part process. Note: for this section, you will need a sample machine of each type you wish to develop a custom setting file for. It’s recommended the sample machine have any installed antivirus software disabled.

Collecting the BIOS Inventory

In order to collect a BIOS inventory from a sample computer, follow the steps above for installing the Dell Client Configuration Utility. Once the DCCU is installed on the sample machine, the following process explains how to capture the BIOS inventory:

  1. Boot the sample computer into BIOS.
  2. Configure the BIOS according to your needs. This will become the baseline for your setting update file.
  3. Restart the sample computer.
  4. Log in with an administrator account.
  5. Launch the DCCU. (I have had the best luck with running the DCCU web interface in Internet Explorer 8 with Compatibility Mode on. Chrome and Firefox fail to render the page correctly for me. YMMV)
  6. Click the “Create BIOS Inventory Package” link.
  7. When the File Download – Security Warning pop-up box appears, choose “Run.”
  8. Once the BIOS inventory program has completed, a file called TaskResult.xml will be created on the desktop. You may wish to save this file in case you need to make adjustments to the settings update configuration later.

Customizing BIOS Settings and Generating the Update File

After gathering an inventory of the sample machine’s BIOS, you can now make any needed changes to the automatic BIOS settings update file. Follow these steps to complete the configuration:

  1. On the sample machine or your technician workstation, click the Browse button in the Dell Client Configuration Utility web page under the BIOS Settings heading.
  2. In the “Choose File to Upload” box, navigate to your previously-generated TaskResult.xml file, select it, then click Open.
  3. Once you’ve selected the TaskResult.xml file you need, click the “Import Selected BIOS Inventory” link in the DCCU.
  4. Now you can customize the available BIOS settings. Items in the list with check marks are available for configuration in the chosen BIOS. To leave a setting as it’s already configured on the target machine – such as a previously-entered asset tag – simply clear the check mark for that item. It will be omitted from the custom settings file. To reset a text field, leave the box checked, but remove all text (leave it blank).
  5. Once the BIOS settings are configured according to your specifications, scroll to the bottom of the Dell Client Configuration Utility page and select the “Create BIOS Settings Package” link.
  6. A File Download – Security Warning box will pop-up. Choose “Save,” then select a name and location to save the resulting executable to. To make updating the bios.bat file easier, I typically name the file machinemodelset.exe, as in 745set.exe.
  7. You can now use your custom BIOS settings executable to update target PCs.

Creating the BIOS Update Folder

In order for the automatic updating features of the disc to work, a specific directory structure must be observed:

  1. Create a directory called “BIOS” in the C: drive of your technician workstation.
  2. Place all BIOS setting customization executables created with the Dell Client Configuration Utility or files created by another manufacturer’s similar program in the BIOS directory just created.
  3. Place your customized bios.bat file in this directory.
  4. Create a subdirectory for each model computer to be updated and place the firmware update executable in this folder. (The FW update executable must be named with the BIOS version and nothing else.)

Building the BIOS Update Disc

The following sections detail creating the Windows PE build environment, customizing the environment, adding the necessary BIOS files, and committing the updated environment to a custom ISO file.

Creating the Windows PE Build Environment

Use the following steps to create your Windows PE environment:

  1. Click Start, then navigate to All Programs – Microsoft Windows AIK.
  2. Right-click on “Deployment Tools Command Prompt” and select “Run as administrator”
  3. Type copype.cmd x86 C:\winpe_x86 into the command prompt and hit Enter.
  4. Type copy C:\winpe_x86\winpe.wim C:\winpe_x86\ISO\sources\boot.wim into the command prompt and hit Enter.

Mounting and Customizing the Windows PE Environment

Follow the steps below to mount and customize the Windows PE environment:

  1. In the Deployment Tools Command Prompt, type dism /Mount-WIM /WimFile:C:\winpe_x86\ISO\sources\boot.wim /index:1 /MountDir:c:\winpe_x86\mount and press Enter.
  2. Add the Windows Management Instrumentation to the environment by typing dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-wmi.cab” and pressing Enter, then running dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-wmi_en-us.cab”
  3. Add HTA to the image by entering dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-hta.cab” and dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-hta_en-us.cab” in the Deployment Tools Command Prompt.
  4. Scripting support needs to be added to the Windows PE environment by typing dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-scripting.cab” into the command prompt, then pressing Enter. You’ll also need to type dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-scripting_en-us.cab” into the prompt.
  5. Add MDAC support to the environment by entering dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-mdac.cab” and dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-mdac_en-us.cab”
  6. Copy the contents of your BIOS update folder to the Windows PE environment by typing xcopy /e C:\BIOS C:\winpe_x86\mount\Windows\System32 into the command prompt and pressing Enter.
  7. Type notepad C:\winpe_x86\mount\Windows\System32\startnet.cmd into the command prompt and press Enter.
  8. Add “bios” to the second line of the file and save it.
  9. Exit Notepad.

Committing Changes to the Environment and Creating the Bootable ISO

In order to use the customized Windows PE environment, changes must be committed to the system and a bootable ISO created:

  1. In the Deployment Tools Command Prompt, type dism /unmount-wim /Mountdir:c:\winpe_x86\mount /commit and press Enter.
  2. Type oscdimg -n -bC:\winpe_x86\Etfsboot.com C:\winpe_x86\ISO C:\winpe_x86\BIOS.iso next, followed by Enter.
  3. Exit the Deployment Tools Command Prompt.
  4. Burn the resulting CD image file with your preferred disc burning software.

Updating the Environment and Rebuilding the BIOS Update Disc

It may be necessary to update the environment in order to add new machine types or include updated firmware files. The simplest way to update the disc is to make any needed modifications to your C:\BIOS folder (new bios.bat, new machine folders, etc. – Remember, only one firmware update executable can be in a given folder at a time.) then rebuild the environment using the steps above.

(Optional) Creating a BIOS Update USB Flash Drive

In lieu of a CD, which can take longer to load, you may wish to follow these steps after you’ve completed “Committing Changes to the Environment and Creating the Bootable ISO” above:

  1. Insert the target USB flash drive in your technician workstation.
  2. Open a Command Prompt as an administrator (or use the Deployment Tools Command Prompt).
  3. Type diskpart and hit Enter.
  4. Type list disk and hit Enter.
  5. Type select disk 1 and hit Enter. (This assumes your flash drive is disk 1. If not, substitute the correct value.)
  6. Type clean and hit Enter.
  7. Type create partition primary and hit Enter.
  8. Type select partition 1 and hit Enter.
  9. Type active and hit Enter.
  10. Type format quick fs=fat32 and hit Enter.
  11. Type assign and hit Enter.
  12. Type exit and hit Enter to exit diskpart.
  13. Type xcopy C:\winpe_x86\iso\*.* /e F:\ (assuming F: is the drive letter assigned to your flash drive) and hit Enter.
  14. Exit the Command Prompt.

(Optional) Adding the Update Disc Image to the FOG PXE Boot Menu

If you use FOG as your imaging solution, you may wish to make your BIOS update disc available in the PXE boot menu so you can load BIOS updates over the network. The steps below detail this process:

  1. Launch WinSCP (or your preferred FTP client) and connect to your FOG server.
  2. Once connected, navigate to /tftpboot/
  3. Copy memdisk to a temporary folder on your technician workstation.
  4. Navigate to /tftpboot/fog/
  5. Create a new directory called “bios” (without quotes).
  6. Upload the BIOS.iso file you created for your update disc and the copy of memdisk into this new folder.
  7. Navigate to /tftpboot/pxelinux.cfg/
  8. Copy the default file to a temporary folder on your technician workstation.
  9. Rename the default file on your FOG server to default.bak
  10. Open the copy of default on your workstation in your favorite text editor.
  11. Insert the following code where you would like the option to appear in the PXE boot menu (I prefer to place it at the end, just before the line PROMPT 0):

LABEL bios

kernel fog/bios/memdisk

append iso initrd=fog/bios/BIOS.iso raw

MENU LABEL BIOS Update

TEXT HELP

Utility to automatically update BIOS firmware

and settings.

ENDTEXT

  1. Save the default file, then upload the new version to /tftpboot/pxelinux.cfg/ on your FOG server.
  2. To update the utility, simply copy over the BIOS.iso file in /tftpboot/fog/bios/ with a newer version.
Exit mobile version