* Re: [feature request] extract a single file from EROFS filesystem
@ 2025-07-13 16:55 Mingye Wang
2025-07-14 0:02 ` Gao Xiang
0 siblings, 1 reply; 5+ messages in thread
From: Mingye Wang @ 2025-07-13 16:55 UTC (permalink / raw)
To: hsiangkao; +Cc: linux-erofs, derez
Hi all,
>Gao Xiang Thu, 09 Jan 2025 01:36:16 -0800
>On 2025/1/9 02:14, Daniel Erez wrote:
>>Would it be applicable to introduce an option for extracting a specific file
>>from the image?
>>I.e. something similar to the '-extract-file' option available in unsquashfs tool [2].
>I will add this later.
I am seeing a need for a similar feature in making dracut's lsinitrd
work... a little better. I should add two cents of my own.
* In "unsquashfs" there's not only '-extract-file' for passing in a
list of files, but also a possibility for a list of paths to be
specified directly as arguments. This would appear outlandish on an
fsck utility.
* When extracting single files it might be desirable to *not* verify
and pretend-extract the other files.
Because of these two reasons, I think it might be best to make an
"unerofs" for extraction purposes instead of adding more things to the
"fsck" tool. An initial version can just be a separate "main" fuction
in fsck.c that gets used when an argv[0] equal to "unerofs" or ending
with "/unerofs" is found.
Sincerely,
Mingye Wang (Artoria2e5)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [feature request] extract a single file from EROFS filesystem
2025-07-13 16:55 [feature request] extract a single file from EROFS filesystem Mingye Wang
@ 2025-07-14 0:02 ` Gao Xiang
2025-07-14 0:18 ` Gao Xiang
0 siblings, 1 reply; 5+ messages in thread
From: Gao Xiang @ 2025-07-14 0:02 UTC (permalink / raw)
To: Mingye Wang; +Cc: hsiangkao, linux-erofs, derez
Hi Mingye,
On Mon, Jul 14, 2025 at 12:55:06AM +0800, Mingye Wang wrote:
> Hi all,
>
> >Gao Xiang Thu, 09 Jan 2025 01:36:16 -0800
> >On 2025/1/9 02:14, Daniel Erez wrote:
> >>Would it be applicable to introduce an option for extracting a specific file
> >>from the image?
> >>I.e. something similar to the '-extract-file' option available in unsquashfs tool [2].
> >I will add this later.
>
> I am seeing a need for a similar feature in making dracut's lsinitrd
> work... a little better. I should add two cents of my own.
dump.erofs already supports `--cat` command to dump a single file.
>
> * In "unsquashfs" there's not only '-extract-file' for passing in a
> list of files, but also a possibility for a list of paths to be
> specified directly as arguments. This would appear outlandish on an
> fsck utility.
Can those be replaced as dump.erofs --cat?
> * When extracting single files it might be desirable to *not* verify
> and pretend-extract the other files.
`fsck.erofs` can be used to dump a subtree in the future (exclude file
pattern can be applied), fsck/dump/mkfs tools are more common for
generic filesystems.
Mimick Squashfs-specific is not EROFS will do since I do see `un`-prefix
is common and lack of (even defacto) standardization.
Thanks,
Gao Xiang
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [feature request] extract a single file from EROFS filesystem
2025-07-14 0:02 ` Gao Xiang
@ 2025-07-14 0:18 ` Gao Xiang
0 siblings, 0 replies; 5+ messages in thread
From: Gao Xiang @ 2025-07-14 0:18 UTC (permalink / raw)
To: Mingye Wang, hsiangkao, linux-erofs, derez
On Mon, Jul 14, 2025 at 08:02:13AM +0800, Gao Xiang wrote:
> Hi Mingye,
>
> On Mon, Jul 14, 2025 at 12:55:06AM +0800, Mingye Wang wrote:
> > Hi all,
> >
> > >Gao Xiang Thu, 09 Jan 2025 01:36:16 -0800
> > >On 2025/1/9 02:14, Daniel Erez wrote:
> > >>Would it be applicable to introduce an option for extracting a specific file
> > >>from the image?
> > >>I.e. something similar to the '-extract-file' option available in unsquashfs tool [2].
> > >I will add this later.
> >
> > I am seeing a need for a similar feature in making dracut's lsinitrd
> > work... a little better. I should add two cents of my own.
>
> dump.erofs already supports `--cat` command to dump a single file.
>
> >
> > * In "unsquashfs" there's not only '-extract-file' for passing in a
> > list of files, but also a possibility for a list of paths to be
> > specified directly as arguments. This would appear outlandish on an
> > fsck utility.
>
> Can those be replaced as dump.erofs --cat?
>
> > * When extracting single files it might be desirable to *not* verify
> > and pretend-extract the other files.
>
> `fsck.erofs` can be used to dump a subtree in the future (exclude file
> pattern can be applied), fsck/dump/mkfs tools are more common for
> generic filesystems.
>
> Mimick Squashfs-specific is not EROFS will do since I do see `un`-prefix
> is common and lack of (even defacto) standardization.
In other words, if you care more about a subtree or a whole filesystem
dump, all (sub-)tree metadata/data should be checked first, and that is
what `fsck.erofs` does and the dumped files are only side products for
data verification (because fsck needs to check compressed data is valid
too.)
If you only care about some individual inodes, that is what `dump.erofs`
works, including `--cat` shows inode content, `--ls` shows directory
content, `-e` shows extent map, etc.
Thanks,
Gao Xiang
>
> Thanks,
> Gao Xiang
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [feature request] extract a single file from EROFS filesystem
@ 2025-01-08 18:14 Daniel Erez
2025-01-09 9:35 ` Gao Xiang
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Erez @ 2025-01-08 18:14 UTC (permalink / raw)
To: linux-erofs; +Cc: Linoy Hadad, Kaplan, Alona
[-- Attachment #1: Type: text/plain, Size: 528 bytes --]
Hi,
According to fsck.erofs manual [1], the tool supports extracting the whole
file system.
Would it be applicable to introduce an option for extracting a specific
file from the image?
I.e. something similar to the '-extract-file' option available in
unsquashfs tool [2].
Or, is there any other alternative for extracting a file from an EROFS
image?
[1] https://man.archlinux.org/man/extra/erofs-utils/fsck.erofs.1.en#extract
[2]
https://manpages.debian.org/testing/squashfs-tools/unsquashfs.1.en.html#extract
Thanks!
Daniel
[-- Attachment #2: Type: text/html, Size: 798 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [feature request] extract a single file from EROFS filesystem
2025-01-08 18:14 Daniel Erez
@ 2025-01-09 9:35 ` Gao Xiang
0 siblings, 0 replies; 5+ messages in thread
From: Gao Xiang @ 2025-01-09 9:35 UTC (permalink / raw)
To: Daniel Erez, linux-erofs; +Cc: Kaplan, Alona, Linoy Hadad
Hi,
On 2025/1/9 02:14, Daniel Erez wrote:
> Hi,
>
> According to fsck.erofs manual [1], the tool supports extracting the whole file system.
> Would it be applicable to introduce an option for extracting a specific file from the image?
> I.e. something similar to the '-extract-file' option available in unsquashfs tool [2].
> Or, is there any other alternative for extracting a file from an EROFS image?
>
> [1] https://man.archlinux.org/man/extra/erofs-utils/fsck.erofs.1.en#extract <https://man.archlinux.org/man/extra/erofs-utils/fsck.erofs.1.en#extract>
> [2] https://manpages.debian.org/testing/squashfs-tools/unsquashfs.1.en.html#extract <https://manpages.debian.org/testing/squashfs-tools/unsquashfs.1.en.html#extract>
I will add this later.
Thanks,
Gao Xiang
>
> Thanks!
> Daniel
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-07-14 0:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-13 16:55 [feature request] extract a single file from EROFS filesystem Mingye Wang
2025-07-14 0:02 ` Gao Xiang
2025-07-14 0:18 ` Gao Xiang
-- strict thread matches above, loose matches on Subject: below --
2025-01-08 18:14 Daniel Erez
2025-01-09 9:35 ` Gao Xiang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.