From: Daan De Meyer Date: Tue, 13 Dec 2022 18:14:43 +0000 (+0000) Subject: repart: Rename --skip-partitions to --defer-partitions X-Git-Tag: v253-rc1~298 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8275334bec80d1d259e79f3486ec82f1c367d207;p=thirdparty%2Fsystemd.git repart: Rename --skip-partitions to --defer-partitions Defer is better because it indicates that we still intend to populate these partitions later. --- diff --git a/man/systemd-repart.xml b/man/systemd-repart.xml index 2c74afbe0fa..657caad4323 100644 --- a/man/systemd-repart.xml +++ b/man/systemd-repart.xml @@ -377,7 +377,7 @@ - PARTITION + PARTITION This option specifies which partition types systemd-repart should skip. All partitions that are skipped using this option are still taken into account when calculating diff --git a/src/partition/repart.c b/src/partition/repart.c index 1e647e2ec99..b70c54e531f 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -145,8 +145,8 @@ static bool arg_split = false; static sd_id128_t *arg_filter_partitions = NULL; static size_t arg_n_filter_partitions = 0; static FilterPartitionsType arg_filter_partitions_type = FILTER_PARTITIONS_NONE; -static sd_id128_t *arg_skip_partitions = NULL; -static size_t arg_n_skip_partitions = 0; +static sd_id128_t *arg_defer_partitions = NULL; +static size_t arg_n_defer_partitions = 0; STATIC_DESTRUCTOR_REGISTER(arg_root, freep); STATIC_DESTRUCTOR_REGISTER(arg_image, freep); @@ -408,11 +408,11 @@ static bool partition_exclude(const Partition *p) { return arg_filter_partitions_type == FILTER_PARTITIONS_INCLUDE; } -static bool partition_skip(const Partition *p) { +static bool partition_defer(const Partition *p) { assert(p); - for (size_t i = 0; i < arg_n_skip_partitions; i++) - if (sd_id128_equal(p->type.uuid, arg_skip_partitions[i])) + for (size_t i = 0; i < arg_n_defer_partitions; i++) + if (sd_id128_equal(p->type.uuid, arg_defer_partitions[i])) return true; return false; @@ -2998,7 +2998,7 @@ static int context_wipe_and_discard(Context *context) { if (!p->allocated_to_area) continue; - if (partition_skip(p)) + if (partition_defer(p)) continue; r = context_wipe_partition(context, p); @@ -3453,7 +3453,7 @@ static int partition_format_verity_hash( if (p->verity != VERITY_HASH) return 0; - if (partition_skip(p)) + if (partition_defer(p)) return 0; assert_se(dp = p->siblings[VERITY_DATA]); @@ -3585,7 +3585,7 @@ static int partition_format_verity_sig(Context *context, Partition *p) { if (PARTITION_EXISTS(p)) return 0; - if (partition_skip(p)) + if (partition_defer(p)) return 0; assert_se(hp = p->siblings[VERITY_HASH]); @@ -3659,7 +3659,7 @@ static int context_copy_blocks(Context *context) { if (PARTITION_EXISTS(p)) /* Never copy over existing partitions */ continue; - if (partition_skip(p)) + if (partition_defer(p)) continue; assert(p->new_size != UINT64_MAX); @@ -3983,7 +3983,7 @@ static int context_mkfs(Context *context) { if (p->copy_blocks_fd >= 0) continue; - if (partition_skip(p)) + if (partition_defer(p)) continue; assert(p->offset != UINT64_MAX); @@ -4368,7 +4368,7 @@ static int context_mangle_partitions(Context *context) { if (p->dropped) continue; - if (partition_skip(p)) + if (partition_defer(p)) continue; assert(p->new_size != UINT64_MAX); @@ -4617,7 +4617,7 @@ static int context_split(Context *context) { if (!p->split_path) continue; - if (partition_skip(p)) + if (partition_defer(p)) continue; fdt = open(p->split_path, O_WRONLY|O_NOCTTY|O_CLOEXEC|O_NOFOLLOW|O_CREAT|O_EXCL, 0666); @@ -5476,7 +5476,7 @@ static int help(void) { " Ignore partitions not of the specified types\n" " --exclude-partitions=PARTITION1,PARTITION2,PARTITION3,…\n" " Ignore partitions of the specified types\n" - " --skip-partitions=PARTITION1,PARTITION2,PARTITION3,…\n" + " --defer-partitions=PARTITION1,PARTITION2,PARTITION3,…\n" " Take partitions of the specified types into account\n" " but don't populate them yet\n" "\nSee the %s for details.\n", @@ -5516,7 +5516,7 @@ static int parse_argv(int argc, char *argv[]) { ARG_SPLIT, ARG_INCLUDE_PARTITIONS, ARG_EXCLUDE_PARTITIONS, - ARG_SKIP_PARTITIONS, + ARG_DEFER_PARTITIONS, }; static const struct option options[] = { @@ -5546,7 +5546,7 @@ static int parse_argv(int argc, char *argv[]) { { "split", required_argument, NULL, ARG_SPLIT }, { "include-partitions", required_argument, NULL, ARG_INCLUDE_PARTITIONS }, { "exclude-partitions", required_argument, NULL, ARG_EXCLUDE_PARTITIONS }, - { "skip-partitions", required_argument, NULL, ARG_SKIP_PARTITIONS }, + { "defer-partitions", required_argument, NULL, ARG_DEFER_PARTITIONS }, {} }; @@ -5827,8 +5827,8 @@ static int parse_argv(int argc, char *argv[]) { break; - case ARG_SKIP_PARTITIONS: - r = parse_partition_types(optarg, &arg_skip_partitions, &arg_n_skip_partitions); + case ARG_DEFER_PARTITIONS: + r = parse_partition_types(optarg, &arg_defer_partitions, &arg_n_defer_partitions); if (r < 0) return r; diff --git a/test/units/testsuite-58.sh b/test/units/testsuite-58.sh index 6e5af327490..2b0fe7dfb20 100755 --- a/test/units/testsuite-58.sh +++ b/test/units/testsuite-58.sh @@ -161,7 +161,7 @@ $imgs/zzz2 : start= 1777624, size= 131072, type=0657FD6D-A4AB-43C4-84E5 --dry-run=no \ --seed="$seed" \ --empty=force \ - --skip-partitions=home,root \ + --defer-partitions=home,root \ "$imgs/zzz" output=$(sfdisk -d "$imgs/zzz" | grep -v -e 'sector-size' -e '^$')