summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-11-16 20:55:34 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-11-16 20:55:34 +0000
commitbb9aa2bfb3eb697ac43d9be3646a4a30b8a7bf44 (patch)
treedde4c5b44cd6b849b4c046195ad1b2f90d82ef36 /perl-install
parentef214ebfe0278d941e8905f984a1baaca528707b (diff)
downloaddrakx-bb9aa2bfb3eb697ac43d9be3646a4a30b8a7bf44.tar
drakx-bb9aa2bfb3eb697ac43d9be3646a4a30b8a7bf44.tar.gz
drakx-bb9aa2bfb3eb697ac43d9be3646a4a30b8a7bf44.tar.bz2
drakx-bb9aa2bfb3eb697ac43d9be3646a4a30b8a7bf44.tar.xz
drakx-bb9aa2bfb3eb697ac43d9be3646a4a30b8a7bf44.zip
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Makefile2
-rw-r--r--perl-install/fs.pm7
-rw-r--r--perl-install/install2.pm27
-rw-r--r--perl-install/install_any.pm40
-rw-r--r--perl-install/install_steps.pm5
-rw-r--r--perl-install/lang.pm2
-rw-r--r--perl-install/partition_table_raw.pm1
-rw-r--r--perl-install/pkgs.pm2
-rw-r--r--perl-install/share/compssList10
9 files changed, 76 insertions, 20 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile
index af5c289a3..f0dc744d9 100644
--- a/perl-install/Makefile
+++ b/perl-install/Makefile
@@ -153,4 +153,4 @@ full_stage2:
stage2:
$(MAKE) install_pms
- ../make_mdkinst_stage2 $(DEST) $(ROOTDEST)/Mandrake/base/mdkinst_stage2
+ $(ROOTDEST)/misc/make_mdkinst_stage2 $(DEST) $(ROOTDEST)/Mandrake/base/mdkinst_stage2
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 1a81a238a..1bf3293a1 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -186,8 +186,9 @@ sub umount_all($;$) {
}
#- do some stuff before calling write_fstab
-sub write($$) {
- my ($prefix, $fstab) = @_;
+sub write($$$) {
+ my ($prefix, $fstab, $manualFstab) = @_;
+ $fstab = [ @{$fstab||[]}, @{$manualFstab||[]} ];
log::l("resetting /etc/mtab");
local *F;
@@ -228,7 +229,7 @@ sub write_fstab($;$$) {
$options ||= $_->{options};
isExt2($_) and ($freq, $passno) = (1, ($_->{mntpoint} eq '/') ? 1 : 2);
- isNfs($_) and ($dir, $options) = ('', 'ro');
+ isNfs($_) and $dir = '', $options ||= 'ro,rsize=8192,wsize=8192';
#- keep in mind the new line for fstab.
@new{($_->{mntpoint}, $_->{"$dir$_->{device}"})} = undef;
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 0a7328e26..ec7d0a666 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -308,6 +308,10 @@ sub partitionDisks {
}
$o->{fstab} = [ fsedit::get_fstab(@{$o->{hds}}, $o->{raid}) ];
fsedit::get_root($o->{fstab}) or die _("Partitioning failed: no root filesystem");
+
+ cat_("/proc/mounts") =~ m|(\S+)\s+/tmp/rhimage nfs| &&
+ !grep { $_->{mntpoint} eq "/mnt/nfs" } @{$o->{manualFstab} || []} and
+ push @{$o->{manualFstab}}, { type => "nfs", mntpoint => "/mnt/nfs", device => $1, options => "noauto,ro,rsize=8192,wsize=8192" };
}
sub formatPartitions {
@@ -345,7 +349,7 @@ sub doInstallStep {
#- some packages need such files for proper installation.
install_any::write_ldsoconf($o->{prefix});
- fs::write($o->{prefix}, $o->{fstab});
+ fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab});
$o->beforeInstallPackages;
$o->installPackages($o->{packages});
@@ -480,15 +484,20 @@ sub main {
newt => sub { $o->{interactive} = "newt" },
text => sub { $o->{interactive} = "newt" },
stdio => sub { $o->{interactive} = "stdio"},
-# ks => sub { $::auto_install = 1; $cfg = $v; },
-# kickstart => sub { $::auto_install = 1; $cfg = $v; },
- auto_install => sub { $::auto_install = 1; $cfg = $v; },
+ ks => sub { $::auto_install = 1 },
+ kickstart => sub { $::auto_install = 1 },
+ auto_install => sub { $::auto_install = 1 },
simple_themes => sub { $o->{simple_themes} = 1 },
alawindows => sub { $o->{security} = 0; $o->{partitioning}{clearall} = 1; $o->{bootloader}{crushMbr} = 1 },
g_auto_install => sub { $::testing = $::g_auto_install = 1; $o->{partitioning}{auto_allocate} = 1 },
}}{lc $n}; &$f if $f;
} %cmdline;
+ if ($::g_auto_install) {
+ (my $root = `/bin/pwd`) =~ s|(/[^/]*){5}$||;
+ symlinkf $root, "/tmp/rhimage" or die "unable to create link /tmp/rhimage";
+ }
+
unlink "/sbin/insmod" unless $::testing;
unlink "/modules/pcmcia_core.o" unless $::testing; #- always use module from archive.
unlink "/modules/i82365.o" unless $::testing;
@@ -518,7 +527,13 @@ sub main {
if ($::auto_install) {
require 'install_steps_auto_install.pm';
- } else {
+ eval { $o = $::o = install_any::loadO($o, "floppy") };
+ if ($@) {
+ log::l("error using auto_install, continuing");
+ $::auto_install = undef;
+ }
+ }
+ unless ($::auto_install) {
$o->{interactive} ||= 'gtk';
require"install_steps_$o->{interactive}.pm";
}
@@ -588,7 +603,7 @@ sub main {
}
substInFile { s|/sbin/mingetty tty1.*|/bin/bash --login| } "$o->{prefix}/etc/inittab" if $o->{security} < 1;
- fs::write($o->{prefix}, $o->{fstab});
+ fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab});
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 e1883aa06..38ee82099 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -375,7 +375,7 @@ sub setupFB {
1;
}
-sub auto_inst_file() { "$::o->{prefix}/root/auto_inst.cfg.pl" }
+sub auto_inst_file() { ($::g_auto_install ? "/tmp" : "$::o->{prefix}/root") . "/auto_inst.cfg.pl" }
sub g_auto_install(;$) {
my ($f) = @_; $f ||= auto_inst_file;
@@ -386,7 +386,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 authentification printer mouse netc timezone superuser intf keyboard mkbootdisk base users installClass partitioning); #- TODO modules bootloader
+ exists $::o->{$_} and $o->{$_} = $::o->{$_} foreach qw(lang autoSCSI authentification printer mouse netc timezone superuser intf keyboard mkbootdisk base users installClass partitioning isUpgrade X manualFstab); #- TODO modules bootloader
#- local $o->{partitioning}{clearall} = 1;
@@ -407,9 +407,12 @@ sub loadO {
$f = "/mnt/$f";
}
-e $f or $f .= ".pl";
+
+ my $b = before_leaving {
+ fs::umount("/mnt") unless $::testing;
+ modules::unload($_) foreach qw(vfat fat);
+ };
$o = loadO($O, $f);
- fs::umount("/mnt") unless $::testing;
- modules::unload($_) foreach qw(vfat fat);
} else {
-e $f or $f .= ".pl";
{
@@ -436,3 +439,32 @@ sub fsck_option() {
my $y = $::o->{security} < 3 && $::beginner ? "-y " : "";
substInFile { s/^(\s*fsckoptions="?)(-y )?/$1$y/ } "$::o->{prefix}/etc/rc.d/rc.sysinit";
}
+
+sub install_urpmi {
+ my ($prefix, $method) = @_;
+
+ (my $name = _("installation_cd")) =~ s/\s/_/g; #- in case translators are too good :-/
+
+ my $f = "$prefix/etc/urpmi/hdlist.$name";
+ {
+ my $fd = getFile("hdlist") or return;
+ local *OUT;
+ open OUT, ">$f" or log::l("failed to write $f"), return;
+ local $/ = \ (16 * 1024);
+ print OUT foreach <$fd>;
+ }
+ {
+ local *LIST;
+ open LIST, ">$prefix/etc/urpmi/list.$name" or log::l("failed to write list.$name"), return;
+
+ my $dir = ${{ nfs => "file://mnt/nfs",
+ ftp => $ENV{URLPREFIX},
+ cdrom => "removable_cdrom_1://mnt/cdrom" }}{$method};
+ local *FILES; open FILES, "hdlist2files $f|";
+ chop, print LIST "$dir/Mandrake/RPMS/$_\n" foreach <FILES>;
+ close FILES or die "hdlist2files failed";
+ }
+ run_program::rooted($prefix, "urpmi.update");
+}
+
+1;
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index afc872b6b..0f58aacc8 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -228,6 +228,9 @@ sub afterInstallPackages($) {
run_program::rooted($o->{prefix}, "kudzu", "-q"); # -q <=> fermetagueuleconnard
$o->pcmciaConfig();
+
+ my $p = $o->{packages}{urpmi};
+ install_any::install_urpmi($o->{prefix}, $o->{method}) if $p && $p->{selected};
}
#------------------------------------------------------------------------------
@@ -412,6 +415,8 @@ sub addUser($) {
}
commands::chown_("-r", "$_->{uid}.$_->{gid}", "$p$_->{home}")
if $_->{uid} != $_->{oldu} || $_->{gid} != $_->{oldg};
+
+ run_program::rooted($p, "usermod", "-G", "urpmi", $_->{name}) if $o->{security} < 3;
}
}
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index aa2bf1e3c..b019cd747 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -97,7 +97,7 @@ my %charsets = (
"jisx0208" => [ "????", "????",
"-*-*-*-*-*-*-*-*-*-*-*-*-jisx*.*-0" ],
"koi8-r" => [ "Cyr_a8x16", "koi2alt", std("koi8-r") ],
- "koi8-u" => [ "ruscii_8x16", "koi2alt", std("koi2-u") ],
+ "koi8-u" => [ "ruscii_8x16", "koi2alt", std("koi8-u") ],
#- korean needs special console driver for text mode
"ksc5601" => [ "?????", "?????",
"-*-*-*-*-*-*-*-*-*-*-*-*-ksc5601.1987-*" ],
diff --git a/perl-install/partition_table_raw.pm b/perl-install/partition_table_raw.pm
index fc9bf1648..74b9b6036 100644
--- a/perl-install/partition_table_raw.pm
+++ b/perl-install/partition_table_raw.pm
@@ -22,6 +22,7 @@ my @MBR_signatures = (
[ 'BootStar', 0x130, "BootStar:" ],
[ 'DocsBoot', 0x148, 'DocsBoot' ],
[ 'system_commander', 0x1ad, "SYSCMNDRSYS" ],
+ [ 'os2', 0x1c2, "\xA" ],
[ 'dos', 0xa0, "\x25\x03\x4E\x02\xCD\x13" ],
[ 'dos', 0x60, "\xBB\x00\x7C\xB8\x01\x02\x57\xCD\x13\x5F\x73\x0C\x33\xC0\xCD\x13" ], #- nt's
[ 'freebsd', 0xC0, "\x00\x30\xE4\xCD\x16\xCD\x19\xBB\x07\x00\xB4" ],
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 55fcb1caf..60ccfcf43 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -18,7 +18,7 @@ XFree86-P9000 XFree86-S3 XFree86-S3V XFree86-SVGA XFree86-W32 XFree86-I128
XFree86-Sun XFree86-SunMono XFree86-Sun24 XFree86-3DLabs kernel-BOOT
MySQL MySQL_GPL mod_php3 midgard postfix metroess metrotmpl
hackkernel hackkernel-BOOT hackkernel-fb hackkernel-headers
-hackkernel-pcmcia-cs hackkernel-smp hackkernel-smp-fb
+hackkernel-pcmcia-cs hackkernel-smp hackkernel-smp-fb autoirpm
);
my @preferred = qw(
diff --git a/perl-install/share/compssList b/perl-install/share/compssList
index eda20824f..ecb55123d 100644
--- a/perl-install/share/compssList
+++ b/perl-install/share/compssList
@@ -132,7 +132,11 @@ gaddr 45 0 40
gated 1 99 0
gatos 55 0 49
gawk 1 0 87
+gcc 35 0 90
+gcc-c++ 35 0 84
gcc-fr 0 0 0
+gcc-g77 32 0 67
+gcc-objc 31 0 75
gd 25 0 71
gdb 25 0 94
gdbm 25 0 72
@@ -213,6 +217,7 @@ gtkglarea 1 0 0
gtkzip 70 0 58
gtop 70 0 58
guavac 1 0 80
+gurpmi 86 0 86
guile 1 0 75
guile-devel 1 0 75
gv 55 0 49
@@ -470,10 +475,6 @@ perl-GTK 1 0 72
perl-MD5 1 99 75
perl-Parse-RecDescent 1 0 75
perl-PDL 1 0 75
-pgcc 35 0 90
-pgcc-c++ 35 0 84
-pgcc-g77 32 0 67
-pgcc-objc 31 0 75
pidentd 25 99 87
pilot-link 30 0 27
pilot-link-devel 28 0 25
@@ -608,6 +609,7 @@ unarj 18 0 16
units 12 0 10
unzip 70 99 91
urlview 53 0 47
+urpmi 95 0 95
urw-fonts 38 0 34
usermode 71 0 58
usernet 42 0 37