Changeset 4421


Ignore:
Timestamp:
05/09/08 17:00:39 (5 years ago)
Author:
werner
Message:

The changes below make it a bit easier to fit mknor into scripts and to
select alternative configurations.

mknor: added general option parsing
mknor: new option -s splash_image to change the splash image file
mknor: new option -D to add definitions for envedit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/host/devirginator/mknor

    r4231 r4421  
    4545usage() 
    4646{ 
    47     echo "usage: $0 [-o outfile ] u-boot" 1>&2 
     47cat <<EOF 1<&2 
     48usage: $0 [-o outfile] [-s splash_image] [-D define ...] u-boot 
     49 
     50  -o outfile       write NOR image to specified file. Default: nor.bin 
     51  -s splash_image  use the specified splash image. Default: tmp/System_boot.png 
     52  -D define        pass definition to envedit 
     53EOF 
    4854    exit 1 
    4955} 
     
    5157 
    5258out=nor.bin 
    53 if [ "$1" = -o ]; then 
    54     [ ! -z "$2" ] || usage 
    55     out="$2" 
    56     shift 2 
    57 fi 
     59splash=tmp/System_boot.png 
     60defines= 
     61 
     62while [ ! -z "$*" ]; do 
     63    case "$1" in 
     64        -o)     shift 
     65                [ ! -z "$1" ] || usage 
     66                out="$1";; 
     67        -s)     shift 
     68                [ ! -z "$1" ] || usage 
     69                splash="$1";; 
     70        -D)     shift 
     71                [ ! -z "$1" ] || usage 
     72                defines="$defines -D $1";; 
     73        -*)     usage;; 
     74        *)      break;; 
     75    esac 
     76    shift 
     77done 
     78 
    5879[ ! -z "$1" -a -z "$2" ] || usage 
    5980uboot="$1" 
     
    6788EOF 
    6889 
    69 pngtopnm tmp/System_boot.png | 
     90pngtopnm "$splash" | 
    7091  pamcut 0 145 480 240 | 
    7192  ../splash/splashimg.pl -pnm - | 
    7293  gzip -9 >_splash 
    7394 
    74 ./envedit.pl -D GTA02 -D NOR_ENV -f environment.in -o _env 
     95./envedit.pl -D GTA02 -D NOR_ENV $defines -f environment.in -o _env 
    7596 
    7697./blink.pl \ 
Note: See TracChangeset for help on using the changeset viewer.