基于现有dtb文件修改内容

当有修改dtb需要,又不想经过linux编译生成dtb时,可以通过dtc工具进行dtb->dts,dts->dtb的转换。

dtc工具可以进行dtb和dts之间的转换,dts是可编辑文本。

Ubuntu下安装dtc工具:

sudo apt-get install device-tree-compiler

1 dtc将dtb反编译为dts

dtc -I dtb -O dts xxx.dtb -o yyy.dts

2 编辑dts文件

编辑dts文件。

3 dtc将dts编译为dtb

dtc -I dts -O dtb yyy.dts -o zzz.dtb

4 验证修改

为了验证修改后的的dtb文件,可以将对dtb文件打印查看修改内容。

dtc -I dtb -O dts zzz.dtb

5 dtc使用

Usage: dtc [options] <input file>

Options: -[qI:O:o:V:d:R:S:p:a:fb:i:H:sW:E:@AThv]
  -q, --quiet                
    Quiet: -q suppress warnings, -qq errors, -qqq all
  -I, --in-format <arg>      
    Input formats are:
        dts - device tree source text
        dtb - device tree blob
        fs  - /proc/device-tree style directory
  -o, --out <arg>            
    Output file
  -O, --out-format <arg>     
    Output formats are:
        dts - device tree source text
        dtb - device tree blob
        yaml - device tree encoded as YAML
        asm - assembler source
  -V, --out-version <arg>    
    Blob version to produce, defaults to 17 (for dtb and asm output)
  -d, --out-dependency <arg> 
    Output dependency file

基于现有dtb文件修改内容
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值