diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-02-18 15:51:01 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-03-18 15:45:14 +0100 |
commit | 01c03167421615cbfbe6c6f626fed22ac6e0992c (patch) | |
tree | 4a10c73c94281c2447903b5f453b8c7b36964c27 /perl-install | |
parent | 2e7098e56cb38236c47126e4372d0aa0ceed0dfe (diff) | |
download | drakx-01c03167421615cbfbe6c6f626fed22ac6e0992c.tar drakx-01c03167421615cbfbe6c6f626fed22ac6e0992c.tar.gz drakx-01c03167421615cbfbe6c6f626fed22ac6e0992c.tar.bz2 drakx-01c03167421615cbfbe6c6f626fed22ac6e0992c.tar.xz drakx-01c03167421615cbfbe6c6f626fed22ac6e0992c.zip |
(preserve_UUID_after_format) split it
so that part_raw() is easier to read
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/fs/format.pm | 17 |
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 { |