From 21e28d189899b6870fa2f7b5f08be47846db7f90 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 17 Sep 2003 11:29:16 +0000 Subject: ensure that a number is not written as the type in fstab --- perl-install/fs.pm | 2 +- perl-install/partition_table.pm | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'perl-install') diff --git a/perl-install/fs.pm b/perl-install/fs.pm index f20aaf849..8f7b45809 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -240,7 +240,7 @@ sub prepare_write_fstab { } } - my $type = type2fs($_); + my $type = type2fs($_, 'auto'); my $dev = $_->{device_LABEL} ? $_->{device_LABEL} : diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index ef9e29038..a4120d0bb 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -226,7 +226,11 @@ sub important_types() { difference2(\@l, \@bad_types); } -sub type2fs { $type2fs{$_[0]{type}} || $_[0]{type} } +sub type2fs { + my ($part, $o_default) = @_; + my $type = $part->{type}; + $type2fs{$type} || $type =~ /^(\d+)$/ && $o_default || $type; +} sub fs2type { $fs2type{$_[0]} || $_[0] } sub type2name { $types{$_[0]} || $_[0] } sub name2type { -- cgit v1.2.1