From 26b42039a96337599925b947b5f41e80286bbfe9 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 23 Jan 2012 19:05:43 +0000 Subject: (package_needed_for_partition_type) make more generic the ability to preserve UUID on fses where we couldn't enforce it while formatting --- perl-install/fs/format.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'perl-install') diff --git a/perl-install/fs/format.pm b/perl-install/fs/format.pm index 5fd0a76f9..0286653b3 100644 --- a/perl-install/fs/format.pm +++ b/perl-install/fs/format.pm @@ -66,6 +66,13 @@ my %edit_LABEL = ( # package, command, option nilfs2 => [ 'nilfs-utils', 'nilfs-tune', '-L' ], ); +# Preserve UUID on fs where we couldn't enforce it while formatting +my %preserve_UUID = ( # package, commande + #btrfs => [ 'btrfs-progs', 'FIXME' ], + jfs => [ 'jfsutils', 'jfs_tune', ], + xfs => [ 'xfsprogs', 'xfs_admin' ], +); + sub package_needed_for_partition_type { my ($part) = @_; my $l = $cmds{$part->{fs_type}} or return; @@ -188,13 +195,8 @@ sub part_raw { delete $part->{device_LABEL_changed}; # Preserve UUID on fs where we couldn't enforce it while formatting - if ($fs_type eq 'jfs') { - run_program::raw('jfs_tune', '-U', devices::make($dev)); - } elsif ($fs_type eq 'xfs') { - run_program::raw('xfs_admin', '-U', devices::make($dev)); - } elsif ($fs_type eq 'btrfs') { - #FIXME - } + my ($_pkg, $cmd) = @{$preserve_UUID{$fs_type}}; + run_program::raw($cmd, '-U', devices::make($dev)) if $cmd; if (member($fs_type, qw(ext3 ext4))) { disable_forced_fsck($dev); -- cgit v1.2.1