openwrt fit
时间: 2023-09-23 09:05:10 浏览: 97
Openrt FIT(Flattened Image Tree)是OpenWrt操作系统中的一种文件格式,用于将多个组件打包成一个镜像文件。FIT文件中包含了内核、设备树和配置等信息。FIT文件的生成可以通过使用mkimage工具,并结合指定的FIT文件描述文件(.its文件)来完成。
在OpenWrt中生成FIT文件的命令示例可以如下所示:
```
mkimage -f /home/my/openwrt/build_dir/target-riscv64_riscv64_musl/linux-sunxid1/my-kernel.bin.its /home/my/openwrt/build_dir/target-riscv64_riscv64_musl/linux-sunxid1/my-kernel.bin.new
```
其中,`/home/my/openwrt/build_dir/target-riscv64_riscv64_musl/linux-sunxid1/my-kernel.bin.its`为FIT文件描述文件,`/home/my/openwrt/build_dir/target-riscv64_riscv64_musl/linux-sunxid1/my-kernel.bin.new`为生成的FIT文件的输出路径。
FIT文件描述文件(.its文件)的结构如下所示:
```
/dts-v1/;
/ {
description = "RISCV OpenWrt FIT (Flattened Image Tree)";
#address-cells = <1>;
images {
kernel-1 {
description = "RISCV OpenWrt Linux-5.15.31";
data = /incbin/("/home/my/openwrt/build_dir/target-riscv64_riscv64_musl/linux-sunxid1/my-kernel.bin");
type = "kernel";
arch = "riscv";
os = "linux";
compression = "none";
load = <0x40200000>;
entry = <0x40200000>;
hash@1 {
algo = "crc32";
};
hash@2 {
algo = "sha1";
};
};
fdt-1 {
description = "RISCV OpenWrt my device tree blob";
data = /incbin/("/home/my/openwrt/build_dir/target-riscv64_riscv64_musl/linux-sunxid1/linux-5.15.31/arch/riscv/boot/dts/allwinner/my.dtb");
type = "flat_dt";
arch = "riscv";
compression = "none";
hash@1 {
algo = "crc32";
};
hash@2 {
algo = "sha1";
};
};
};
configurations {
default = "config-1";
config-1 {
description = "OpenWrt my";
kernel = "kernel-1";
fdt = "fdt-1";
};
};
};
```
其中,`images`节点包含了内核和设备树的信息,`configurations`节点定义了不同的配置选项,并指定了对应的内核和设备树。
总结来说,OpenWrt FIT是OpenWrt操作系统中的一种文件格式,可用于打包内核、设备树和配置等信息。通过使用mkimage工具和FIT文件描述文件,可以生成FIT文件并指定不同的配置选项。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [OpenWrt fit 理解](https://blog.csdn.net/agave7/article/details/124017189)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文