From e82688c8b8f639705356d25c180ffe754c2b2c34 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 1 Jul 1999 18:50:20 +0000 Subject: *** empty log message *** --- perl-install/fs.pm | 20 +++++++++++--------- perl-install/install2.pm | 22 +++++++++++----------- perl-install/install_steps.pm | 8 ++++---- perl-install/modules.pm | 2 +- perl-install/pkgs.pm | 3 +-- 5 files changed, 28 insertions(+), 27 deletions(-) diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 225f5341b..50cdec0fc 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -79,6 +79,8 @@ sub format_part($;$) { $part->{isFormatted} and return; + log::l("formatting device $part->{device} (type ", type2name($_->{type}), ")"); + if (isExt2($part)) { format_ext2($part->{device}, $bad_blocks); } elsif (isDos($part)) { @@ -102,16 +104,16 @@ sub mount($$$;$) { nfs::mount($dev, $where) or die "nfs mount failed"; } elsif ($fs eq 'smb') { die "no smb yet..."; - } - $dev = devices::make($dev); - - my $flag = 0;#c::MS_MGC_VAL(); - $flag |= c::MS_RDONLY() if $rdonly; - my $mount_opt = $fs eq 'vfat' ? "check=relaxed" : ""; - - log::l("calling mount($dev, $where, $fs, $flag, $mount_opt)"); - syscall_('mount', $dev, $where, $fs, $flag, $mount_opt) or die "mount failed: $!"; + } else { + $dev = devices::make($dev) if $fs ne 'proc'; + my $flag = 0;#c::MS_MGC_VAL(); + $flag |= c::MS_RDONLY() if $rdonly; + my $mount_opt = $fs eq 'vfat' ? "check=relaxed" : ""; + + log::l("calling mount($dev, $where, $fs, $flag, $mount_opt)"); + syscall_('mount', $dev, $where, $fs, $flag, $mount_opt) or die "mount failed: $!"; + } local *F; open F, ">>/etc/mtab" or return; # fail silently, must be read-only /etc print F "$dev $where $fs defaults 0 0\n"; diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 6b5d722e1..295d65a28 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -20,7 +20,7 @@ use modules; use partition_table qw(:types); use detect_devices; -$testing = 1;#$ENV{PERL_INSTALL_TEST}; +$testing = $ENV{PERL_INSTALL_TEST}; $INSTALL_VERSION = 0; my @installStepsFields = qw(text skipOnCancel skipOnLocal prev next); @@ -93,12 +93,12 @@ my $default = { mkbootdisk => 0, comps => [ qw() ], packages => [ qw() ], - partitionning => { clearall => 1, eraseBadPartitions => 1 }, + partitionning => { clearall => 1, eraseBadPartitions => 1, autoformat => 1 }, partitions => [ { mntpoint => "/boot", size => 16 << 11, type => 0x83 }, { mntpoint => "/", size => 300 << 11, type => 0x83 }, - { mntpoint => "/usr", size => 400 << 11, type => 0x83, growable => 1 }, - { mntpoint => "swap", size => 64 << 11, type => 0x82 } + { mntpoint => "swap", size => 64 << 11, type => 0x82 }, +# { mntpoint => "/usr", size => 400 << 11, type => 0x83, growable => 1 }, ], }; $o = { default => $default }; @@ -147,14 +147,14 @@ sub partitionDisks { $root_fs or die "partitionning failed: no root filesystem"; $testing and return; - if ($o->{hints}->{flags}->{autoformat}) { + if ($o->{default}->{partitionning}->{autoformat}) { log::l("formatting all filesystems"); foreach (@{$o->{fstab}}) { fs::format_part($_) if $_->{mntpoint} && isExt2($_) || isSwap($_); } } - fs::mount_all($o->{fstab}, '/mnt'); + fs::mount_all($o->{fstab}, $o->{prefix}); } sub findInstallFiles { @@ -181,13 +181,13 @@ sub addUser { $o->addUser } sub createBootdisk { $testing and return; - $o->{isUpgrade} or fs::write('mnt', $o->{fstab}); - modules::write_conf("/mnt/etc/conf.modules", 'append'); + $o->{isUpgrade} or fs::write($o->{prefix}, $o->{fstab}); + modules::write_conf("$o->{prefix}/etc/conf.modules", 'append'); $o->createBootdisk; } sub setupBootloader { - $o->{isUpgrade} or modules::read_conf("/mnt/etc/conf.modules"); + $o->{isUpgrade} or modules::read_conf("$o->{prefix}/etc/conf.modules"); $o->setupBootloader; } @@ -209,7 +209,7 @@ sub main { spawnSync(); eval { spawnShell() }; - $o->{rootPath} = "/mnt"; + $o->{prefix} = "/mnt"; $o->{method} = install_methods->new('cdrom'); $o = install_steps->new($o); @@ -229,7 +229,7 @@ sub main { modules::read_conf("/tmp/conf.modules"); # make sure we don't pick up any gunk from the outside world - $ENV{PATH} = "/usr/bin:/bin:/sbin:/usr/sbin"; + $ENV{PATH} = "/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sbin:/mnt/bin:/mnt/usr/sbin:/mnt/usr/bin"; $ENV{LD_LIBRARY_PATH} = ""; $o->{keyboard} = eval { keyboard::read("/tmp/keyboard") } || $default->{keyboard}; diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 2cee5dbe2..897edd139 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -49,7 +49,7 @@ sub doPartitionDisks($$) { sub choosePackages($$$) { my ($o, $packages, $comps) = @_; - foreach ('base', @{$o->{default}->{comps}}) { + foreach ('Base', @{$o->{default}->{comps}}) { $comps->{$_}->{selected} = 1; foreach (@{$comps->{$_}->{packages}}) { $_->{selected} = 1; } } @@ -74,8 +74,8 @@ sub beforeInstallPackages($) { sub installPackages($$) { my ($o, $packages) = @_; - my $toInstall = [ $packages->{basesystem}, - grep { $_->{selected} && $_->{name} ne "basesystem" } values %$packages ]; + my $toInstall = [ grep { $_->{selected} } values %$packages ]; + pkgs::init_db($o->{prefix}, $o->{isUpgrade}); pkgs::install($o->{prefix}, $o->{method}, $toInstall, $o->{isUpgrade}, 0); } @@ -153,7 +153,7 @@ sub addUser($) { } sub createBootdisk($) { - lilo::mkbootdisk("/mnt", versionString()) if $o->{mkbootdisk} || $o->{default}->{mkbootdisk}; + lilo::mkbootdisk($o->{prefix}, versionString()) if $o->{mkbootdisk} || $o->{default}->{mkbootdisk}; } sub setupBootloader($) { diff --git a/perl-install/modules.pm b/perl-install/modules.pm index c4fd81798..9d722f0b3 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -217,7 +217,7 @@ sub load_raw($$$@) { # @options or @options = guiGetModuleOptions($name); - run_program::run("/usr/bin/insmod", "/modules/$name.o", @options) or die("insmod $name failed"); + run_program::run("insmod", "/modules/$name.o", @options) or die("insmod $name failed"); # this is a hack to make plip go if ($name eq "parport_pc") { diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 79a7ae6ca..6031735e1 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -169,8 +169,7 @@ sub install { foreach my $p (@$toInstall) { my $fullname = sprintf "%s-%s-%s.%s.rpm", - $p->{name}, - map { c::headerGetEntry($p->{header}, $_) } qw(version release arch); + map { c::headerGetEntry($p->{header}, $_) } qw(name version release arch); c::rpmtransAddPackage($trans, $p->{header}, $method->getFile($fullname) , $isUpgrade); $nb++; $total += $p->{size}; -- cgit v1.2.1