我正在运行一个带有U-Boot作为引导加载程序的嵌入式板。我创建了一个基本的FIT映像,该映像使用设备树和RootFS映像引导Linux内核。
目前,我使用命令tftpboot boot.itb && bootm
引导FIT映像,它将成功引导默认配置。内核启动后不久,我想在RAM中挂载另一个只读分区。这将在Linux中作为安装点公开(例如/mnt/image
)。该分区将嵌入在FIT映像本身中,而不是存储在例如Flash中。
这可能吗?使用U-Boot,我可以将默认配置设置为使用标准RootFS作为虚拟磁盘,但是我可以拥有“两个”虚拟磁盘,一个从中启动,另一个从中挂载吗?
/dts-v1/;
/ {
description = "FIT Image";
#address-cells = <1>;
images {
kernel@0 {
description = "Linux Kernel";
data = /incbin/("./vmlinux.bin.gz");
type = "kernel";
arch = "ppc";
os = "linux";
compression = "gzip";
load = <0x00000000>;
entry = <0x00000000>;
hash@1 {
algo = "sha1";
};
};
fdt@0 {
description = "Flattened Device Tree blob";
data = /incbin/("./devicetree.dtb");
type = "flat_dt";
arch = "ppc";
compression = "none";
hash@1 {
algo = "sha1";
};
};
ramdisk@0 {
description = "ramdisk";
data = /incbin/("./rootfs.cpio.gz");
type = "ramdisk";
arch = "ppc";
os = "linux";
compression = "gzip";
hash@1 {
algo = "sha1";
};
};
};
configurations {
default = "conf@1";
conf@1 {
description = "Boot Linux kernel with FDT blob + ramdisk";
kernel = "kernel@0";
fdt = "fdt@0";
ramdisk = "ramdisk@0";
hash@1 {
algo = "sha1";
};
};
};
};