summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/format.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/fs/format.pm')
-rw-r--r--perl-install/fs/format.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/perl-install/fs/format.pm b/perl-install/fs/format.pm
index 5f841163e..039352928 100644
--- a/perl-install/fs/format.pm
+++ b/perl-install/fs/format.pm
@@ -280,9 +280,20 @@ sub part_raw {
delete $part->{device_LABEL_changed};
- # Preserve UUID on fs where we couldn't enforce it while formatting
+ preserve_UUID_after_format($dev, $part, $fs_type);
+ after_formatting($part);
+}
+
+=item preserve_UUID_after_format($dev, $part, $fs_type)
+
+Preserve UUID on fs where we couldn't enforce it while formatting
+
+=cut
+
+sub preserve_UUID_after_format {
+ my ($dev, $part, $fs_type) = @_;
if (my $uuid_cmd = $preserve_UUID{$fs_type}) {
- (undef, $cmd) = @$uuid_cmd;
+ my (undef, $cmd) = @$uuid_cmd;
run_program::raw({}, $cmd, '-U', $part->{device_UUID}, devices::make($dev)) if $cmd;
} elsif ($fs_type eq 'btrfs' && $part->{device_UUID}) {
write_btrfs_uuid($part->{device_UUID}, $dev);
@@ -291,8 +302,6 @@ sub part_raw {
if (member($fs_type, qw(ext3 ext4))) {
disable_forced_fsck($dev);
}
-
- after_formatting($part);
}
sub after_formatting {