系统升级

A0 项目 Linux 系统支持在线升级,采用 A/B 分区交替更新策略,系统启动时会根据标志决定从那个分区启动。下面主要介绍与系统升级相关的几个命令的使用方法。

update_ack

update_ack 升级信息放在 eeprom 上。

[root@asing]:~#:update_ack -h
update_ack tool (v0.0.1)
usage:
      update_ack [-a <0 | 1>] <-u|-l|-i|-f> [-w file] :show version, if area omitted, show current area
      update_ack -g                :show current area                  显示当前分区情况
      update_ack -r                :switch area                        切换分区
      update_ack -c                :cancel switch area                 取消切换分区
      update_ack -s -a <0 | 1 | 2> :set current area, 0:a, 1:b, 2:nfs  设置运行分区 1  2 或者nfs方式
      update_ack -b                :ack boot status                    上电完成后清计数器和分区切换标志(上电完成后自动运行)

显示目前运行的版本信息

[root@asing]:~#:update_ack -f  
HAL ver:V10006
FPGA ver:V1.1.1.00004
BOOT ver:UAG078-V03.00.01.00
KERNEL ver:KAG078-V00.01.00.00
ROOTFS ver:AG078-V03.00.01.00.00.00

查看当前运行分区情况

[root@asing]:~#:update_ack -g                                   
run_part:0x2 bak_part:0x2 run_cnt:0x0 bak_cnt:0x0 16
bak area is 1   如果分区切换或者升级,会切换到1 分区
run area is 2   当前分区是2

分区切换

update_ack -r

取消分区切换

update_ack -c

指定分区运行:(分区A 分区B NFS 方式)

update_ack -s -a <0 | 1 | 2>

上电完成后也或把版本信息打印到 /tmp/osmodules_version

HAL ver:	V10006
FPGA ver:	V1.1.1.00004
BOOT ver:	UAG078-V03.00.01.00
KERNEL ver:	KAG078-V00.01.00.00
ROOTFS ver:	AG078-V03.00.01.00.00.00

上电完成后也或把分区信息打印到 /tmp/update_version

[root@asing]:~#:cat  /tmp/update_version 
run_part:0x2 bak_part:0x2 run_cnt:0x0 bak_cnt:0x0 16
bak area is 1
run area is 2

ImageUpgrade

镜像文件升级命令

[root@asing]:~#:ImageUpgrade -h
Usage: /usr/sbin/ImageUpgrade <image file>
       /usr/sbin/ImageUpgrade -a <0|1> -t <boot | fpga | kernel | rootfs | app> <image file>
Options:
        -a <area>               upgrade the specific area <0 | 1>
        -t <type>               upgrade the specific firmware <boot | fpga | kernel | rootfs | app>
        -c <compare>    compare <0 | 1>
        -h / --help             display this help

实例1:不校准

ImageUpgrade update.IMG

实例2:不校准

ImageUpgrade -c 0 update.IMG

实例3:校准

ImageUpgrade -c 1 update.IMG

上电版本信息打印见附件

eeprom-tools

eeprom-tools 命令使用

[root@asing]:~#:eeprom-tools -h
Usage: eeprom-tools -t operation [rwh?] 
        -t  operation -r: Read Info From EEPROM.Format: eeprom-tools -t operation -r
        -t  operation -w: Write Info to EEPROM.Format: eeprom-tools -t operation -w XXXXXXXXXXXX
        -t  operation(mac,sn,pwr1,pwr2,fo,uboot_ver,btype,hw,gps,bootm,upgrade,rx1,rx2,desc,vendor,issue,clei,bom,module,exmodule,dfre_min,dfre_max,ufre_min,ufre_max,hwcap,bandmask,maxpower,oscfreq,platform,freqlist,hwmask,mac1)
        -h(?): Help information
[root@asing]:~#:

实例1:读取mac地址

eeprom-tools -t mac  -r

实例2:修改mac地址

eeprom-tools -t mac -w 000A3555AA6D