Changes between Version 8 and Version 9 of Docs/Prog/Manual/Foundation/ApplicationModeStartup


Ignore:
Timestamp:
08/28/12 07:39:51 (12 years ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/Foundation/ApplicationModeStartup

    v8 v9  
    149149[[Top]]
    150150
     151
    151152== Appmenu Shell Script ==
    152153The script starts running another script which displays the application menu.
     154
    153155{{{
    154156# sh /usr/sbin/diag/appmenu.sh &
    155157}}}
     158
     159The command “sh” means to call a shell script. The “appmenu.sh” is the filename of the script, and the “&” ampersand character indicates that the script runs in a separate process from the terminal. This allows for typing commands from the terminal while the script is running. View the "appmenu.sh" script by from a terminal window by typing:
     160
     161{{{
     162cat /usr/sbin/diag/appmenu.sh
     163}}}
     164
     165Output:
    156166
    157167{{{
     
    220230}}}
    221231
     232
     233This script has a couple of comment lines at the beginning starting with the “#” character. It then has a while,do – done loop. The colon “:” after the while indicates an always true condition to continue the loop. The first statement within the while-do is “/usr/sbin/diag/appmenu”. This causes the script to execute a program file called “appmenu” just as if it were typed from the command line. The “/usr/sbin/diag/” specifies the directory the program is located in. The “appmenu” program displays a menu on the 825 indicator. The menu items presented are determined by reading configuration information from the NOR flash.
     234
    222235== Mounts ==
    223236
    224 The script also starts mounting the 64M NAND flash as /mnt/nand. The "&" is used to cause the mount to run in the background while the startup script continues on. You can view the current mount points by typing:
     237After the "appmenu.sh" script is started the "rc.local" script starts mounting the 64M NAND flash as /mnt/nand. The "&" is used to cause the mount to run in the background while the startup script continues on. You can view the current mount points by typing:
    225238{{{
    226239# cat /proc/mounts
    227240}}}
    228241
    229 
    230 [[Top]]
    231 
    232 
    233 The command “sh” means to call a shell script. The “appmenu.sh” is the filename of the script, and the “&” ampersand character indicates that the script runs in a separate process from the terminal. This allows for typing commands from the terminal while the script is running.
    234 
    235 To view this script type:
    236 {{{
    237 # cat /usr/sbin/diag/appmenu.sh
    238 }}}
    239 
    240 Output:
    241 {{{
    242 #!Lineno
    243 #!sh
    244 #!/bin/sh
    245 # App menu shell
    246 
    247 while :
    248 do
    249 /mnt/nand/bin/appmenu
    250 tmp=$?
    251 # store appmenu result in tmp so we can do something before case
    252 #echo "appmenu result"
    253 #echo $tmp
    254 case $tmp in
    255   1) /mnt/nand/apps/std/std ;;
    256   4) /mnt/nand/apps/ids/ids ;;
    257   5) /mnt/nand/apps/dfc/dfc ;;
    258   6) /mnt/nand/apps/chkwgh/chkwgh ;;
    259   7) cd /mnt/nand/apps/788IDS
    260   /mnt/nand/bin/cardbas 788IDS.77X
    261   cd /mnt/nand/bin     ;;
    262   12) /mnt/nand/bin/touchcal ;;
    263   13) sh /mnt/nand/bin/filemgr.sh ;;
    264   14) /mnt/nand/bin/imageview /mnt/nand/cfg/slideshow.cfg ;;
    265   21) sh /mnt/nand/bin/cust01.sh ;;
    266   22) sh /mnt/nand/bin/cust02.sh ;;
    267   23) sh /mnt/nand/bin/cust03.sh ;;
    268   24) sh /mnt/nand/bin/cust04.sh ;;
    269   25) sh /mnt/nand/bin/cust05.sh ;;
    270   26) sh /mnt/nand/bin/cust06.sh ;;
    271   27) sh /mnt/nand/bin/cust07.sh ;;
    272   28) sh /mnt/nand/bin/cust08.sh ;;
    273   29) sh /mnt/nand/bin/cust09.sh ;;
    274   30) sh /mnt/nand/bin/cust10.sh ;;
    275   31) sh /mnt/nand/bin/cust11.sh ;;
    276   32) sh /mnt/nand/bin/cust12.sh ;;
    277   33) sh /mnt/nand/bin/cust13.sh ;;
    278   34) sh /mnt/nand/bin/cust14.sh ;;
    279   35) sh /mnt/nand/bin/cust15.sh ;;
    280   36) sh /mnt/nand/bin/cust16.sh ;;
    281   37) sh /mnt/nand/bin/cust17.sh ;;
    282   38) sh /mnt/nand/bin/cust18.sh ;;
    283   99) echo "\`" > /dev/carddsp
    284 
    285   echo "Restarting...\\r" > /dev/carddsp
    286   cd /
    287   reboot &
    288   exit ;;
    289 esac
    290 done
    291 }}}
    292 
    293 This script has a couple of comment lines at the beginning starting with the “#” character. It then has a while,do – done loop. The colon “:” after the while indicates an always true condition to continue the loop. The first statement within the while-do is “/usr/sbin/diag/appmenu”. This causes the script to execute a program file called “appmenu” just as if it were typed from the command line. The “/usr/sbin/diag/” specifies the directory the program is located in. The “appmenu” program displays a menu on the 825 indicator. The menu items presented are determined by reading configuration information from the NOR flash.
    294242
    295243[[Top]]