Skip to content

Commit

Permalink
refactor(rootfs): replace btrfs with erofs (#43)
Browse files Browse the repository at this point in the history
In our scenario, the rootfs is read-only and write operations are provided based on overlayfs. Therefore, we do not need to use the btrfs format. As a result, the size of the rootfs has been compressed to around 100M from the previous 1.6G.

Signed-off-by: Black-Hole1 <bh@bugs.cc>
  • Loading branch information
BlackHole1 authored Dec 14, 2023
1 parent 5d623b5 commit 5045d42
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion buildroot_external/board/ovm/init/rootfs-overlay/sbin/init
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi;


# mount rootfs
mount -n -m -t btrfs /dev/vda /mnt/rootfs
mount -n -m -t erofs /dev/vda /mnt/rootfs

# force format vdb
mkfs.btrfs -q -f /dev/vdb
Expand Down
5 changes: 3 additions & 2 deletions buildroot_external/configs/rootfs_amd64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ BR2_PACKAGE_UTIL_LINUX_WRITE=y
BR2_PACKAGE_UTIL_LINUX_ZRAMCTL=y
BR2_PACKAGE_LESS=y
BR2_PACKAGE_NANO=y
BR2_TARGET_ROOTFS_BTRFS=y
BR2_TARGET_ROOTFS_BTRFS_SIZE="1500m"
BR2_TARGET_ROOTFS_EROFS=y
BR2_TARGET_ROOTFS_EROFS_LZ4HC=y
BR2_TARGET_ROOTFS_EROFS_PCLUSTERSIZE=40960
BR2_PACKAGE_HOST_E2TOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_PWGEN=y
Expand Down
5 changes: 3 additions & 2 deletions buildroot_external/configs/rootfs_arm64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ BR2_PACKAGE_UTIL_LINUX_WRITE=y
BR2_PACKAGE_UTIL_LINUX_ZRAMCTL=y
BR2_PACKAGE_LESS=y
BR2_PACKAGE_NANO=y
BR2_TARGET_ROOTFS_BTRFS=y
BR2_TARGET_ROOTFS_BTRFS_SIZE="1500m"
BR2_TARGET_ROOTFS_EROFS=y
BR2_TARGET_ROOTFS_EROFS_LZ4HC=y
BR2_TARGET_ROOTFS_EROFS_PCLUSTERSIZE=40960
BR2_PACKAGE_HOST_E2TOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_PWGEN=y
Expand Down
1 change: 1 addition & 0 deletions kernel_external/configs/kernel_amd64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y
CONFIG_ROMFS_FS=y
CONFIG_EROFS_FS=y
CONFIG_VBOXSF_FS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
Expand Down
1 change: 1 addition & 0 deletions kernel_external/configs/kernel_arm64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ CONFIG_PSTORE_LZO_COMPRESS=y
CONFIG_PSTORE_LZ4_COMPRESS=y
CONFIG_PSTORE_ZSTD_COMPRESS=y
CONFIG_PSTORE_ZSTD_COMPRESS_DEFAULT=y
CONFIG_EROFS_FS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V4=y
CONFIG_NFS_V4_1=y
Expand Down

0 comments on commit 5045d42

Please sign in to comment.