以前写过一篇“UEFI和UEFI Shell简介”的文章,在这两天升级BIOS时又需要用UEFI启动然后升级BIOS,故写个笔记吧。
经常和最近的硬件系统打交道,有时BIOS也有一些bug fix,升级BIOS是常有的事情,我一般通过如下两种方式来升级BIOS。
1. 拔下BIOS芯片,直接烧新的ROM到BIOS芯片。
2. 通过UEFI升级,使用BIOS升级包中提供的脚本。
对于第一种方式,是先擦写掉BIOS芯片的ROM,然后将新的ROM烧录进去。我们需要一个夹住BIOS引脚并用USB连接到PC的硬件设备,然后使用“DediProg Engineering”软件工具,因此选择其中的”Detect”->”Blank”->”Erase”->”Prog”->”Verify”即可(当然还要选择”File”来加载需要烧入的BIOS ROM文件)。
对于第二种方式,详细介绍如下。
1. 将BIOS升级包解压,并放到一个U盘中。
在下载BIOS升级包中可能有如下的一些文件:
[jay@jay-linux x056_package]$ ll
total 24416
-rw-rw-r-- 1 jay vmm 8837632 May 15 12:43 iFlash32.efi
-rw-rw-r-- 1 jay vmm 246400 May 15 11:49 ipmi.efi
-rw-rw-r-- 1 jay vmm 2231952 Jul 10 15:36 MEComplete_02.01.05.107.cap
-rw-rw-r-- 1 jay vmm 31867 May 25 18:21 ReleaseNotes_ME_02.01.05.107.txt
-rw-rw-r-- 1 jay vmm 132179 Jul 10 15:45 ReleaseNotes_x056.txt
-rw-rw-r-- 1 jay vmm 2883584 Jul 10 15:26 rml.rom
-rw-rw-r-- 1 jay vmm 1759 Jul 10 15:46 Startup.nsh
-rw-rw-r-- 1 jay vmm 5178896 Jul 10 15:36 x056.cap
-rw-rw-r-- 1 jay vmm 5441040 Jul 10 15:36 x056Rec.cap
其中Startup.nsh脚本如下所示,其实最重要的还是调用“iflash32 /u /ni x056.cap”进行实际的升级。
echo -off
# + ============================================================== +
# Copyright (c) 2011, Intel Corporation.
# This source code and any documentation accompanying it ("Material") is furnished
# under license and may only be used or copied in accordance with the terms of that
# license. No license, express or implied, by estoppel or otherwise, to any
# intellectual property rights is granted to you by disclosure or delivery of these
# Materials. The Materials are subject to change without notice and should not be
# construed as a commitment by Intel Corporation to market, license, sell or support
# any product or technology. Unless otherwise provided for in the license under which
# this Material is provided, the Material is provided AS IS, with no warranties of
# any kind, express or implied, including without limitation the implied warranties
# of fitness, merchantability, or non-infringement. Except as expressly permitted by
# the license for the Material, neither Intel Corporation nor its suppliers assumes
# any responsibility for any errors or inaccuracies that may appear herein. Except
# as expressly permitted by the license for the Material, no part of the Material
# may be reproduced, stored in a retrieval system, transmitted in any form, or
# distributed by any means without the express written consent of Intel Corporation.
# Module Name: startup.nsh
# Abstract: Script file for invoking iflash.
# + ============================================================== +
# Program all blocks of BIOS from capsule file
# + ============================================================== +
echo Flashing Romley Platform BIOS...
iflash32 /u /ni x056.cap
2. 将装有BIOS升级文件的U盘放到机器上,启动系统,选择从“Internal EFI Shell”启动。
在启动时,按F6可以启动设备的选择”select boot device”,然后选择“EFI Shell”即可;按键F2进入BIOS设备,设置为EFI Shell启动也可。
3. 在EFI Shell中,进入BIOS安装包所在路径,运行Startup.nsh脚本来升级BIOS。
首先运行”map”命令显示设备的映射情况,找到代表U盘的设备(如为”fs0″),进入到U盘中,查看文件,并找到升级所需的Starup.nsh文件。
命令如下:
map #映射驱动器路径
fs0: #进入fs0驱动器(即这里的U盘)
ls #列出当前目录中的内容,也可用”dir”命令
cd x056_package #进入某个目录
Startup.nsh #执行脚本来升级BIOS
从EFI启动来升级BIOS可能遇到的问题,一种是确实有可能升级不成功(如突然断电)而导致系统无法启动,另一种问题是如果最较旧的BIOS升级到较新的BIOS(中间跨度较大)可能会不让升级(因为可能x56版的BIOS只能从x48之后的版本去升级,而不能从很老的x20版本升级)。
关于EFI及EFI Shell的更多知识、命令等,请参考如下:
http://software.intel.com/en-us/articles/uefi-shell/