fwbin2pkg.sh

来自「无线网卡驱动程序 802.11b无线网卡可直接移植到2.6内核中去」· Shell 代码 · 共 53 行

SH
53
字号
#!/bin/bash# script to convert a binary fw package (output from gen_fw)# into a .h file for static inclusion# call fwbin2h.sh "comment" input_file output_fileif [ $# -ne 3 ]; then        echo "#ERR to convert a binary fw file into a .h file"        echo "#ERR call $0  "comment" input_file output_file"        exit 1fiDEBUG=1COMMENT=$1INF=$2OUTF=$3[ $DEBUG -eq 1 ] && echo "#DBG comment $COMMENT, converting $INF into $OUTF"echo '/* $Id: fwbin2pkg.sh,v 1.3 2006/06/21 08:50:08 maximsch2 Exp $ */' > $OUTFecho "/* $COMMENT */" >> $OUTFecho '/**************************************************************************/' >> $OUTFecho '/*                                                                        */' >> $OUTFecho '/*            Copyright (c) 1999-2000 by Atmel Corporation                */' >> $OUTFecho '/*                                                                        */' >> $OUTFecho '/*  This software is copyrighted by and is the sole property of Atmel     */' >> $OUTFecho '/*  Corporation.  All rights, title, ownership, or other interests        */' >> $OUTFecho '/*  in the software remain the property of Atmel Corporation.  This       */' >> $OUTFecho '/*  software may only be used in accordance with the corresponding        */' >> $OUTFecho '/*  license agreement.  Any un-authorized use, duplication, transmission, */' >> $OUTFecho '/*  distribution, or disclosure of this software is expressly forbidden.  */' >> $OUTFecho '/*                                                                        */' >> $OUTFecho '/*  This Copyright notice may not be removed or modified without prior    */' >> $OUTFecho '/*  written consent of Atmel Corporation.                                 */' >> $OUTFecho '/*                                                                        */' >> $OUTFecho '/*  Atmel Corporation, Inc. reserves the right to modify this software    */' >> $OUTFecho '/*  without notice.                                                       */' >> $OUTFecho '/*                                                                        */' >> $OUTFecho '/*  Atmel Corporation.                                                    */' >> $OUTFecho '/*  2325 Orchard Parkway               literature@atmel.com               */' >> $OUTFecho '/*  San Jose, CA 95131                 http://www.atmel.com               */' >> $OUTFecho '/*                                                                        */' >> $OUTFecho '/**************************************************************************/' >> $OUTFecho '' >> $OUTFecho 'u8 fw_bin[] = {' >> $OUTFod -An -tx1 -v -w8 $INF | sed 's/\([0-9a-f][0-9a-f]\)/0x\1,/g' >> $OUTFecho '};' >> $OUTFecho '' >> $OUTFecho "const struct firmware static_fw = {`ls -l $INF | awk '{print $5}'`, fw_bin};" >> $OUTFecho '' >> $OUTF

⌨️ 快捷键说明

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