• learning uboot source command


    reference:

    http://www.denx.de/wiki/DULG/UBootCmdGroupExec

     

    => help source
    source - run script from memory
    
    Usage:
    source [addr]
       - run script starting at addr
       - A valid image header must be present
    =>
    

    With the source command you can run "shell" scripts under U-Boot: You create a U-Boot script image by simply writing the commands you want to run into a text file; then you will have to use the mkimage tool to convert this text file into a U-Boot image (using the image type script).

    This image can be loaded like any other image file, and with source you can run the commands in such an image. For instance, the following text file:

    echo
    echo Network Configuration:
    echo ----------------------
    echo Target:
    printenv ipaddr hostname
    echo
    echo Server:
    printenv serverip rootpath
    echo
    
    

    can be converted into a U-Boot script image using the mkimage command like this:

    bash$ mkimage -A ppc -O linux -T script -C none -a 0 -e 0 
    > -n "autoscr example script" 
    > -d ./testsystems/dulg/testcases/example.script /tftpboot/duts/canyonlands/example.scr
    Image Name:   autoscr example script
    Created:      Mon Feb  8 16:36:04 2010
    Image Type:   PowerPC Linux Script (uncompressed)
    Data Size:    157 Bytes = 0.15 kB = 0.00 MB
    Load Address: 0x00000000
    Entry Point:  0x00000000
    Contents:
       Image 0:    149 Bytes =   0 kB = 0 MB
    

    Now you can load and execute this script image in U-Boot:

    => tftp 0x100000 /tftpboot/duts/canyonlands/example.scr
    Using ppc_4xx_eth0 device
    TFTP from server 192.168.1.1; our IP address is 192.168.100.6
    Filename '/tftpboot/duts/canyonlands/example.scr'.
    Load address: 0x100000
    Loading: #
    done
    Bytes transferred = 221 (dd hex)
    => imi
    
    ## Checking Image at 00100000 ...
       Legacy image found
       Image Name:    autoscr example script
       Created:    2010-02-08  15:36:04 UTC
       Image Type:    PowerPC Linux Script (uncompressed)
       Data Size:    157 Bytes =  0.2 kB
       Load Address: 00000000
       Entry Point:    00000000
       Contents:
          Image 0: 149 Bytes =  0.1 kB
       Verifying Checksum ... OK
    => source 0x100000
    ## Executing script at 00100000
    
    Network Configuration:
    ----------------------
    Target:
    ipaddr=192.168.100.6
    hostname=canyonlands
    
    Server:
    serverip=192.168.1.1
    rootpath=/opt/eldk/ppc_4xxFP
    
    =>

     

     

  • 相关阅读:
    玩聚网和百度新闻的技术差异性
    拿下“[warn] (OS 64)指定的网络名不再可用”错误
    转型要回答的四个问题和一根筋变形Push法
    奇虎之奇酷改版为热点memeTracker之分析
    新媒体的运营之道【三】
    疑似BUG:Python SGMLParser处理html中的javascript失当
    智能语义参透股票 小公司不见得比输大公司
    新SNS的创立和运营之道[360圈座谈]
    在路上:语义和创业
    论Push!
  • 原文地址:https://www.cnblogs.com/lianghong881018/p/10219820.html
Copyright © 2020-2023  润新知