upgrade_me.sh

来自「ALtera网络Blaster的映射文件」· Shell 代码 · 共 71 行

SH
71
字号
#!/bin/sh# this is the real upgrade shell script for the firmwareif [ -z "$OUR_LOG" ]then    OUR_LOG=/tmp/fwupg.logfiecho "$0 Starting..." >> $OUR_LOG# import some functions. /sbin/sys_utilsWORKINGDIR=`pwd`IMAGEDIR=/flash/firmware/imageif [ ! -f "firmware.tar.gz" ]then    echo "Firmware file doesn't exist!" >> $OUR_LOG    exit 1fi# now verify the checksum of the firmware filemd5sum -c firmware.md5if [ $? -ne 0 ]then    echo "Firmware MD5 did not match!" >> $OUR_LOG    exit 1fi# stop some processesecho "Stopping some processes" >> $OUR_LOGkillproc jtagdkillproc enb_listener# link an image directory to /tmp to reduce spaceln -s /tmp $IMAGEDIR# unpack the firmware tarfileecho "Unpacking firmware tarfile" >> $OUR_LOGsh -c "(cd /flash ; gunzip -c $WORKINGDIR/firmware.tar.gz | tar xpf -)"if [ $? -ne 0 ]then    echo "Firmware didn't unpack correctly" >> $OUR_LOG    exit 1fiif [ -f $IMAGEDIR/ramdisk.gz ]then    flashtool -w -f $IMAGEDIR/ramdisk.gz -n ramdisk    rm -f $IMAGEDIR/ramdisk.gzfiif [ -f $IMAGEDIR/zImage ]then    flashtool -w -f $IMAGEDIR/zImage -n zImage    rm -f $IMAGEDIR/zImagefi# the firmware unpacked correctly. The upgrade script will make us the primary# firmware file now, and reboot ussleep 1exit 0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?