Using CPIO based RootFS has following advantages over EXT2 INITRD:
1. The CPIO RootFS image is generally smaller than EXT2 RootFS image
2. It boots faster compared to EXT2 RootFS image
3. The EXT2 RootFS image cannot grow at runtime where as CPIO based
RootFS can grow because its basically initramfs
4. Most folks in Linux user community prefer CPIO initramfs over
filesystem based INITRD.
Signed-off-by: Anup Patel <
an...@brainfault.org>
---
tests/arm32/common/busybox/README | 18 +++++++++++++++---
tests/arm64/common/busybox/README | 18 +++++++++++++++---
2 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/tests/arm32/common/busybox/README b/tests/arm32/common/busybox/README
index 3e03651..7907be6 100644
--- a/tests/arm32/common/busybox/README
+++ b/tests/arm32/common/busybox/README
@@ -67,10 +67,22 @@ RootFS for ARM Linux guest:
[7. Change ownership of installed RootFS]
# sudo chown -R root:root ./_install
- [8. Create RootFS image]
- # fakeroot /bin/bash -c "genext2fs -b 5120 -N 1024 -D <xvisor_source_directory>/tests/arm32/common/busybox/busybox_dev.txt -d ./_install <busybox_rootfs_directory>/rootfs.img"
+ [8. Create RootFS EXT2 image]
+ # fakeroot /bin/bash -c "genext2fs -b 5120 -N 1024 -D <xvisor_source_directory>/tests/arm32/common/busybox/busybox_dev.txt -d ./_install <busybox_rootfs_directory>/rootfs.ext2"
+
+ [9. Create RootFS CPIO image]
+ # mkdir -p <busybox_rootfs_directory>/tmp
+ # sudo mount -o loop <busybox_rootfs_directory>/rootfs.ext2 <busybox_rootfs_directory>/tmp
+ # cd <busybox_rootfs_directory>/tmp; sudo find ./ | cpio -o -H newc > <busybox_rootfs_directory>/rootfs.img; cd -
+ # sudo umount <busybox_rootfs_directory>/tmp
+ OR
+ # mkdir -p <busybox_rootfs_directory>/tmp
+ # sudo mount -o loop <busybox_rootfs_directory>/rootfs.ext2 <busybox_rootfs_directory>/tmp
+ # cd <busybox_rootfs_directory>/tmp; sudo find ./ | cpio -o -H newc | gzip -9 > <busybox_rootfs_directory>/rootfs.img; cd -
+ # sudo umount <busybox_rootfs_directory>/tmp
- (Note: <busybox_rootfs_directory>/rootfs.img is our final RAMDISK)
+ (Note: <busybox_rootfs_directory>/rootfs.img is our final INITRAMFS RootFS)
+ (Note: you can also use <busybox_rootfs_directory>/rootfs.ext2 as your final INITRD RootFS)
(Note: replace all <> brackets based on your workspace)
(Note: you are free to the change ordering of above steps based on your workspace)
diff --git a/tests/arm64/common/busybox/README b/tests/arm64/common/busybox/README
index 9e72798..2acc4ef 100644
--- a/tests/arm64/common/busybox/README
+++ b/tests/arm64/common/busybox/README
@@ -30,9 +30,21 @@ RootFS for ARM64 Linux guest:
# sudo chown -R root:root ./_install
[7. Create RootFS image]
- # fakeroot /bin/bash -c "genext2fs -b 5120 -N 1024 -D <xvisor_source_directory>/tests/arm64/common/busybox/busybox_dev.txt -d ./_install <busybox_rootfs_directory>/rootfs64.img"
-
- (Note: <busybox_rootfs_directory>/rootfs64.img is our final RAMDISK)
+ # fakeroot /bin/bash -c "genext2fs -b 5120 -N 1024 -D <xvisor_source_directory>/tests/arm64/common/busybox/busybox_dev.txt -d ./_install <busybox_rootfs_directory>/rootfs64.ext2"
+
+ [8. Create RootFS CPIO image]
+ # mkdir -p <busybox_rootfs_directory>/tmp
+ # sudo mount -o loop <busybox_rootfs_directory>/rootfs64.ext2 <busybox_rootfs_directory>/tmp
+ # cd <busybox_rootfs_directory>/tmp; sudo find ./ | cpio -o -H newc > <busybox_rootfs_directory>/rootfs64.img; cd -
+ # sudo umount <busybox_rootfs_directory>/tmp
+ OR
+ # mkdir -p <busybox_rootfs_directory>/tmp
+ # sudo mount -o loop <busybox_rootfs_directory>/rootfs64.ext2 <busybox_rootfs_directory>/tmp
+ # cd <busybox_rootfs_directory>/tmp; sudo find ./ | cpio -o -H newc | gzip -9 > <busybox_rootfs_directory>/rootfs64.img; cd -
+ # sudo umount <busybox_rootfs_directory>/tmp
+
+ (Note: <busybox_rootfs_directory>/rootfs64.img is our final INITRAMFS RootFS)
+ (Note: you can also use <busybox_rootfs_directory>/rootfs64.ext2 as your final INITRD RootFS)
(Note: replace all <> brackets based on your workspace)
(Note: you are free to the change ordering of above steps based on your workspace)
--
1.9.1