-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
image: add support for EROFS rootfs image generation #19244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for continuing the thing... I find it impressive that erofs now is actually smaller than squashfs |
|
.... Resolve a build issue due to the lack of dependency of libtool... |
EROFS has landed advanced features like But currently EROFS is still lack of metadata compression, and I'm working on it, hopefully it could be resolved this year so that the image sizes can be even smaller. Also as for LZMA, it seems SquashFS supports to adjust |
|
@hsiangkao i feel lzma option should be easy to implement and should be enough to make it on par with squashfs performance. |
Yes, lzma options just need to add some command line option. Another one is the BCJ filter, XZ author @Larhzu already makes a generic interface in xz-utils 5.8.0 so that any compression algorithm in addition to lzma/xz can leverage that: https://github.com/tukaani-project/xz/releases/tag/v5.8.0 |
|
@Ansuel btw, is it possible to depend libuuid for erofs-utils? I've seen a macos failure which seems macos doesn't have getrandom(). Otherwise I may need a oot patch to work around this.. Another failure seems trivial, I've reran |
|
why libuuid? For the getrandom it's not the first time I see that... I remember we have some downstream patch to address that (thank god it's only that on macos) |
Random uuid generation needs that, although for openwrt use case, it's
could you give me some pointer? |
ideally if possible it should be optional. But is it for host tool or for the target system? The erofs-utils package is optional right? For getrandom I have to search let keep it that way currently. Maybe you can post here the oot patch |
I think it's a host tool.
Yes, I propose here as an optional one first.
I will try to mask off this with a oot patch, since I don't want to release a new erofs-utils version due to this. |
if it's only host tool then we don't really care about dependency. Totally ok to depend on that |
But I know little about the openwrt Makefile style, how to add libuuid dependency? |
Kernel stills seems to ask some questions |
What's wrong with that? |
Hi @aparcar! Oh, I forgot 6.6 has the kconfigs, will fix. |
❯ git diff
diff --git i/tools/erofs-utils/Makefile w/tools/erofs-utils/Makefile
index 9014e208da4..4fa77944462 100644
--- i/tools/erofs-utils/Makefile
+++ w/tools/erofs-utils/Makefile
@@ -12,7 +12,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
-PKG_MIRROR_HASH:=b9f054afc4cbba76ce889df9e4108b2a3a8ad266c9bcd94e4ca36680939d9c02
+PKG_MIRROR_HASH:=feab7386de6faf11cb29af5bfa240ea119b14bfd66c14d80de0509c1ab16dcc6
PKG_SOURCE_DATE:=2025-06-26
PKG_SOURCE_VERSION:=81169bf3cfd26b8f2b3aa3b20da23971168a90a9 |
repushed with kconfig changes and PKG_MIRROR_HASH. |
|
@hsiangkao @Ansuel what about the initramfs, can't we compress that via erofs, too? |
Do you mean erofs in the initramfs or the initrd one? I don't dig into how openwrt works on this so sorry about my limited knowledge. I suggest landing rootfs first since it takes too long and I found an extra slot these days. |
|
@aparcar why it still fails? I've already replaced the patch and it makes me no way to debug this issue... |
|
@hsiangkao please ignore it for no I will take care of fixing in free cycle :D |
It seems other than the style failure, the other CIs are passed now. |
What platforms are expected to boot with EROFS currently? I tried Currently have no means of getting logs though, sorry. Lost my serial cable somewhere. I'm assuming it failed to mount the system and panicked. |
ok stupid mistake! Thanks for bisecting it. |
|
Add erofs-utils to create an EROFS-based rootfs for image generation. Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: #19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add support for generating EROFS rootfs images. The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor. Target platform: linux-x86_generic (target-i386_pentium4_musl) Filesystem Image Size ============= ========== root.erofs 4882432 root.ext4 109051904 root.squashfs 4903302 Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: #19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add erofs-utils to create an EROFS-based rootfs for image generation. Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add support for generating EROFS rootfs images. The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor. Target platform: linux-x86_generic (target-i386_pentium4_musl) Filesystem Image Size ============= ========== root.erofs 4882432 root.ext4 109051904 root.squashfs 4903302 Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
Final confirmation: Xiaomi Router 3G (v1) boots EROFS after a clean reclone and modifying config-6.12 to have erofs instead of squashfs as rootfs in cmdline. |
|
Some more numbers from my second test device mvebu/cortexa9 (arm/cortex-a9+vfpv3-d16) ath79/generic (mips/24kc) Both targets have quite a few config changes, but the difference between both sets is only the EROFS feature and command line. Booting and running just fine for a couple of minutes. |
|
As said the results are a bit inconsistent. Would be ideal to understand
why...
Il Sab 5 Lug 2025, 17:45 Stefan Kalscheuer ***@***.***> ha
scritto:
… *stklcode* left a comment (openwrt/openwrt#19244)
<#19244 (comment)>
Some more numbers from my second test device
*mvwbu/cortexa9* (arm/cortex-a9+vfpv3-d16)
8446306 root.squashfs
8794112 root.erofs (+4.1%)
*ath79/generic* (mips/24kc)
4357596 root.squashfs
4349952 root.erofs (-0.2%)
Both targets have quite a few config changes, but the difference between
both sets is only the EROFS feature and command line. Booting and running
just fine for a couple of minutes.
—
Reply to this email directly, view it on GitHub
<#19244 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2ZMQRYMBFDDC7HXVDX27T3G7XKBAVCNFSM6AAAAACAH2WOGOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMZZGIYDQMRUGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Add support for generating EROFS rootfs images. The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor. Target platform: linux-x86_generic (target-i386_pentium4_musl) Filesystem Image Size ============= ========== root.erofs 4882432 root.ext4 109051904 root.squashfs 4903302 Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt/openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add support for generating EROFS rootfs images. The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor. Target platform: linux-x86_generic (target-i386_pentium4_musl) Filesystem Image Size ============= ========== root.erofs 4882432 root.ext4 109051904 root.squashfs 4903302 Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt/openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add erofs-utils to create an EROFS-based rootfs for image generation. Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt/openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add support for generating EROFS rootfs images. The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor. Target platform: linux-x86_generic (target-i386_pentium4_musl) Filesystem Image Size ============= ========== root.erofs 4882432 root.ext4 109051904 root.squashfs 4903302 Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt/openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add erofs-utils to create an EROFS-based rootfs for image generation. Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add support for generating EROFS rootfs images. The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor. Target platform: linux-x86_generic (target-i386_pentium4_musl) Filesystem Image Size ============= ========== root.erofs 4882432 root.ext4 109051904 root.squashfs 4903302 Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add erofs-utils to create an EROFS-based rootfs for image generation. Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add support for generating EROFS rootfs images. The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor. Target platform: linux-x86_generic (target-i386_pentium4_musl) Filesystem Image Size ============= ========== root.erofs 4882432 root.ext4 109051904 root.squashfs 4903302 Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add erofs-utils to create an EROFS-based rootfs for image generation. Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add support for generating EROFS rootfs images. The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor. Target platform: linux-x86_generic (target-i386_pentium4_musl) Filesystem Image Size ============= ========== root.erofs 4882432 root.ext4 109051904 root.squashfs 4903302 Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add erofs-utils to create an EROFS-based rootfs for image generation. Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add support for generating EROFS rootfs images. The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor. Target platform: linux-x86_generic (target-i386_pentium4_musl) Filesystem Image Size ============= ========== root.erofs 4882432 root.ext4 109051904 root.squashfs 4903302 Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add erofs-utils to create an EROFS-based rootfs for image generation. Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add support for generating EROFS rootfs images. The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor. Target platform: linux-x86_generic (target-i386_pentium4_musl) Filesystem Image Size ============= ========== root.erofs 4882432 root.ext4 109051904 root.squashfs 4903302 Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add erofs-utils to create an EROFS-based rootfs for image generation. Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add support for generating EROFS rootfs images. The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor. Target platform: linux-x86_generic (target-i386_pentium4_musl) Filesystem Image Size ============= ========== root.erofs 4882432 root.ext4 109051904 root.squashfs 4903302 Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: openwrt#19244 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
I come back to this PR - my Raspberry PI 4 (bcm27xx/bcm2711) does not boot from erosfs. Kernel starts but then ends with kernel panic when trying to mount root file system. Logs say that it supports ext4 and squashfs and root file system could not be identified. I've turned on erofs generation in menuconfig, that also selected kernel-support for erofs, but it does not work. Any ideas? I do not want to open an issue before knowing that it is really an OpenWrt issue. |
|
Probably missing
Did you try editing this line like this? -console=tty1 console=serial0,115200 root=@ROOT@ rootfstype=squashfs,ext4 rootwait
+console=tty1 console=serial0,115200 root=@ROOT@ rootfstype=erofs,squashfs,ext4 rootwait |
|
@stklcode Oh yes, i missed that. Works now. I think the erofs should be added to the default cmdline.txt for bcm27xx. |



Add support for generating EROFS rootfs images.
The EROFS filesystem can offer competitive I/O performance while minimizing final image size when using the MicroLZMA compressor.
Target platform: linux-x86_generic (target-i386_pentium4_musl)
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
This is a continue of #9968 @aparcar #14457 @Ansuel , and I already tested it works on x86 VMs.