From 3e881183d59b7fe80b703dfa269851e3cbf35302 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 7 Dec 1999 13:53:02 +0000 Subject: no_comment --- perl-install/Xconfigurator_consts.pm | 4 ++++ perl-install/fs.pm | 19 +++++++++++-------- perl-install/ftp.pm | 2 +- perl-install/install2.pm | 6 +++--- perl-install/install_any.pm | 15 ++++++++++++--- perl-install/install_steps.pm | 1 + perl-install/install_steps_interactive.pm | 4 ++++ perl-install/run_program.pm | 5 ++++- 8 files changed, 40 insertions(+), 16 deletions(-) (limited to 'perl-install') diff --git a/perl-install/Xconfigurator_consts.pm b/perl-install/Xconfigurator_consts.pm index 25c8483c7..a3875755d 100644 --- a/perl-install/Xconfigurator_consts.pm +++ b/perl-install/Xconfigurator_consts.pm @@ -485,6 +485,10 @@ Section "ServerFlags" # sequences. This allows clients to receive these key events. #DontZoom + # This allows the server to start up even if the + # mouse device can\'t be opened/initialised. + AllowMouseOpenFail + EndSection # ********************************************************************** diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 6ccc8d909..a7180aad9 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -186,8 +186,8 @@ sub umount_all($;$) { } #- do some stuff before calling write_fstab -sub write($$$) { - my ($prefix, $fstab, $manualFstab) = @_; +sub write($$$$) { + my ($prefix, $fstab, $manualFstab, $useSupermount) = @_; $fstab = [ @{$fstab||[]}, @{$manualFstab||[]} ]; log::l("resetting /etc/mtab"); @@ -195,23 +195,26 @@ sub write($$$) { open F, "> $prefix/etc/mtab" or die "error resetting $prefix/etc/mtab"; my @to_add = ( -#- [ split ' ', '/dev/fd0 /mnt/floppy auto sync,user,noauto,nosuid,nodev,unhide 0 0' ], - [ split ' ', '/mnt/floppy /mnt/floppy supermount fs=vfat,dev=/dev/fd0 0 0' ], + $useSupermount ? + [ split ' ', '/mnt/floppy /mnt/floppy supermount fs=vfat,dev=/dev/fd0 0 0' ] : + [ split ' ', '/dev/fd0 /mnt/floppy auto sync,user,noauto,nosuid,nodev,unhide 0 0' ], [ split ' ', 'none /proc proc defaults 0 0' ], [ split ' ', 'none /dev/pts devpts mode=0620 0 0' ], (map_index { my $i = $::i ? $::i + 1 : ''; mkdir "$prefix/mnt/cdrom$i", 0755 or log::l("failed to mkdir $prefix/mnt/cdrom$i: $!"); symlinkf $_->{device}, "$prefix/dev/cdrom$i" or log::l("failed to symlink $prefix/dev/cdrom$i: $!"); -#- [ "/dev/cdrom$i", "/mnt/cdrom$i", "auto", "user,noauto,nosuid,exec,nodev,ro", 0, 0 ]; - [ "/mnt/cdrom$i", "/mnt/cdrom$i", "supermount", "fs=iso9660,dev=/dev/cdrom$i", 0, 0 ]; + $useSupermount ? + [ "/mnt/cdrom$i", "/mnt/cdrom$i", "supermount", "fs=iso9660,dev=/dev/cdrom$i", 0, 0 ] : + [ "/dev/cdrom$i", "/mnt/cdrom$i", "auto", "user,noauto,nosuid,exec,nodev,ro", 0, 0 ]; } detect_devices::cdroms()), (map_index { #- for zip drives, the right partition is the 4th. my $i = $::i ? $::i + 1 : ''; mkdir "$prefix/mnt/zip$i", 0755 or log::l("failed to mkdir $prefix/mnt/zip$i: $!"); symlinkf "$_->{device}4", "$prefix/dev/zip$i" or log::l("failed to symlink $prefix/dev/zip$i: $!"); -#- [ "/dev/zip$i", "/mnt/zip$i", "auto", "user,noauto,nosuid,exec,nodev", 0, 0 ]; - [ "/mnt/zip$i", "/mnt/zip$i", "supermount", "fs=vfat,dev=/dev/zip$i", 0, 0 ]; + $useSupermount ? + [ "/mnt/zip$i", "/mnt/zip$i", "supermount", "fs=vfat,dev=/dev/zip$i", 0, 0 ] : + [ "/dev/zip$i", "/mnt/zip$i", "auto", "user,noauto,nosuid,exec,nodev", 0, 0 ]; } detect_devices::zips())); write_fstab($fstab, $prefix, @to_add); } diff --git a/perl-install/ftp.pm b/perl-install/ftp.pm index bef562dad..c1b93fec4 100644 --- a/perl-install/ftp.pm +++ b/perl-install/ftp.pm @@ -35,7 +35,7 @@ sub new { $options{Port} = $ENV{PROXYPORT} if $ENV{PROXYPORT}; unless ($login) { $login = 'anonymous'; - $password = 'DrakX@vivelinuxabaszindozs'; + $password = '-drakx@'; } my $ftp = Net::FTP->new(network::resolv($host), %options) or die ''; diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 010bc84e6..652cadfd9 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -59,7 +59,7 @@ my (%installSteps, @orderedInstallSteps); addUser => [ __("Add a user"), 1, 1, '', "doInstallStep" ], createBootdisk => [ __("Create a bootdisk"), 1, 0, '', "doInstallStep" ], setupBootloader => [ __("Install bootloader"), 1, 1, '', "doInstallStep" ], - configureX => [ __("Configure X"), 1, 0, '', ["formatPartitions", "setupBootloader"] ], + configureX => [ __("Configure X"), 1, 0, '', ["formatPartitions"] ], exitInstall => [ __("Exit install"), 0, 0, 'beginner' ], ); for (my $i = 0; $i < @installSteps; $i += 2) { @@ -343,7 +343,7 @@ sub doInstallStep { #- some packages need such files for proper installation. install_any::write_ldsoconf($o->{prefix}); - fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab}); + fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab}, $o->{useSupermount}); $o->beforeInstallPackages; $o->installPackages($o->{packages}); @@ -605,7 +605,7 @@ sub main { run_program::rooted($o->{prefix}, "kudzu", "-q"); # -q <=> fermetagueuleconnard - fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab}); + fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab}, $o->{useSupermount}); modules::write_conf("$o->{prefix}/etc/conf.modules", 'append'); install_any::lnx4win_postinstall($o->{prefix}) if $o->{lnx4win}; diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 09a602a7c..f8d07560e 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -340,12 +340,20 @@ sub killCardServices { $pid and kill(15, $pid); #- send SIGTERM } +sub hdInstallPath() { + cat_("/proc/mounts") =~ m|/tmp/(\S+)\s+/tmp/hdimage| or return; + my ($part) = grep { $_->{device} eq $1 } @{$::o->{fstab}}; + $part->{mntpoint} or grep { $_->{mntpoint} eq "/mnt/hd" } @{$::o->{fstab}} and return; + $part->{mntpoint} ||= "/mnt/hd"; + $part->{mntpoint} . first(readlink("/tmp/rhimage") =~ m|^/tmp/hdimage/(.*)|); +} + sub unlockCdrom() { - cat_("/proc/mounts") =~ m|/tmp/(\S+)\s+/tmp/rhimage|; + cat_("/proc/mounts") =~ m|/tmp/(\S+)\s+/tmp/rhimage| or return; eval { ioctl detect_devices::tryOpen($1), c::CDROM_LOCKDOOR(), 0 }; } sub ejectCdrom() { - cat_("/proc/mounts") =~ m|/tmp/(\S+)\s+/tmp/rhimage|; + cat_("/proc/mounts") =~ m|/tmp/(\S+)\s+/tmp/rhimage| or return; my $f = eval { detect_devices::tryOpen($1) } or return; getFile("XXX"); #- close still opened filehandle eval { fs::umount("/tmp/rhimage") }; @@ -401,7 +409,7 @@ sub g_auto_install(;$) { my @fields = qw(mntpoint type size); $o->{partitions} = [ map { my %l; @l{@fields} = @$_{@fields}; \%l } grep { $_->{mntpoint} } @{$::o->{fstab}} ]; - exists $::o->{$_} and $o->{$_} = $::o->{$_} foreach qw(lang autoSCSI authentication printer mouse netc timezone superuser intf keyboard mkbootdisk base users installClass partitioning isUpgrade manualFstab nomouseprobe crypto modem); #- TODO modules bootloader + exists $::o->{$_} and $o->{$_} = $::o->{$_} foreach qw(lang autoSCSI authentication printer mouse netc timezone superuser intf keyboard mkbootdisk base users installClass partitioning isUpgrade manualFstab nomouseprobe crypto modem useSupermount); #- TODO modules bootloader if (my $card = $::o->{X}{card}) { $o->{X}{card}{$_} = $card->{$_} foreach qw(default_depth); @@ -486,6 +494,7 @@ sub install_urpmi { open LIST, ">$prefix/etc/urpmi/list.$name" or log::l("failed to write list.$name"), return; my $dir = ${{ nfs => "file://mnt/nfs", + hd => "file:/" . hdInstallPath, ftp => $ENV{URLPREFIX}, http => $ENV{URLPREFIX}, cdrom => "removable_cdrom_1://mnt/cdrom" }}{$method}; diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index ef9fe5114..f3d5787e7 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -562,6 +562,7 @@ sub miscellaneousNetwork { sub miscellaneous { my ($o) = @_; $ENV{SECURE_LEVEL} = $o->{security}; + add2hash_ $o, { useSupermount => $o->{security} < 4 }; cat_("/proc/cmdline") =~ /mem=(\S+)/; add2hash_($o->{miscellaneous} ||= {}, { numlock => !$o->{pcmcia}, $1 ? (memsize => $1) : () }); diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 57eca154f..a32b3bd76 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -737,11 +737,14 @@ sub miscellaneous { my $s = $o->{security}; $s = $l{$s} || $s; + add2hash_ $o, { useSupermount => $s < 4 }; + !$::beginner || $clicked and $o->ask_from_entries_refH('', _("Miscellaneous questions"), [ _("Use hard drive optimisations?") => { val => \$u->{HDPARM}, type => 'bool', text => _("(may cause data corruption)") }, _("Choose security level") => { val => \$s, list => [ map { $l{$_} } ikeys %l ], not_edit => 1 }, _("Precise RAM size if needed (found %d MB)", availableRam / 1024 + 3) => \$u->{memsize}, #- add three for correction. +_("Removable media automounting") => { val => $o->{useSupermount}, type => 'bool', text => 'supermount' }, $u->{numlock} ? ( _("Enable num lock at startup") => { val => \$u->{numlock}, type => 'bool' }, ) : (), @@ -774,6 +777,7 @@ sub setupXfree { { local $::testing = 0; #- unset testing local $::auto = $::beginner; + local $::noauto = $::expert && !$o->ask_yesorno('', _("Try to find PCI devices?"), 1); Xconfigurator::main($o->{prefix}, $o->{X}, $o, $o->{allowFB}, sub { install_any::pkg_install($o, "XFree86-$_[0]"); diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index 40a853764..e59286ea9 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -18,7 +18,10 @@ sub rooted { $root ? $root .= '/' : ($root = ''); - fork and wait, return $? == 0; + if (my $pid = fork) { + waitpid $pid, 0; + return $? == 0; + } { my ($stdout, $stdoutm, $stderr, $stderrm); ($stdoutm, $stdout, @args) = @args if $args[0] =~ /^>>?$/; -- cgit v1.2.1