Feature Request: Add --offset option to mkfs.erofs

Павел Отчерцов pavel.otchertsov at gmail.com
Tue Nov 7 08:15:24 AEDT 2023


Dear EROFS Developers,

I hope this message finds you well. I am reaching out to propose a feature
addition to the `erofs-utils` that I believe could benefit many users,
including myself.

As you know, `mksquashfs` offers an `-offset` option which allows users to
specify an offset in the file where the filesystem will begin.
This feature is particularly useful for embedding the SquashFS image into
firmware images or other specific scenarios where filesystems must coexist
with different data structures in a single image.

Currently, `mkfs.erofs` does not seem to support an equivalent option,
which limits its utility in scenarios similar to those where `mksquashfs`
is used.
The addition of an `--offset` option to `mkfs.erofs` could provide users
with the flexibility to specify the starting offset of the filesystem
within an image file.

The syntax for this could be as straightforward as:

```sh
Copy code
mkfs.erofs --offset=<offset-in-bytes> <destination-img> <source-directory>
```

This feature would align EROFS's functionality more closely with SquashFS,
potentially broadening its use cases and adoption.

Currently, I can achieve a similar result by first creating an image file
with the desired offset using `truncate`, and then concatenating the
filesystem image to the offset image using `cat`, like so:

```sh
truncate -s <offset-in-bytes> image_with_offset.img
cat erofs.img >> image_with_offset.img
```

However, this method is more cumbersome and less efficient than having an
integrated option in `mkfs.erofs`.
Implementing an `--offset` option would streamline the process and offer a
more elegant and direct approach.

I understand that such features require time and resources to implement,
and I appreciate the effort that goes into maintaining and improving
open-source software.
I believe this feature could enhance EROFS's utility for many users and
look forward to any possibility of its inclusion in future releases.

Thank you for your consideration and for the work you do to develop and
maintain EROFS. Please let me know if I can provide further information or
assist in any way.

Best regards,
Pavel Otchertsov <pavel.otchertsov at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linux-erofs/attachments/20231107/4f629818/attachment.htm>


More information about the Linux-erofs mailing list