From c097f8d3f8db70685b3c7df6d6035ad47d50d9a0 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 10 Feb 2009 10:40:10 +0000 Subject: fix preserving UUID when formatting ext* and swap, and handle more FS (#39913) --- perl-install/fs/format.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'perl-install/fs/format.pm') diff --git a/perl-install/fs/format.pm b/perl-install/fs/format.pm index 4a2b31405..6a7a0856b 100644 --- a/perl-install/fs/format.pm +++ b/perl-install/fs/format.pm @@ -151,8 +151,13 @@ sub part_raw { push @options, '-l', "Untitled"; } elsif (isAppleBootstrap($part)) { push @options, '-l', 'bootstrap'; - } elsif (member($fs_type, 'swap', 'ext2', 'ext3', 'ext4')) { + } + + # Preserve UUID + if (member($fs_type, 'swap', 'ext2', 'ext3', 'ext4')) { push @options, '-U', $part->{device_UUID} if $part->{device_UUID}; + } elsif ($fs_type eq 'reiserfs') { + push @options, '-u', $part->{device_UUID} if $part->{device_UUID}; } if ($part->{device_LABEL}) { @@ -169,6 +174,13 @@ sub part_raw { run_program::raw({ timeout => 'never' }, @args) or die N("%s formatting of %s failed", $fs_type, $dev); } + # 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)); + } + if (member($fs_type, qw(ext3 ext4))) { disable_forced_fsck($dev); } -- cgit v1.2.1