summaryrefslogtreecommitdiffstats
path: root/perl-install/fs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-04 07:49:36 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-04 07:49:36 +0000
commitc1b275cd54b5dd7b0b012acb987bf6894ae65c23 (patch)
tree09a8efbe29caee9a3ee53f4fd410ded66f4aab23 /perl-install/fs.pm
parentec0a5e3bf37e708cc1fa26088baeded4beb77aeb (diff)
downloaddrakx-c1b275cd54b5dd7b0b012acb987bf6894ae65c23.tar
drakx-c1b275cd54b5dd7b0b012acb987bf6894ae65c23.tar.gz
drakx-c1b275cd54b5dd7b0b012acb987bf6894ae65c23.tar.bz2
drakx-c1b275cd54b5dd7b0b012acb987bf6894ae65c23.tar.xz
drakx-c1b275cd54b5dd7b0b012acb987bf6894ae65c23.zip
- diskdrake
o add a comment (a la ubuntu) in fstab when using UUID=
Diffstat (limited to 'perl-install/fs.pm')
-rw-r--r--perl-install/fs.pm6
1 files changed, 5 insertions, 1 deletions
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 {
();
}