From 063fbe1dae400a8fb84d1e2c6f26db52972908be Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 23 Mar 2004 11:01:18 +0000 Subject: - do not pass options is_removable to set_default_options() since it is not a global options - replace it with a flag in the part or raw_hd - set is_removable for part from usb drive - ensure usb partitions are not checked at boot time (freq field in fstab) --- perl-install/fs.pm | 15 ++++++++------- perl-install/standalone/diskdrake | 2 +- perl-install/standalone/drakupdate_fstab | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 11679bf1e..33ea9ab23 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -223,7 +223,7 @@ sub prepare_write_fstab { my ($freq, $passno) = exists $_->{freq} ? ($_->{freq}, $_->{passno}) : - isTrueFS($_) && $_->{options} !~ /encryption=/ ? + isTrueFS($_) && $_->{options} !~ /encryption=/ && !$_->{is_removable} ? (1, $_->{mntpoint} eq '/' ? 1 : loopback::carryRootLoopback($_) ? 0 : 2) : (0, 0); @@ -444,11 +444,11 @@ user,exec,dev,suid )."), sub set_default_options { my ($part, %opts) = @_; - #- opts are: is_removable useSupermount security iocharset codepage + #- opts are: useSupermount security iocharset codepage my ($options, $unknown) = mount_options_unpack($part); - if ($opts{is_removable}) { + if ($part->{is_removable}) { $options->{supermount} = $opts{useSupermount} && !($opts{useSupermount} eq 'magicdev' && $part->{media_type} eq 'cdrom'); $part->{type} = !$options->{supermount} ? 'auto' : $part->{media_type} eq 'cdrom' ? 'udf:iso9660' : 'ext2:vfat'; @@ -482,7 +482,7 @@ sub set_default_options { put_in_hash($options, { user => 1, noexec => 0, - }) if $opts{is_removable}; + }) if $part->{is_removable}; put_in_hash($options, { 'umask=0' => $opts{security} < 3, 'umask=0022' => $opts{security} < 4, @@ -526,10 +526,8 @@ sub set_all_default_options { my ($all_hds, %opts) = @_; #- opts are: useSupermount security iocharset codepage - my @removables = @{$all_hds->{raw_hds}}; - foreach my $part (fsedit::get_really_all_fstab($all_hds)) { - set_default_options($part, %opts, is_removable => member($part, @removables)); + set_default_options($part, %opts); } } @@ -550,6 +548,9 @@ sub get_raw_hds { my ($prefix, $all_hds) = @_; push @{$all_hds->{raw_hds}}, detect_devices::removables(); + $_->{is_removable} = 1 foreach @{$all_hds->{raw_hds}}; + $_->{is_removable} = 1 foreach map { partition_table::get_normal_parts($_) } grep { $_->{usb_media_type} } @{$all_hds->{hds}}; + get_major_minor(@{$all_hds->{raw_hds}}); my @fstab = read_fstab($prefix, "/etc/fstab", 'keep_freq_passno'); diff --git a/perl-install/standalone/diskdrake b/perl-install/standalone/diskdrake index c7ad56590..38bb4e577 100755 --- a/perl-install/standalone/diskdrake +++ b/perl-install/standalone/diskdrake @@ -101,12 +101,12 @@ if ($type eq 'list-hd') { if (!$raw_hd->{mntpoint}) { my $mntpoint = detect_devices::suggest_mount_point($raw_hd); $raw_hd->{mntpoint} ||= find { !fsedit::has_mntpoint($_, $all_hds) } map { "/mnt/$mntpoint$_" } '', 2 .. 10; + $raw_hd->{is_removable} = 1; #- force removable flag my $useSupermount = 'magicdev'; require security::level; require lang; fs::set_default_options($raw_hd, - is_removable => 1, useSupermount => $useSupermount, security => security::level::get(), lang::fs_options(lang::read())); diff --git a/perl-install/standalone/drakupdate_fstab b/perl-install/standalone/drakupdate_fstab index c015eafb8..17ace8761 100755 --- a/perl-install/standalone/drakupdate_fstab +++ b/perl-install/standalone/drakupdate_fstab @@ -85,8 +85,8 @@ sub device_name_to_entry { sub set_options { my ($part, $useSupermount) = @_; + $part->{is_removable} = 1; #- force removable flag fs::set_default_options($part, - is_removable => 1, useSupermount => $useSupermount, security => security::level::get(), lang::fs_options(lang::read())); -- cgit v1.2.1