From 29b91486ff7de14e6f4388ee03bf426a912f76d9 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 2 Aug 2007 14:34:16 +0000 Subject: drop supermount support (it has been dropped from our kernel) --- perl-install/diskdrake/interactive.pm | 13 +------------ perl-install/fs.pm | 21 +++++++-------------- perl-install/fs/mount_options.pm | 17 ++++++----------- perl-install/install/NEWS | 1 + perl-install/install/any.pm | 2 +- perl-install/install/steps.pm | 3 +-- perl-install/standalone/diskdrake | 2 -- perl-install/standalone/drakupdate_fstab | 8 +++----- rescue/guessmounts | 2 +- 9 files changed, 21 insertions(+), 48 deletions(-) diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index 7e08981e0..a98f402b0 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -350,12 +350,6 @@ sub Auto_allocate { sub More { my ($in, $hd) = @_; - my %automounting = ( - 0 => N("No supermount"), - 1 => N("Supermount"), - magicdev => N("Supermount except for CDROM drives"), - ); - my $r; $in->ask_from(N("More"), '', [ @@ -363,11 +357,6 @@ sub More { { val => N("Restore partition table"), clicked_may_quit => sub { ReadFromFile($in, $hd); 1 } }, if_($::isInstall, { val => N("Reload partition table"), clicked_may_quit => sub { $r = 'force_reload'; 1 } }), - if_($::isInstall || 1, - { label => N("Removable media automounting"), val => \$::o->{useSupermount}, - format => sub { $automounting{$_[0]} }, - list => [ 0, 'magicdev', 1 ], advanced => 1 }, - ), ], ) && $r; } @@ -961,7 +950,7 @@ sub Loopback { sub Options { my ($in, $hd, $part, $all_hds) = @_; - my @simple_options = qw(users noauto supermount username= password=); + my @simple_options = qw(users noauto username= password=); my (undef, $user_implies) = fs::mount_options::list(); my ($options, $unknown) = fs::mount_options::unpack($part); diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 15c2f9240..15de5228d 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -50,10 +50,15 @@ sub read_fstab { $options = 'defaults' if $options eq 'rw'; # clean-up for mtab read if ($fs_type eq 'supermount') { - # normalize this bloody supermount - $options = join(",", 'supermount', grep { + log::l("dropping supermount"); + $options = join(",", grep { if (/fs=(.*)/) { $fs_type = $1; + + #- with supermount, the type could be something like ext2:vfat + #- but this can not be done without supermount, so switching to "auto" + $fs_type = 'auto' if $fs_type =~ /:/; + 0; } elsif (/dev=(.*)/) { $dev = $1; @@ -238,18 +243,6 @@ sub prepare_write_fstab { s/ /\\040/g foreach $mntpoint, $device, $options; - # handle bloody supermount special case - if ($options =~ /supermount/) { - my @l = grep { $_ ne 'supermount' } split(',', $options); - my ($l1, $l2) = partition { member($_, 'ro', 'exec') } @l; - $options = join(",", "dev=$device", "fs=$fs_type", @$l1, if_(@$l2, '--', @$l2)); - ($device, $fs_type) = ('none', 'supermount'); - } else { - #- if we were using supermount, the type could be something like ext2:vfat - #- but this can not be done without supermount, so switching to "auto" - $fs_type = 'auto' if $fs_type =~ /:/; - } - my $file_dep = $options =~ /\b(loop|bind)\b/ ? $device : ''; [ $file_dep, $mntpoint, $_->{comment} . join(' ', $device, $mntpoint, $fs_type, $options || 'defaults', $freq, $passno) . "\n" ]; diff --git a/perl-install/fs/mount_options.pm b/perl-install/fs/mount_options.pm index 596c3378d..ce06ef9e2 100644 --- a/perl-install/fs/mount_options.pm +++ b/perl-install/fs/mount_options.pm @@ -43,8 +43,6 @@ sub unpack { $non_defaults->{encrypted} = 1; - $non_defaults->{supermount} = 1 if $part->{fs_type} =~ /:/ || member($part->{fs_type}, 'auto', @auto_fs); - my $defaults = { reverse %$non_defaults }; my %options = map { $_ => '' } keys %$non_defaults; my @unknown; @@ -134,8 +132,6 @@ have suidperl(1) installed.)"), 'sync' => N("All I/O to the file system should be done synchronously."), - 'supermount' => '', - 'users' => N("Allow every user to mount and umount the file system."), 'user' => N("Allow an ordinary user to mount the file system."), @@ -163,7 +159,7 @@ sub rationalize { delete $options->{'codepage='}; } if (member($part->{mntpoint}, fs::type::directories_needed_to_boot())) { - foreach (qw(users user noauto supermount)) { + foreach (qw(users user noauto)) { if ($options->{$_}) { $options->{$_} = 0; $options->{$_} = 0 foreach qw(nodev noexec nosuid); @@ -176,16 +172,15 @@ sub rationalize { sub set_default { my ($part, %opts) = @_; - #- opts are: useSupermount security iocharset codepage ignore_is_removable + #- opts are: security iocharset codepage ignore_is_removable my ($options, $unknown) = &unpack($part); if (!$opts{ignore_is_removable} && $part->{is_removable} && !member($part->{mntpoint}, fs::type::directories_needed_to_boot()) && (!$part->{fs_type} || $part->{fs_type} eq 'auto' || $part->{fs_type} =~ /:/)) { - $options->{supermount} = $opts{useSupermount} && !($opts{useSupermount} eq 'magicdev' && $part->{media_type} eq 'cdrom'); - $part->{fs_type} = !$options->{supermount} ? 'auto' : - $part->{media_type} eq 'cdrom' ? 'udf:iso9660' : 'ext2:vfat'; + $options->{supermount} = 0; #- always disable supermount + $part->{fs_type} = 'auto'; $options->{sync} = 1 if $part->{media_type} ne 'cdrom'; } @@ -240,7 +235,7 @@ sub set_default { } # rationalize: no need for user - if ($options->{autofs} || $options->{supermount}) { + if ($options->{autofs}) { $options->{users} = $options->{user} = 0; } @@ -258,7 +253,7 @@ sub set_default { sub set_all_default { my ($all_hds, %opts) = @_; - #- opts are: useSupermount security iocharset codepage + #- opts are: security iocharset codepage foreach my $part (fs::get::really_all_fstab($all_hds)) { set_default($part, %opts); diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 953feea1f..414819858 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,4 @@ +- drop supermount support - diskdrake: drop "Rescue partition table" feature (was based on rescuept which has been dropped in util-linux, but was quite bad compared to testdisk anyway) diff --git a/perl-install/install/any.pm b/perl-install/install/any.pm index 1ce4dc6d2..956f1adff 100644 --- a/perl-install/install/any.pm +++ b/perl-install/install/any.pm @@ -706,7 +706,7 @@ sub g_auto_install { $_->{mntpoint} && fs::format::known_type($_); } @{$::o->{fstab}} ]; - exists $::o->{$_} and $o->{$_} = $::o->{$_} foreach qw(locale authentication mouse net timezone superuser keyboard users partitioning isUpgrade manualFstab nomouseprobe crypto security security_user libsafe useSupermount autoExitInstall X services postInstall postInstallNonRooted); #- TODO modules bootloader + exists $::o->{$_} and $o->{$_} = $::o->{$_} foreach qw(locale authentication mouse net timezone superuser keyboard users partitioning isUpgrade manualFstab nomouseprobe crypto security security_user libsafe autoExitInstall X services postInstall postInstallNonRooted); #- TODO modules bootloader local $o->{partitioning}{auto_allocate} = !$b_replay; $o->{autoExitInstall} = !$b_replay; diff --git a/perl-install/install/steps.pm b/perl-install/install/steps.pm index 0da947097..beeabde1e 100644 --- a/perl-install/install/steps.pm +++ b/perl-install/install/steps.pm @@ -350,7 +350,7 @@ sub beforeInstallPackages { } if ($o->{isUpgrade} =~ /redhat|conectiva/) { - #- to ensure supermount is removed for cds + #- to ensure supermount is removed (???) fs::mount_options::set_all_default($o->{all_hds}, %$o, lang::fs_options($o->{locale})); } @@ -826,7 +826,6 @@ sub miscellaneous { } sub miscellaneousAfter { my ($o) = @_; - add2hash_ $o, { useSupermount => $o->{security} < 4 ? 'magicdev' : 0 }; $ENV{SECURE_LEVEL} = $o->{security}; #- deprecated with chkconfig 1.3.4-2mdk, uses /etc/sysconfig/msec diff --git a/perl-install/standalone/diskdrake b/perl-install/standalone/diskdrake index a1c09ccd0..97564e3e0 100755 --- a/perl-install/standalone/diskdrake +++ b/perl-install/standalone/diskdrake @@ -102,11 +102,9 @@ if ($type eq 'list-hd') { $raw_hd->{mntpoint} ||= find { !fs::get::has_mntpoint($_, $all_hds) } map { "/media/$mntpoint$_" } '', 2 .. 10; $raw_hd->{is_removable} = 1; #- force removable flag - my $useSupermount = 'magicdev'; require security::level; require lang; fs::mount_options::set_default($raw_hd, - 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 4d48ef1f1..cbc182c5c 100755 --- a/perl-install/standalone/drakupdate_fstab +++ b/perl-install/standalone/drakupdate_fstab @@ -93,11 +93,10 @@ sub device_name_to_entry { } sub set_options { - my ($part, $useSupermount, $o_sync) = @_; + my ($part, $o_sync) = @_; $part->{is_removable} = 1; #- force removable flag fs::mount_options::set_default($part, - useSupermount => $useSupermount, security => security::level::get(), lang::fs_options(lang::read())); @@ -151,8 +150,7 @@ sub main { return; } my %dynamic = getVarsFromSh('/etc/sysconfig/dynamic'); - my $useSupermount = $dynamic{SUPERMOUNT} eq 'yes' ? 'magicdev' : ''; - set_options($part, $useSupermount, to_bool($dynamic{SYNC} ne 'no')); + set_options($part, to_bool($dynamic{SYNC} ne 'no')); set_mount_point($part, $fstab) or return; my ($line) = fs::prepare_write_fstab([$part]); @@ -162,7 +160,7 @@ sub main { } if ($::auto) { - print $part->{mntpoint}, " ", $useSupermount ? 'supermount' : 'user', "\n"; + print $part->{mntpoint}, " user\n"; } } else { if (!@$existing_fstab_entries) { diff --git a/rescue/guessmounts b/rescue/guessmounts index 4699e3f79..312c3f303 100755 --- a/rescue/guessmounts +++ b/rescue/guessmounts @@ -75,7 +75,7 @@ if ($root) { next if !$_->{fs_type} || $_->{device} eq 'none' - || $valued_options->{noauto} || $valued_options->{supermount} + || $valued_options->{noauto} || $_->{mntpoint} eq '/' || member($_->{fs_type}, 'swap', 'nfs', 'ntfs'); -- cgit v1.2.1