Conversation
|
Also added a patch to enable btrfs compression and add a note that something like |
lib/generate.sh
Outdated
| ;; | ||
| erofs) | ||
| mkfs.erofs "${fname}" "${basedir}" | ||
| mkfs.erofs -zlz4 --all-root "${fname}" "${basedir}" |
There was a problem hiding this comment.
I suggest using -zlz4hc,12 instead of -zlz4 unless the build time is sensitive, also
it's preferable to use -C65536 -Efragments to match squashfs default configuration at least.
Thank you for the comment! Now I've checked the https://github.com/erofs/erofs-utils README and I see there, too. I also thought about LZMA because a 5.16 kernel could be a low enough requirement. What would be better in that case, lz4hc or LZMA? Also considering long term plans? |
I may need to refine the README in the later version and prefer the website
It depends on the specific use cases, for Android use cases, almost all users use lz4hc and 4k pclusters for the best random runtime performance. |
2d20a65 to
5e0ee8b
Compare
The EROFS mkfs invocation missed the --all-root flag to make sure that the files are owned by root regardless of the current UID during image generation. By default EROFS also doesn't compress and we can use LZ4 as a lightweight compresson option (LZMA would also work). Another problem is that the random filesystem UUID breaks reproducibility. Add the --all-root flag and the compression flag to mkfs.erofs to use UID 0, compress the contents following upstream recommendations (e.g. same compression blocksize as squashfs), and set a zero UUID (maybe we could also calculate one based on hashing the name and the version). Signed-off-by: Kai Lueke <kailuke@microsoft.com>
Since some time mkfs.btrfs supports compression. For cases where it is used instead of squashfs or erofs it makes sense to enable it for size savings. Also add a note that the resulting files won't be owned as root if the image is created by another user. Signed-off-by: Kai Lueke <kailuke@microsoft.com>
The service failed to start because the binary lacked execution permissions. Signed-off-by: Kai Lueke <kailuke@microsoft.com>
|
Thanks, updated the mkfs.erofs options with the recommendations from the guide. I've also noticed that by default it's not reproducible, and I had to add Edit: We already set |
|
|
By the way, while testing the compression flags in |
There is no such unique interface, but I could add the minimal kernel version to the output of |
|
@flatcar/flatcar-integrations Can you review the changes? |
|
Looks good. The only slight worry I had was if systemd won't get confused if there are multiple sysexts with the same (zero) UUID. I've tested this on latest alpha and it works as expected, so I guess that's not an issue. EDIT: I've just realized squashfs does not support UUID at all, so this should be absolutely fine. |
|
Thanks, yes, I should have written that I've also tested this and that squashfs doesn't have one either and a zero UUID won't show up in |
The EROFS mkfs invocation missed the --all-root flag to make sure that the files are owned by root regardless of the current UID during image generation. By default EROFS also doesn't compress and we can use LZ4 as a lightweight compresson option (LZMA would also work). Add the --all-root flag and the compression flag to mkfs.erofs to use UID 0 and compress the contents.
How to use
And then copy via ssh to a Flatcar VM, move the file under
/etc/extensions/and reload the sysexts.Testing done
The wasmtime binary is now owned by root and the resulting image is half the size thanks to compression.