directories from the host into the file system that is created due to the <varname>Format=</varname>
option. If <varname>CopyFiles=</varname> is used without <varname>Format=</varname> specified
explicitly, <literal>Format=</literal> with a suitable default is implied (currently
- <literal>ext4</literal>, but this may change in the future). This option may be used multiple times
- to copy multiple files or directories from host into the newly formatted file system. The colon and
- second path may be omitted in which case the source path is also used as the target path (relative to
- the root of the newly created file system). If the source path refers to a directory it is copied
- recursively.</para>
+ <literal>vfat</literal> for <literal>ESP</literal> and <literal>XBOOTLDR</literal> partitions, and
+ <literal>ext4</literal> otherwise, but this may change in the future). This option may be used
+ multiple times to copy multiple files or directories from host into the newly formatted file system.
+ The colon and second path may be omitted in which case the source path is also used as the target
+ path (relative to the root of the newly created file system). If the source path refers to a
+ directory it is copied recursively.</para>
<para>This option has no effect if the partition already exists: it cannot be used to copy additional
files into an existing partition, it may only be used to populate a file system created anew.</para>
"Format=swap and CopyFiles= cannot be combined, refusing.");
if (!p->format && (!strv_isempty(p->copy_files) || !strv_isempty(p->make_directories) || (p->encrypt != ENCRYPT_OFF && !(p->copy_blocks_path || p->copy_blocks_auto)))) {
- /* Pick "ext4" as file system if we are configured to copy files or encrypt the device */
- p->format = strdup("ext4");
+ /* Pick "vfat" as file system for esp and xbootldr partitions, otherwise default to "ext4". */
+ p->format = strdup(IN_SET(p->type.designator, PARTITION_ESP, PARTITION_XBOOTLDR) ? "vfat" : "ext4");
if (!p->format)
return log_oom();
}