Hi

Can you send the patch using git-send-email?  Your mailer is either sending the 
patch as plain&html attachments or reformatting the plain text, so git am can’t 
apply it.

Ross

> On 1 Nov 2022, at 11:42, Blake Alexander via lists.openembedded.org 
> <[email protected]> wrote:
> 
> [Edited Message Follows]
> [Reason: remove unneeded automatic footer and raw smtp headers]
> vfat partitions do not support sparse files. When using the rawcopy
> plugin to write an image to such a partition the filesystem may become
> corrupte. Boot systems such as UEFI require the boot partition to be a
> FAT type and this may therefore result in an un-bootable system due to
> boot partition corruption.
> 
> Sparse file copying is advantageous when the images consist of mostly
> empty or unused space. Systems using sparse file capable filesystems
> should not have this behaviour taken away from the, however, when using
> a non-compatible file system, the wic script should not perform sparse
> file operations. If required, the user shall be able to override this to
> achieve the behaviour prior to this patch.
> 
> The wic script will now check the filesystem type of the destination and
> use non-sparse copying functions if it matches the type 'vfat'. If
> 'allow-holes' is specified in the plugin parameters, then this will be
> ignored and sparse_copy shall be used instead.
> 
> Signed-off-by: Blake Alexander <[email protected]>
> ---
>  scripts/lib/wic/plugins/source/rawcopy.py | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/lib/wic/plugins/source/rawcopy.py 
> b/scripts/lib/wic/plugins/source/rawcopy.py
> index 7c90cd3cf8..1e0ddbac12 100644
> --- a/scripts/lib/wic/plugins/source/rawcopy.py
> +++ b/scripts/lib/wic/plugins/source/rawcopy.py
> @@ -89,10 +89,17 @@ class RawCopyPlugin(SourcePlugin):
>          if not os.path.exists(os.path.dirname(dst)):
>              os.makedirs(os.path.dirname(dst))
>  
> -        if 'skip' in source_params:
> +        # Sparse copy if the file system supports it or allow-holes is set 
> to override
> +        allow_holes = False if part.fstype == "vfat" and 
> source_params.get("allow-holes", True) else True
> +
> +        if allow_holes and 'skip' in source_params:
>              sparse_copy(src, dst, skip=int(source_params['skip']))
> -        else:
> +        elif allow_holes and 'skip' not in source_params:
>              sparse_copy(src, dst)
> +        elif not allow_holes and 'skip' in source_params:
> +            exec_cmd(f"dd if={src} of={dst} ibs={source_params['skip']} 
> skip=1 conv=notrunc")
> +        else:
> +            exec_cmd(f"cp --sparse=never {src} {dst}")
>  
>          # get the size in the right units for kickstart (kB)
>          du_cmd = "du -Lbks %s" % dst
> -- 
> 2.25.1
> 
> 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#172368): 
https://lists.openembedded.org/g/openembedded-core/message/172368
Mute This Topic: https://lists.openembedded.org/mt/94706878/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to