diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-09-04 07:49:36 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-09-04 07:49:36 +0000 |
commit | c1b275cd54b5dd7b0b012acb987bf6894ae65c23 (patch) | |
tree | 09a8efbe29caee9a3ee53f4fd410ded66f4aab23 /perl-install | |
parent | ec0a5e3bf37e708cc1fa26088baeded4beb77aeb (diff) | |
download | drakx-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')
-rw-r--r-- | perl-install/NEWS | 3 | ||||
-rw-r--r-- | perl-install/fs.pm | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index 6abca9af7..3a32078e2 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,6 @@ +- diskdrake + o add a comment (a la ubuntu) in fstab when using UUID= + Version 10.4.184 - 3 September 2007, by Thierry Vignaud - diskdrake 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 { (); } |