第4章 BIOS操作指导
4.1 NSM单板BIOS菜单
安全产品上电启动后,进入用户视图,执行xsm connect slot slotnum 命令,连接到NSM单板的串口上。slotnum表示NSM单板所在的逻辑槽位号
xsm connect slot 1
Connected to XSM
看到如下提示后,输入用户名和密码,登录Linux 操作系统。默认的帐号是root,对应的密码是root
CentOS release 4.4 (Final)
Kernel 2.6.9-42.0.3.EL on an i686
localhost login: root
Password:
Last login: Mon Dec 4 11:17:00 on ttyS0
You have new mail.
[root@localhost ~]#
登录之后,执行重启操作(即在Linux系统中重启Linux),使得NSM单板热启动。这样是为了能够进入BIOS菜单。Linux系统关机时,输出的信息如下。
INIT: Stopping HAL daemon: [ OK ]
Stopping system message bus: [ OK ]
Stopping atd: [ OK ]
Stopping cups: [ OK ]
Shutting down xfs: [ OK ]
Shutting down console mouse services:
[ OK ]
Stopping sshd:[ OK ]
Shutting down sendmail: [ OK ]
Shutting down sm-client: [ OK ]
Shutting down smartd: [ OK ]
Stopping xinetd: [ OK ]
Stopping crond: [ OK ]
Stopping NFS statd: [ OK
]
Stopping irqbalance: [FAILED]
Stopping portmap: [ OK ]
Shutting down kernel logger: [ OK ]
Shutting down system logger: [ OK ]
Shutting down interface eth0:
[ OK ]
Shutting down interface eth1:
[ OK ]
Shutting down loopback interface: [ OK ]
Starting killall: [ OK ]
Sending all processes the TERM signal...
Sending all processes the KILL signal...
Saving random seed:
Syncing hardware clock to system time
Turning off quotas:
Unmounting file systems:
hda: hda1
Please stand by while rebooting the system...
md: stopping all md devices.
md: md0 switched to read-only mode.
Restarting system.
在此,等待大概20秒的时候,就会出现以下的提示:
Initializing Intel(R) Boot Agent GE v1.2.26
PXE 2.1 Build 084 (WfM 2.0)
Initializing Intel(R) Boot Agent GE v1.2.26
PXE 2.1 Build 084 (WfM 2.0)
此时,表示BIOS已经开始执行。
BIOS继续启动,紧接着提示用户,是否需要进行内存检测,
Test All Memory? Yes or No (Y/N):
如果用户想进行内存检测,输入Y/y,就开始进行内存检测,
Test All Memory? Yes or No (Y/N): y.
检测成功后输出信息:
Memory checking is OK!
如果检测内存失败,输出信息:
Memory checking is failed!
检测的空间是从16M开始的所有内存空间,最低16M不进行内存检测。
默认不进行内存检测,在4s之内,如果用户输入N/n,或者等待4s之后,系统将继续启动,出现BIOS菜单。
*******************************************************
* *
* BIOS
, Ver 1.13 *
* *
*******************************************************
Compiled date: Nov 25 2006, 11:18:24
CPU type : Pentium M
CPU L1 Cache : 16KB
CPU L2 Cache : 2048KB
CPU Clock Speed : 1400MHz
Memory Type : DDR SDRAM
Memory Size : 512MB
Memory Speed : 200MHz
BIOS Size : 2048KB
CF Card Size : 256MB
Hard Disk Size : 60GB
CPLD Version is 1.00
HardWare Version is 3.00
Press Ctrl+D to enter BIOS Menu...
当出现“Press Ctrl+D to enter BIOS Menu...”时,键入,系统进入BIOS的菜单:
=============================
| <1> Boot Linux From CF Card
|
| <2> Install Linux OS With Ethernet
|
| <3> Backup BIOS to the backup portion
|
| <4> Recover BIOS from the backup portion
|
| <5> Reboot
|
=======================================================
Enter your choice(1-5):
该菜单含义如下:
菜单项
说明
<1> Boot Linux From CF Card
从CF卡读取引导程序,然后引导Linux启动
<2> Install Linux OS With Ethernet
网络安装整个Linux操作系统
<3> Backup BIOS to the backup portion
将主BIOS的内容进行备份
<4> Recover BIOS from the backup portionl
将备份区的内容恢复到主BIOS当中
<5> Reboot
重新启动NSM单板
如果在BIOS启动过程中,用户不作干预,则系统在等待5s后,自动引导硬盘上的Linux系统启动。或者,用户在BIOS菜单下键入<1>,BIOS将从CF卡上读取引导程序,显示如下:
Reading boot sector...done.
Switching to boot loader.
LILO boot:
用户输入Tab键后,将提示出这两个选项:
LILO boot:
linux-hdc linux-ramdisk
boot:
两个选项的具体说明如下:
llinux-hdc:引导硬盘上的Linux启动,主要用于安装和使用集成于NSM单板上的NSM软件。
llinux-ramdisk:引导CF卡上的Linux启动,主要用于查看单板软件版本信息,升级BIOS。
如上所述,NSM软件需要在硬盘上的Linux系统中安装,因此用户只需输入linux-hdc,再敲入回车键,即可引导硬盘上的Linux系统。
系统默认启动的也是硬盘中的文件系统。如果用户直接键入回车,即可引导硬盘上的Linux 系统启动。
4.2.1 NSM单板软件版本信息显示
查看NSM单板软件版本信息,需要用户选择linux-ramdisk方式启动。选择linux-ramdisk后,提示如下:
Please press Enter to activate this console.
此时,敲入回车键,将会提示用户输入帐号和密码。系统默认的帐号是root,密码是tpmc。需要注意的是,这个帐号和密码都是不能更改的。
localhost login: root
Password:
正确的输入帐号和密码后,就会出现如下的提示信息
login[171]: root login on
`ttyS0'
BusyBox v1.00 (2006.10.31-01:03+0000)
Built-in shell (ash)
Enter 'help' for a list of built-in commands.
[root@localhost /root]#
进入shell之后,可以通过以下命令行获取当前NSM单板软件的版本
[root@localhost /root]#tpmc appboardversion
@@
Board software: 1.24
Linux kernel: 2.6.9-42.0.3.EL
GE driver:
7.0.41
Flash driver: 1.00
CPLD driver: 1.00
Dummy device: 1.00
Proprietary protocol: 1.01
Softdog: 1.00
BIOS utility: 1.00
MainBIOS: 1.13
BackupBIOS:
1.13
CPLD: 1.00
PCB: 3.00
$$
test success
[root@localhost /root]# / #
其中,Board software显示的是NSM单板软件的版本标识。此标识反应了NSM单板软件支持特性的不同。
需要注意的是,用户登录了这个系统之后,具有管理员的权限,对于CF卡、硬盘上的文件可以进行任意的操作。可能会影响到其他引导选项的正常工作,所以建议用户不要登录和使用这个系统。
4.3 NSM单板Linux系统网络安装
Linux系统的网络安装包括安装CF卡上的Linux系统和硬盘上的Linux系统。
用户在BIOS菜单下键入<2>,将执行网络安装的操作。网络安装就是将Linux系统从网络上安装到NSM单板上。此时,将对NSM单板上的硬盘和CF卡进行分区和格式化,所以原有的数据将全部丢失。
需要进行两组网络连接:
l用户通过控制台连接到安全产品,用于对安全产品进行操作。控制台controller可以通过串口直接与安全产品的Console口连接,也可以telnet到安全产品上。
l为了通过网络安装Linux系统,需要将NSM单板的GE口与一台Server相连。
以安装Red Hat 9的PC机作为Server,需要在Server进行的配置包括:IP地址、创建目录并放入安装所需的文件、DHCP Server的配置文件、TFTP Server的配置文件。举例说明如下:
(1)此Server的IP地址必须为192.168.0.2;
(2)在Server上建立目录并且将所有的文件放置到指定的目录下
mkdir /tftpboot
mkdir /tftpboot/pxelinux.cfg
在/tftpboot目录下放置如下文件:
cf-centos4.4.tar.gz
hdc-centos4.4.tar.gz
pxelinux.0
vmlinuz-2.6.9-42.0.3.EL
initrd-2.6.9-42.0.3.EL-8appboardinstall.img
在目录/tftpboot/pxelinux.cfg目录下放置文件:
default
对于这些文件的作用以及命名规则说明如下:
文件名
文件描述
cf-centos4.4.tar.gz
CF卡的镜像文件
hdc-centos4.4.tar.gz
硬盘的镜像文件
pxelinux.0
PXE下载的第一个boottrap文件
vmlinuz-2..6.9-42.0.3.EL
Linux的kernel文件
initrd-2.6.9-42.0.3.EL-appboardinstall.img
使用busybox生成的ramdisk文件
default
此文件包含启动的过程中需要下载的kernel文件名,以及ramdisk的文件名。
文件内容为:
PROMPT 0
TIMEOUT 10
DEFAULT linux
LABEL linux
KERNEL
/vmlinuz-2.6.9-42.0.3.EL
APPEND initrd=/initrd-2.6.9-42.0.3.EL-appboardinstall.img root=/dev/ram0 console=ttyS0,9600 rw ramdisk_size=16000000
(3)DHCP Server的配置文件:
配置文件dhcpd.conf的内容为:
ddns-update-style interim;
ignore client-updates;
option option-128 code 128 = string;
option option-129 code 129 = string;
subnet 192.168.0.0 netmask 255.255.255.0
{
range dynamic-bootp 192.168.0.110 192.168.0.120;
default-lease-time 3600;
max-lease-time 7200;
server-name "PTM";
filename "pxelinux.0";
}
(4)TFTP Server的配置文件:
TFTP Server的配置文件tftp的内容为:
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
disable
= no
socket_type = dgram
protocol = udp
wait = yes
user = root
server =
/usr/sbin/in.tftpd
server_args =
-c -s /tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}
说明:slotnum表示NSM单板所在的逻辑槽位号;
(1)安全产品上电后正常启动,执行命令行xsm connect slot slotnum ,连接到NSM单板的Console上。
xsm connect slot ?
INTEGER<1> The slot number of XSM board
xsm connect slot 1
Connected to XSM
(2)登录Linux后,执行reboot操作,重新启动NSM单板。
CentOS release 4.4 (Final)
Kernel 2.6.9-42.0.3.EL on an i686
localhost login: root
Password:
Last login: Thu Nov 23 17:08:50 from 192.168.0.16
You have mail.
[root@localhost ~]# reboot
Broadcast messagStopping anacron:
[ OK ]
Stopping sshd:[ OK ]
…………
Please stand by while rebooting the system...
flushing ide devices: hda hdc
注:帐号是root 密码是root
(3)等待BIOS启动后,看到提示后输入Ctrl+D,进入BIOS菜单
Initializing Intel(R) Boot Agent GE v1.2.26
PXE 2.1 Build 084 (WfM 2.0)
Initializing Intel(R) Boot Agent GE v1.2.26
PXE 2.1 Build 084 (WfM 2.0)
Test All Memory? Yes or No
(Y/N):
*******************************************************
* *
* BIOS
, Ver 1.13 *
* *
*******************************************************
Compiled date: Nov 25 2006, 11:18:24
CPU type : Pentium M
CPU L1 Cache : 16KB
CPU L2 Cache : 2048KB
CPU Clock Speed : 1400MHz
Memory Type : DDR SDRAM
Memory Size : 512MB
Memory Speed : 200MHz
BIOS Size : 2048KB
CF Card Size : 256MB
Hard Disk Size : 60GB
CPLD Version is 1.00
HardWare Version is 3.00
Press Ctrl+D to enter BIOS Menu...
#
(此时键入Ctrl+D)
=============================
| <1> Boot Linux From CF Card
|
| <2> Install Linux OS With Ethernet
|
| <3> Backup BIOS to the backup portion
|
| <4> Recover BIOS from the backup portion |
| <5> Reboot
|
=======================================================
Enter your choice(1-5):
(4)选择2,执行网络安装的功能:
=============================
| <1> Boot Linux From CF Card
|
| <2> Install Linux OS With Ethernet
|
| <3> Backup BIOS to the backup portion
|
| <4> Recover BIOS from the backup portion
|
| <5> Reboot
|
=======================================================
Enter your choice(1-5):2
Intel(R) Boot Agent GE v1.2.26
Copyright (C) 1997-2004, Intel Corporation
CLIENT MAC ADDR: 00 04 23 A7 5D E5
CLIENT IP: 192.168.0.110 MASK: 255.255.255.0 DHCP IP: 192.168.0.2
(5)网络安装启动后,从DHCP server可以获取一个192.168.0.0网段的IP地址并得到TFTP服务器地址为192.168.0.2,从服务器下载并加载了kernel以及ramdisk之后,就进入了Linux。
……….
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 2286k freed
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 132k freed
udhcpc[27]: udhcpc (v0.9.9-pre)
startedot exist
udhcpc[27]: Sending discover...
udhcpc[27]: Sending select for 192.168.0.118...
udhcpc[27]: Lease of 192.168.0.118 obtained, lease time 3600
Please press Enter to activate this console.
BusyBox v1.00 (2006.09.21-04:18+0000)
Built-in shell (ash)
Enter 'help' for a list of built-in commands.
/ #
(6)键入命令pxe_install all开始执行网络安装脚本,整个安装过程比较长,大概需要30分钟。
注:pxe_install命令有三种参数:
lpxe_install cf 只安装CF卡
lpxe_install hdisk 只安装硬盘
lpxe_install all 安装CF卡和硬盘
可以依据NSM单板的硬件配置进行,有选择性的进行安装。
/ # pxe_install all
fdisking cf card...
fdisk cf card ok
making cf card file system...
make cf card file system ok
mounting cf card...
mount cf card ok
downloading cf-centos4.4.tar.gz...
download cf-centos4.4.tar.gz ok
decompressing cf card file...
decompress cf-centos4.4.tar.gz ok
updating lilo...
update lilo ok
install cf card ok
fdisking hard disk...
fdisk hard disk ok
making hard disk file system...
make hard disk file system ok
mounting hard disk...
mount hard disk ok
downloading hdc-centos4.4.tar.gz...
download hdc-centos4.4.tar.gz ok
decompressing hard disk file...
decompress alt.tar.gz ok
decompress bin.tar.gz ok
decompress dev.tar.gz ok
decompress etc.tar.gz ok
decompress lib.tar.gz ok
decompress media.tar.gz ok
decompress root.tar.gz ok
decompress sbin.tar.gz ok
decompress srv.tar.gz ok
decompress sys.tar.gz ok
decompress tftpboot.tar.gz ok
decompress usr.tar.gz ok
decompress var.tar.gz ok
updating lilo...
update lilo ok
install hard disk ok
install completed
(7)执行reboot命令,重新启动NSM单板。
[root@localhost /root]#reboot
[root@localhost
/root]#/sbin/daemon_softdog: watchdog driver successfully unloaded
The system is going down NOW !!
Sending SIGTERM to all processes.
Please stand by while rebooting the system.
重新启动NSM单板,在系统启动过程中,不再进行干预,直至出现如下界面:
CentOS release 4.4 (Final)
Kernel 2.6.9-42.0.3.EL on an i686
localhost login:
经过以上的步骤,整个安装过程宣告结束,在CF卡上安装了Linux内核和Ramdisk文件系统;同时在硬盘上已经安装了一个比较完整的Linux文件系统,可以在此基础上进一步安装NSM软件,具体操作请参见
& 说明:
如果使用了pxe_install cf或pxe_install hdisk,则只在CF卡上或硬盘上完成了Linux系统的安装。
在网络安装之后,第一次启动系统,会强制进行文件系统的检测,耗时较长。
Checking all file systems.
[/sbin/fsck.ext3 (1) -- /alt] fsck.ext3 -a /dev/hdc2
[/sbin/fsck.ext3 (2) -- /boot] fsck.ext3 -a /dev/hda1
/alt has gone 49709 days without being checked, check forced.
/boot has gone 49709 days without being checked, check forced.
/boot: 25/62744 files (4.0%
non-contiguous), 30248/250352 blocks
/alt: 11/489600 files (0.0%
non-contiguous), 23583/977956 blocks
[/sbin/fsck.ext3 (1) -- /opt] fsck.ext3 -a /dev/hdc3
/opt has gone 49709 days without being checked, check forced.
注意:
如果升级失败可能导致单板无法使用,所以不建议用户自己通过网络安装操作系统。
4.4 NSM单板BIOS的备份
用户在BIOS菜单下键入<3>,将执行BIOS的备份操作。显示信息如下:
=============================
| <1> Boot Linux From CF Card
|
| <2> Install Linux OS With Ethernet
|
| <3> Backup BIOS to the backup portion
|
| <4> Recover BIOS from the backup portion
|
| <5> Reboot |
=======================================================
Enter your choice(1-5):3
flashWrite: src=02000000,
off=00000000, n=00010000
flashWrite: src=02010000,
off=00010000, n=00010000
flashWrite: src=02020000,
off=00020000, n=00010000
flashWrite: src=02030000,
off=00030000, n=00010000
flashWrite: src=02040000,
off=00040000, n=00010000
flashWrite: src=02050000,
off=00050000, n=00010000
flashWrite: src=02060000,
off=00060000, n=00010000
flashWrite: src=02070000, off=00070000,
n=00010000
flashWrite: src=02080000,
off=00080000, n=00010000
flashWrite: src=02090000,
off=00090000, n=00010000
flashWrite: src=020A0000,
off=000A0000, n=00010000
flashWrite: src=020B0000,
off=000B0000, n=00010000
flashWrite: src=020C0000, off=000C0000,
n=00010000
flashWrite: src=020D0000,
off=000D0000, n=00010000
flashWrite: src=020E0000,
off=000E0000, n=00010000
flashWrite: src=020F0000,
off=000F0000, n=00010000
BIOS Backup Successfully!
BIOS的备份操作就是将主BIOS中的内容备份到备份Flash当中。
4.5 NSM单板BIOS的恢复
用户在BIOS菜单下键入<4>,将执行BIOS的恢复操作。显示信息如下:
=============================
| <1> Boot Linux From CF Card
|
| <2> Install Linux OS With Ethernet
|
| <3> Backup BIOS to the backup portion |
| <4> Recover BIOS from the backup portion
|
| <5> Reboot
|
=======================================================
Enter your choice(1-5):4
flashWrite: src=02000000, off=00100000,
n=00010000
flashWrite: src=02010000,
off=00110000, n=00010000
flashWrite: src=02020000,
off=00120000, n=00010000
flashWrite: src=02030000,
off=00130000, n=00010000
flashWrite: src=02040000,
off=00140000, n=00010000
flashWrite: src=02050000, off=00150000,
n=00010000
flashWrite: src=02060000,
off=00160000, n=00010000
flashWrite: src=02070000,
off=00170000, n=00010000
flashWrite: src=02080000,
off=00180000, n=00010000
flashWrite: src=02090000,
off=00190000, n=00010000
flashWrite: src=020A0000, off=001A0000,
n=00010000
flashWrite: src=020B0000,
off=001B0000, n=00010000
flashWrite: src=020C0000,
off=001C0000, n=00010000
flashWrite: src=020D0000,
off=001D0000, n=00010000
flashWrite: src=020E0000,
off=001E0000, n=00010000
flashWrite: src=020F0000, off=001F0000, n=00010000
BIOS Recover Successfully!
BIOS的恢复操作就是将备份Flash中的内容恢复到主Flash当中。
由于NSM单板的特殊架构,无法在BIOS执行的期间升级BIOS,而且只有等到CF卡上的Linux系统启动之后,才可以升级BIOS。
选择linux-ramdisk启动,进入Linux系统后,使用TFTP从服务器上下载最新的NSM单板BIOS版本,NSM单板的BIOS文件命名是bios_vx.yy.bin,其中x标识主版本号,yy标识子版本号。
/tmp # tftp –g –r bios_v1.13.bin 192.168.0.2
下载后,执行BIOS的升级,
/tmp # bios_utility -u bios_v1.13.bin
.............................................................................
.............................................................................
建议同时也执行一下BIOS的备份,保证两块Flash当中的BIOS内容是一致的,当然,如果用户有特殊的需求,可以保持两块Flash中的BIOS内容不一致。
BIOS的备份按照如下方式操作:
/tmp # bios_utility -b
.............................................................................
.............................................................................
之后,重新启动系统。
在重新启动之后会提示这样的信息:
Something is wrong in normal flag region!
flashWrite: src=0009FFC4,
off=001D0000, n=00010000
这是由于更新BIOS的同时,破坏了标志区,BIOS第一次刷新后,需要软件刷新标志区,之后再次启动就不会有这样的提示了。
同时,用户还会看到下面的提示:
Something is wrong in backup flag region!
这样的提示,也是由于更新了备份区的BIOS,标志区信息需要软件重新刷新一下,只要用户从备份区启动一次就不会再出现这样的提示了。