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.
- Download the WAIK from Microsoft.
- Burn the downloaded ISO to disk using your preferred burning utility, or extract the contents to a folder.
- Insert the burned disc or launch StartCD.exe from the extracted folder.
- Click “Windows AIK Setup” in left navigation pane.
- When the setup wizard starts, click Next.
- Select the “I Agree” radio button to accept the license agreement, then click Next.
- 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.
- 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.
- Download the DCCU from Dell.
- Launch the installer by right-clicking and choosing “Run as administrator”
- Click Next.
- Accept the license agreement by selecting the radio button next to “I accept the license agreement” then click Next.
- Enter customization information, choose who may run the program, then click Next.
- Click Next, then Finish.
- 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.
- Navigate to http://community.spiceworks.com/scripts/show_download/2669
- Click the Download button.
- 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:
- Boot the sample computer into BIOS.
- Configure the BIOS according to your needs. This will become the baseline for your setting update file.
- Restart the sample computer.
- Log in with an administrator account.
- 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)
- Click the “Create BIOS Inventory Package” link.
- When the File Download – Security Warning pop-up box appears, choose “Run.”
- 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:
- 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.
- In the “Choose File to Upload” box, navigate to your previously-generated TaskResult.xml file, select it, then click Open.
- Once you’ve selected the TaskResult.xml file you need, click the “Import Selected BIOS Inventory” link in the DCCU.
- 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).
- 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.
- 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.
- 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:
- Create a directory called “BIOS” in the C: drive of your technician workstation.
- 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.
- Place your customized bios.bat file in this directory.
- 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:
- Click Start, then navigate to All Programs – Microsoft Windows AIK.
- Right-click on “Deployment Tools Command Prompt” and select “Run as administrator”
- Type copype.cmd x86 C:\winpe_x86 into the command prompt and hit Enter.
- 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:
- 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.
- 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”
- 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.
- 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.
- 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”
- 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.
- Type notepad C:\winpe_x86\mount\Windows\System32\startnet.cmd into the command prompt and press Enter.
- Add “bios” to the second line of the file and save it.
- 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:
- In the Deployment Tools Command Prompt, type dism /unmount-wim /Mountdir:c:\winpe_x86\mount /commit and press Enter.
- Type oscdimg -n -bC:\winpe_x86\Etfsboot.com C:\winpe_x86\ISO C:\winpe_x86\BIOS.iso next, followed by Enter.
- Exit the Deployment Tools Command Prompt.
- 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:
- Insert the target USB flash drive in your technician workstation.
- Open a Command Prompt as an administrator (or use the Deployment Tools Command Prompt).
- Type diskpart and hit Enter.
- Type list disk and hit Enter.
- Type select disk 1 and hit Enter. (This assumes your flash drive is disk 1. If not, substitute the correct value.)
- Type clean and hit Enter.
- Type create partition primary and hit Enter.
- Type select partition 1 and hit Enter.
- Type active and hit Enter.
- Type format quick fs=fat32 and hit Enter.
- Type assign and hit Enter.
- Type exit and hit Enter to exit diskpart.
- Type xcopy C:\winpe_x86\iso\*.* /e F:\ (assuming F: is the drive letter assigned to your flash drive) and hit Enter.
- 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:
- Launch WinSCP (or your preferred FTP client) and connect to your FOG server.
- Once connected, navigate to /tftpboot/
- Copy memdisk to a temporary folder on your technician workstation.
- Navigate to /tftpboot/fog/
- Create a new directory called “bios” (without quotes).
- Upload the BIOS.iso file you created for your update disc and the copy of memdisk into this new folder.
- Navigate to /tftpboot/pxelinux.cfg/
- Copy the default file to a temporary folder on your technician workstation.
- Rename the default file on your FOG server to default.bak
- Open the copy of default on your workstation in your favorite text editor.
- 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
- Save the default file, then upload the new version to /tftpboot/pxelinux.cfg/ on your FOG server.
- To update the utility, simply copy over the BIOS.iso file in /tftpboot/fog/bios/ with a newer version.
Leave a Reply