From c1b275cd54b5dd7b0b012acb987bf6894ae65c23 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 4 Sep 2007 07:49:36 +0000 Subject: - diskdrake o add a comment (a la ubuntu) in fstab when using UUID= --- perl-install/fs.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'perl-install/fs.pm') diff --git a/perl-install/fs.pm b/perl-install/fs.pm index bdb364896..23c7547e9 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -217,6 +217,10 @@ sub prepare_write_fstab { ($_->{mntpoint} eq '/' ? "/initrd/loopfs" : $_->{loopback_device}{mntpoint}) . $_->{loopback_file} : fs::wild_device::from_part($o_prefix, $_); + my $comment = $_->{comment}; + $comment = '' if $comment =~ m!^Entry for /dev/.* :!; + $comment ||= "# Entry for /dev/$_->{device} :\n" if $device =~ /^(UUID|LABEL)=/; + my $real_mntpoint = $_->{mntpoint} || ${{ '/tmp/hdimage' => '/mnt/hd' }}{$_->{real_mntpoint}}; mkdir_p("$o_prefix$real_mntpoint") if $real_mntpoint =~ m|^/|; my $mntpoint = fs::type::carry_root_loopback($_) ? '/initrd/loopfs' : $real_mntpoint; @@ -249,7 +253,7 @@ sub prepare_write_fstab { my $file_dep = $options =~ /\b(loop|bind)\b/ ? $device : ''; - [ $file_dep, $mntpoint, $_->{comment} . join(' ', $device, $mntpoint, $fs_type, $options || 'defaults', $freq, $passno) . "\n" ]; + [ $file_dep, $mntpoint, $comment . join(' ', $device, $mntpoint, $fs_type, $options || 'defaults', $freq, $passno) . "\n" ]; } else { (); } -- cgit v1.2.1