From: Daan De Meyer Date: Mon, 22 May 2023 17:32:18 +0000 (+0200) Subject: repart: Default to vfat for ESP/XBOOTLDR partitions X-Git-Tag: v254-rc1~418 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab45e83fb67438124eea4c2457e5496e44a48d8d;p=thirdparty%2Fsystemd.git repart: Default to vfat for ESP/XBOOTLDR partitions vfat makes a lot more sense than ext4 for these partitions. --- diff --git a/man/repart.d.xml b/man/repart.d.xml index 464bbf076d9..d272d112da6 100644 --- a/man/repart.d.xml +++ b/man/repart.d.xml @@ -409,11 +409,12 @@ directories from the host into the file system that is created due to the Format= option. If CopyFiles= is used without Format= specified explicitly, Format= with a suitable default is implied (currently - ext4, 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. + vfat for ESP and XBOOTLDR partitions, and + ext4 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. 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. diff --git a/src/partition/repart.c b/src/partition/repart.c index 995a40655d7..d5d5e2353f2 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -1673,8 +1673,8 @@ static int partition_read_definition(Partition *p, const char *path, const char "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(); }