Skip to content
Commit fbd244c2 authored by Yann E. MORIN's avatar Yann E. MORIN Committed by Thomas Petazzoni
Browse files

package/mke2img: always create sparse files



When the user specifies a number of blocks (and we do not auto-compute
them), the generated filesystem can be quite large with large zones with
only zeroes in them.

Thus, always create the filesystem as a sparse file.

Sparse files behave the same as normal files, except those long runs of
zeroes do not actually use space on the (host) filesystem. Also, this
should not break current behaviour, as neither cp nor dd nor cat preserve
sparseness by default. So users relying on the zeroed parts to actually
be written won;t see a change. Users that were expressly using cp or dd
to copy files to a sparse destination will however see a little bit of
improvements, as the zeroed out parts won't even be read from disk.

Signed-off-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: default avatarSamuel Martin <s.martin49@gmail.com>
Tested-by: default avatarKaroly Kasza <kaszak@gmail.com>
Reviewed-by: default avatarKaroly Kasza <kaszak@gmail.com>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 64f94d11
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment