From f438f4f5caf143c0c6f263e09c9702b6876b91cf Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 28 Oct 1999 09:41:32 +0000 Subject: no_comment --- perl-install/Makefile | 17 ++-- perl-install/Xconfigurator.pm | 15 +-- perl-install/devices.pm | 30 +++--- perl-install/fs.pm | 22 ++--- perl-install/help.pm | 17 +++- perl-install/install2.pm | 51 +++++----- perl-install/install_any.pm | 65 ++++++++----- perl-install/install_steps.pm | 47 ++++++--- perl-install/install_steps_interactive.pm | 97 +++++++++++++++---- perl-install/interactive_gtk.pm | 8 +- perl-install/modules.pm | 1 + perl-install/partition_table.pm | 153 ++++++++++++++++++++++-------- perl-install/pkgs.pm | 89 +++++++++++------ perl-install/share/compssList | 44 ++++----- perl-install/share/list | 1 + 15 files changed, 437 insertions(+), 220 deletions(-) (limited to 'perl-install') diff --git a/perl-install/Makefile b/perl-install/Makefile index 23eb0253c..700214207 100644 --- a/perl-install/Makefile +++ b/perl-install/Makefile @@ -1,5 +1,6 @@ VERSION = 2.2.10-BOOT SUDO = sudo +MKE2FS = /sbin/mke2fs -q -m 0 -F SO_FILES = c/blib/arch/auto/c/c.so PMS = *.pm c/stuff.pm resize_fat/*.pm pci_probing/*.pm commands install2 diskdrake XFdrake g_auto_install REP4PMS = /usr/bin/perl-install @@ -33,7 +34,7 @@ tar: clean cd .. ; tar cfy perl-install.tar.bz2 $(EXCLUDE:%=--exclude %) perl-install floppy: - dd if=/dev/zero of=/tmp/initrd bs=1k count=2000 ; echo y | mke2fs /tmp/initrd ; mount /tmp/initrd /mnt/disk/ -o loop ; cp -a ../install1/* /mnt/disk/ ; umount /mnt/disk ; gzip -c /tmp/initrd > /tmp/initrd.img ; mcopy -o /tmp/initrd.img a: + dd if=/dev/zero of=/tmp/initrd bs=1k count=2000 ; $(MKE2FS) /tmp/initrd ; mount /tmp/initrd /mnt/disk/ -o loop ; cp -a ../install1/* /mnt/disk/ ; umount /mnt/disk ; gzip -c /tmp/initrd > /tmp/initrd.img ; mcopy -o /tmp/initrd.img a: tar-diskdrake: clean pci_probing cd .. ; rm -rf diskdrake ; cp -af perl-install diskdrake @@ -62,8 +63,8 @@ verify_c: gendepslist: %: %.cc $(CXX) -I/usr/include/rpm $(CFLAGS) $< -lrpm -ldb1 -lz -o $@ -$(BASE)/depslist: gendepslist $(RPMS) - ./gendepslist $(BASE)/depslist $(ROOTDEST)/Mandrake/RPMS/*.rpm +$(BASE)/depslist: $(BASE)/hdlist gendepslist + ./gendepslist -h $@ $< $(BASE)/hdlist: $(RPMS) $(ROOTDEST)/misc/genhdlist $(ROOTDEST) @@ -138,7 +139,7 @@ get_needed_files: $(DIRS) cp -a consolefonts $(DEST)/usr/share cp modparm.lst MonitorsDB $(DEST)/usr/share cp logo-mandrake.xpm $(DEST)/usr/share - cp compss compssList $(ROOTDEST)/Mandrake/base + cp compss compssUsers compssList $(ROOTDEST)/Mandrake/base cp -f ../modules/modules.cpio.bz2 $(DEST)/lib/ install -d $(DEST)/lib/modules @@ -152,7 +153,7 @@ get_needed_files: $(DIRS) as_root: /bin/dd if=/dev/zero of=/tmp/initrd bs=1k count=4000 - echo y | /sbin/mke2fs /tmp/initrd + $(MKE2FS) /tmp/initrd losetup /dev/loop0 /tmp/initrd mount /dev/loop0 /mnt/initrd chmod a+w /mnt/initrd @@ -171,8 +172,8 @@ stage2: $(SUDO) cp -a $(DEST)/* $(STAGE2TMP) $(SUDO) umount /mnt/stage2 ; true - dd if=/dev/zero of=$(STAGE2) bs=1M count=15 - echo y | /sbin/mke2fs $(STAGE2) + dd if=/dev/zero of=$(STAGE2) bs=1M count=16 + $(MKE2FS) $(STAGE2) $(SUDO) mount -t ext2 $(STAGE2) /mnt/stage2 -o loop # hack to reduce the STAGE2 image @@ -186,8 +187,6 @@ stage2: $(SUDO) umount $(STAGE2) gzip -f -9 $(STAGE2) -# cd $(ROOTDEST) ; tar cfz /tmp/instimage-full.tgz Mandrake -# cd $(ROOTDEST) ; tar cfz /tmp/instimage-light.tgz Mandrake/base/compss Mandrake/mdkinst/usr/[bl]* @#rm -rf /mnt/initrd/* @#cp -a $(DEST)/* /mnt/initrd diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index c7d6a7eaf..fd250fea0 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -111,17 +111,12 @@ sub readMonitorsDB { sub rewriteInittab { my ($runlevel) = @_; - { - local (*F, *G); - open F, "$prefix/etc/inittab" or die "cannot open $prefix/etc/inittab: $!"; - open G, "> $prefix/etc/inittab-" or die "cannot write in $prefix/etc/inittab-: $!"; - - foreach () { - print G /^(id:)[35](:initdefault:)\s*$/ ? "$1$runlevel$2\n" : $_; # ** - } + local @ARGV = grep { -r $_ } "$prefix/etc/inittab" or log::l("missing inittab!!!"), return; + local $^I = ''; + while (<>) { + s/^(id:)[35](:initdefault:)\s*$/$1$runlevel$2\n/; + print; } - unlink("$prefix/etc/inittab"); - rename("$prefix/etc/inittab-", "$prefix/etc/inittab"); } sub keepOnlyLegalModes { diff --git a/perl-install/devices.pm b/perl-install/devices.pm index 53351d3ee..01b200632 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -38,13 +38,12 @@ sub size($) { sub make($) { local $_ = my $file = $_[0]; my ($type, $major, $minor); - my $prefix = ''; if (m,^(.*/(?:dev|tmp))/(.*),) { $_ = $2; } else { - $file = "$prefix/dev/$_"; - -e $file or $file = "$prefix/tmp/$_"; + $file = "/tmp/$_"; + -e $file or $file = "/dev/$_"; } -e $file and return $file; #- assume nobody takes fun at creating files named as device @@ -75,28 +74,29 @@ sub make($) { $type = c::S_IFBLK(); $major = 72 + $1; $minor = 16 * $2 + ($4 || 0); - } else { + } elsif (/(.*)(\d+)$/) { + ($type, $major, $minor) = + @{ ${{"fd" => [ c::S_IFBLK(), 2, 0 ], + "lp" => [ c::S_IFCHR(), 6, 0 ], + "scd" => [ c::S_IFBLK(), 11, 0 ], + "nst" => [ c::S_IFCHR(), 9, 128 ], + }}{$1}}; + $minor += $2; + } + unless ($type) { ($type, $major, $minor) = - @{ $ {{"aztcd" => [ c::S_IFBLK(), 29, 0 ], + @{ ${{"aztcd" => [ c::S_IFBLK(), 29, 0 ], "bpcd" => [ c::S_IFBLK(), 41, 0 ], "cdu31a" => [ c::S_IFBLK(), 15, 0 ], "cdu535" => [ c::S_IFBLK(), 24, 0 ], "cm206cd" => [ c::S_IFBLK(), 32, 0 ], - "tty" => [ c::S_IFCHR(), 5, 0 ], - "fd0" => [ c::S_IFBLK(), 2, 0 ], - "fd1" => [ c::S_IFBLK(), 2, 1 ], + "tty" => [ c::S_IFCHR(), 5, 0 ], "gscd" => [ c::S_IFBLK(), 16, 0 ], - "lp0" => [ c::S_IFCHR(), 6, 0 ], - "lp1" => [ c::S_IFCHR(), 6, 1 ], - "lp2" => [ c::S_IFCHR(), 6, 2 ], "mcd" => [ c::S_IFBLK(), 23, 0 ], "mcdx" => [ c::S_IFBLK(), 20, 0 ], - "nst0" => [ c::S_IFCHR(), 9, 128 ], - "random" => [ c::S_IFCHR(), 1, 8 ], + "random" => [ c::S_IFCHR(), 1, 8 ], "optcd" => [ c::S_IFBLK(), 17, 0 ], "sbpcd" => [ c::S_IFBLK(), 25, 0 ], - "scd0" => [ c::S_IFBLK(), 11, 0 ], - "scd1" => [ c::S_IFBLK(), 11, 1 ], "sjcd" => [ c::S_IFBLK(), 18, 0 ], }}{$_} or die "unknown device $_" }; } diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 5625e0f80..691c10ce6 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -58,36 +58,35 @@ sub get_mntpoints_from_fstab($) { } sub format_ext2($;$) { - my ($dev, $bad_blocks) = @_; - my @options; + my ($dev, @options) = @_; $dev =~ m,(rd|ida)/, and push @options, qw(-b 4096 -R stride=16); #- For RAID only. - $bad_blocks and push @options, "-c"; run_program::run("mke2fs", devices::make($dev), @options) or die _("%s formatting of %s failed", "ext2", $dev); } sub format_dos($;$@) { - my ($dev, $bad_blocks, @options) = @_; + my ($dev, @options) = @_; - run_program::run("mkdosfs", devices::make($dev), @options, $bad_blocks ? "-c" : ()) or die _("%s formatting of %s failed", "dos", $dev); + run_program::run("mkdosfs", devices::make($dev), @options) or die _("%s formatting of %s failed", "dos", $dev); } -sub format_part($;$) { - my ($part, $bad_blocks) = @_; +sub format_part($;$@) { + my ($part, @options) = @_; $part->{isFormatted} and return; log::l("formatting device $part->{device} (type ", type2name($part->{type}), ")"); if (isExt2($part)) { - format_ext2($part->{device}, $bad_blocks); + format_ext2($part->{device}, @options); } elsif (isDos($part)) { - format_dos($part->{device}, $bad_blocks); + format_dos($part->{device}, @options); } elsif (isWin($part)) { - format_dos($part->{device}, $bad_blocks, '-F', 32); + format_dos($part->{device}, @options, '-F', 32); } elsif (isSwap($part)) { - swap::make($part->{device}, $bad_blocks); + my $check_blocks = grep { /^-c$/ } @options; + swap::make($part->{device}, $check_blocks); } else { die _("don't know how to format %s in type %s", $_->{device}, type2name($_->{type})); } @@ -233,6 +232,7 @@ sub write_fstab($;$$) { @new{($_->{mntpoint}, $_->{"$dir$_->{device}"})} = undef; eval { devices::make("$prefix/$dir$_->{device}") } if $_->{device} && $dir; + mkdir "$prefix/$_->{mntpoint}", 0755 if $_->{mntpoint}; [ "$dir$_->{device}", $_->{mntpoint}, type2fs($_->{type}), $options, $freq, $passno ]; diff --git a/perl-install/help.pm b/perl-install/help.pm index 1d9ce7df6..628fa3b12 100644 --- a/perl-install/help.pm +++ b/perl-install/help.pm @@ -4,7 +4,22 @@ use common qw(:common); %steps = ( selectLanguage => - __("Choose preferred language for install and system usage."), + __(" +

Pixel's links

+ +

Search

+ Quelques sites de recherche : + MetaCrawler, + dejanews, + yahoo(fr), + yahoo, + infoseek, + altavista, + excite + + + +Choose preferred language for install and system usage."), selectKeyboard => __("Choose the layout corresponding to your keyboard from the list above"), diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 026994dae..894f80df2 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -42,10 +42,11 @@ my @installSteps = ( selectPath => [ __("Choose install or upgrade"), 0, 0, "selectInstallClass" ], selectMouse => [ __("Configure mouse"), 1, 1 ], selectKeyboard => [ __("Choose your keyboard"), 1, 1 ], - partitionDisks => [ __("Setup filesystems"), 1, 0 ], + partitionDisks => [ __("Setup filesystems"), 1, 0, "selectPath" ], formatPartitions => [ __("Format partitions"), 1, -1, "partitionDisks" ], choosePackages => [ __("Choose packages to install"), 1, 1, "selectInstallClass" ], doInstallStep => [ __("Install system"), 1, -1, ["formatPartitions", "selectPath"] ], + miscellaneous => [ __("Miscellaneous"), 1, 1 ], configureNetwork => [ __("Configure networking"), 1, 1, "formatPartitions" ], configureTimezone => [ __("Configure timezone"), 1, 1, "doInstallStep" ], #- configureServices => [ __("Configure services"), 0, 0 ], @@ -86,9 +87,8 @@ my @install_classes = (__("beginner"), __("developer"), __("server"), __("expert #- partition layout my %suggestedPartitions = ( beginner => [ - { mntpoint => "/boot", size => 16 << 11, type => 0x83 }, - { mntpoint => "swap", size => 128 << 11, type => 0x82 }, { mntpoint => "/", size => 700 << 11, type => 0x83 }, + { mntpoint => "swap", size => 128 << 11, type => 0x82 }, { mntpoint => "/home", size => 300 << 11, type => 0x83 }, ], developer => [ @@ -123,6 +123,7 @@ $o = $::o = { mkbootdisk => 1, #- no mkbootdisk if 0 or undef, find a floppy with 1, or fd1 #- packages => [ qw() ], partitioning => { clearall => 0, eraseBadPartitions => 0, auto_allocate => 0, autoformat => 0, readonly => 0 }, + security => 3, #- partitions => [ #- { mntpoint => "/boot", size => 16 << 11, type => 0x83 }, #- { mntpoint => "/", size => 256 << 11, type => 0x83 }, @@ -180,7 +181,7 @@ $o = $::o = { steps => \%installSteps, orderedSteps => \@orderedInstallSteps, - base => [ qw(basesystem sed initscripts console-tools mkbootdisk anacron rhs-hwdiag utempter ldconfig chkconfig ntsysv mktemp setup filesystem SysVinit bdflush crontabs dev e2fsprogs etcskel fileutils findutils getty_ps grep groff gzip hdparm info initscripts isapnptools kernel less ldconfig lilo logrotate losetup man mkinitrd mingetty modutils mount net-tools passwd procmail procps psmisc mandrake-release rootfiles rpm sash sed setconsole setserial shadow-utils sh-utils slocate stat sysklogd tar termcap textutils time tmpwatch util-linux vim-minimal vixie-cron which cpio perl) ], + base => [ qw(basesystem sed initscripts console-tools mkbootdisk anacron utempter ldconfig chkconfig ntsysv mktemp setup filesystem SysVinit bdflush crontabs dev e2fsprogs etcskel fileutils findutils getty_ps grep groff gzip hdparm info initscripts isapnptools kernel less ldconfig lilo logrotate losetup man mkinitrd mingetty modutils mount net-tools passwd procmail procps psmisc mandrake-release rootfiles rpm sash sed setserial shadow-utils sh-utils slocate stat sysklogd tar termcap textutils time tmpwatch util-linux vim-minimal vixie-cron which cpio perl-base) ], #- for the list of fields available for user and superuser, see @etc_pass_fields in install_steps.pm #- intf => [ { DEVICE => "eth0", IPADDR => '1.2.3.4', NETMASK => '255.255.255.128' } ], @@ -269,8 +270,8 @@ sub setupSCSI { sub partitionDisks { return $o->{fstab} = [ - { device => "loop7", mntpoint => "/", isFormatted => 1, isMounted => 1 }, - { device => "/initrd/dos/lnx4win/swapfile", mntpoint => "swap", isFormatted => 1, isMounted => 1 }, + { device => "loop7", type => 0x83, mntpoint => "/", isFormatted => 1, isMounted => 1 }, + { device => "/initrd/dos/lnx4win/swapfile", type => 0x82, mntpoint => "swap", isFormatted => 1, isMounted => 1 }, ] if $o->{lnx4win}; return if $o->{isUpgrade}; @@ -306,18 +307,20 @@ sub formatPartitions { $o->formatPartitions(@{$o->{fstab}}); fs::mount_all([ grep { isExt2($_) || isSwap($_) } @{$o->{fstab}} ], $o->{prefix}); } + eval { $o = $::o = install_any::loadO($o) } if $_[1] == 1; } mkdir "$o->{prefix}/$_", 0755 foreach qw(dev etc etc/sysconfig etc/sysconfig/console etc/sysconfig/network-scripts - home mnt root tmp var var/tmp var/lib var/lib/rpm); + home mnt tmp var var/tmp var/lib var/lib/rpm); + mkdir "$o->{prefix}/$_", 0700 foreach qw(root); } #------------------------------------------------------------------------------ #-PADTODO sub choosePackages { - $o->setPackages($o, \@install_classes) if $_[1] == 1; + $o->setPackages if $_[1] == 1; $o->selectPackagesToUpgrade($o) if $o->{isUpgrade} && $_[1] == 1; - $o->choosePackages($o->{packages}, $o->{compss}); + $o->choosePackages($o->{packages}, $o->{compss}, $o->{compssUsers}); $o->{packages}{$_}{selected} = 1 foreach @{$o->{base}}; } @@ -383,7 +386,7 @@ sub setRootPassword { sub addUser { return if $o->{isUpgrade}; - $o->addUser; + $o->addUser($_[0]); install_any::setAuthentication(); } @@ -409,6 +412,8 @@ sub configureX { $o->setupXfree if $o->{packages}{XFree86}{installed} || $clicked; } #------------------------------------------------------------------------------ +sub miscellaneous { $o->miscellaneous($_[0]); } +#------------------------------------------------------------------------------ sub exitInstall { $o->exitInstall(getNextStep() eq "exitInstall") } @@ -420,6 +425,7 @@ sub main { $::beginner = $::expert = $::g_auto_install = 0; + my $cfg; my %cmdline; map { my ($n, $v) = split '='; $cmdline{$n} = $v || 1; @@ -445,13 +451,14 @@ sub main { beginner => sub { $o->{installClass} = 'beginner'; $::beginner = 1 }, lnx4win => sub { $o->{lnx4win} = 1 }, readonly => sub { $o->{partitioning}{readonly} = 1 }, - test => sub { $::testing = 1 }, display => sub { $o->{display} = $v }, -# ks => sub { $::auto_install = 1 }, -# kickstart => sub { $::auto_install = 1 }, -# auto_install => sub { $::auto_install = 1 }, - defaultcfg => sub { $o = install_any::loadO($o, $v) }, - alawindows => sub { $o->{partitioning}{clearall} = 1; $o->{bootloader}{crushMbr} = 1 }, + security => sub { $o->{security} = $v }, + test => sub { $::testing = 1 }, + defcfg => sub { $cfg = $v }, +# ks => sub { $::auto_install = 1; $cfg = $v; }, +# kickstart => sub { $::auto_install = 1; $cfg = $v; }, + auto_install => sub { $::auto_install = 1; $cfg = $v; }, + alawindows => sub { $o->{security} = $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; @@ -482,16 +489,10 @@ sub main { if ($::auto_install) { require 'install_steps_auto_install.pm'; - my $f = "auto_inst.cfg"; - unless ($::testing) { - fs::mount(devices::make("fd0"), "/mnt", "vfat", 0); - $f = "/mnt/$f"; - } - $o = install_any::loadO($o, $f); - fs::umount("/mnt") unless $::testing; } else { require 'install_steps_graphical.pm'; } + eval { $o = $::o = install_any::loadO($o, $cfg) } if $cfg; $o->{prefix} = $::testing ? "/tmp/test-perl-install" : "/mnt"; mkdir $o->{prefix}, 0755; @@ -551,13 +552,11 @@ sub main { fs::write($o->{prefix}, $o->{fstab}); modules::write_conf("$o->{prefix}/etc/conf.modules", 'append'); - install_any::lnx4win_postinstall() if $o->{lnx4win}; + install_any::lnx4win_postinstall($o->{prefix}) if $o->{lnx4win}; install_any::killCardServices(); log::l("installation complete, leaving"); print "\n" x 30; - - install_any::g_auto_install() if $::g_auto_install; } #-###################################################################################### diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 722cf27c5..b810506ea 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -17,6 +17,7 @@ use common qw(:common :system :functional :file); use commands; use run_program; use partition_table qw(:types); +use devices; use fsedit; use detect_devices; use pkgs; @@ -30,7 +31,7 @@ use log; sub relGetFile($) { local $_ = $_[0]; my $dir = m|/| ? "mdkinst" : - (member($_, qw(compss compssList depslist hdlist)) ? "base" : "RPMS"); + (member($_, qw(compss compssList compssUsers depslist hdlist)) ? "base" : "RPMS"); $_ = "Mandrake/$dir/$_"; s/i386/i586/; $_; @@ -108,12 +109,10 @@ sub getAvailableSpace { die "missing root partition"; } -sub setPackages($$) { - my ($o, $install_classes) = @_; +sub setPackages($) { + my ($o) = @_; - if ($o->{packages}) { - $_->{selected} = 0 foreach values %{$o->{packages}}; - } else { + if (is_empty_hash_ref($o->{packages})) { my $useHdlist = $o->{method} !~ /nfs|hd/ || $o->{isUpgrade}; eval { $o->{packages} = pkgs::psUsingHdlist() } if $useHdlist; $o->{packages} = pkgs::psUsingDirectory() if !$useHdlist || $@; @@ -123,12 +122,15 @@ sub setPackages($$) { pkgs::getDeps($o->{packages}); my $c; ($o->{compss}, $c) = pkgs::readCompss($o->{packages}); - $o->{compssListLevels} = pkgs::readCompssList($o->{packages}, $c); - $o->{compssListLevels} ||= $install_classes; + $o->{compssListLevels} = pkgs::readCompssList($o->{packages}, $c, $o->{lang}); + $o->{compssUsers} = pkgs::readCompssUsers($o->{packages}, $o->{compss}); push @{$o->{base}}, "kernel-smp" if detect_devices::hasSMP(); push @{$o->{base}}, "kernel-pcmcia-cs" if $o->{pcmcia}; + } else { + $_->{selected} = 0 foreach values %{$o->{packages}}; } + #- this will be done if necessary in the selectPackagesToUpgrade, #- move the selection here ? this will remove the little window. unless ($o->{isUpgrade}) { @@ -315,9 +317,12 @@ sub lnx4win_postinstall { my $kernel = "$dir/vmlinuz"; rename $kernel, "$kernel.old"; commands::dd("if=$prefix/boot/vmlinuz", "of=$kernel"); + run_program::run("rdev", $kernel, "/dev/loop7"); unlink "$dir/size.txt"; unlink "$dir/swapfile.txt"; + + mkdir "$prefix/initrd", 0755; symlinkf "/initrd/dos", "$prefix/mnt/dos"; } @@ -331,8 +336,11 @@ sub unlockCdroms { foreach detect_devices::cdroms(); } -sub g_auto_install { - my $o = {}; +sub auto_inst_file() { "$::o->{prefix}/root/auto_inst.cfg.pl" } + +sub g_auto_install(;$) { + my ($f) = @_; $f ||= auto_inst_file; + my $o = bless {}; $o->{default_packages} = [ map { $_->{name} } grep { $_->{selected} && !$_->{base} } values %{$::o->{packages}} ]; @@ -341,29 +349,40 @@ sub g_auto_install { 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 - $o->{partitioning}{clearall} = 1; + local $o->{partitioning}{clearall} = 1; - delete @$_{qw(oldu oldg pw password2)} foreach $o->{superuser}, @{$o->{users} || []}; + $_ = { %{$_ || {}} }, delete @$_{qw(oldu oldg password password2)} foreach $o->{superuser}, @{$o->{users} || []}; local *F; - open F, ">auto_inst.cfg.pl" or die; + open F, ">$f" or log::l("can't output the auto_install script in $f"), return; print F Data::Dumper->Dump([$o], ['$o']), "\0"; } sub loadO { - my ($O, $f) = @_; + my ($O, $f) = @_; $f ||= auto_inst_file; my $o; - -e $f or $f .= ".pl"; - { - local *F; - open F, $f or die _("Error reading file $f"); + if ($f eq "floppy") { + my $f = "auto_inst.cfg"; + unless ($::testing) { + fs::mount(devices::make("fd0"), "/mnt", "vfat", 0); + $f = "/mnt/$f"; + } + -e $f or $f .= ".pl"; + $o = loadO($O, $f); + fs::umount("/mnt") unless $::testing; + } else { + -e $f or $f .= ".pl"; + { + local *F; + open F, $f or die _("Error reading file $f"); - local $/ = "\0"; - eval ; + local $/ = "\0"; + eval ; + } + $@ and log::l _("Bad kickstart file %s (failed %s)", $f, $@); + add2hash_($o, $O); } - $@ and log::l _("Bad kickstart file %s (failed %s)", $f, $@); - add2hash_($o, $O); - $o; + bless $o, ref $O; } sub pkg_install { diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 6a5005d8e..1224d8a83 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -46,7 +46,10 @@ sub leavingStep { my ($o, $step) = @_; log::l("step `$step' finished"); - eval { commands::cp('-f', "/tmp/ddebug.log", "$o->{prefix}/root") } if -d "$o->{prefix}/root" && !$::testing; + if (-d "$o->{prefix}/root") { + eval { commands::cp('-f', "/tmp/ddebug.log", "$o->{prefix}/root") }; + install_any::g_auto_install(); + } for (my $s = $o->{steps}{first}; $s; $s = $o->{steps}{$s}{next}) { #- the reachability property must be recomputed each time to take @@ -161,16 +164,16 @@ sub formatPartitions { #------------------------------------------------------------------------------ sub setPackages { - my ($o, $install_classes) = @_; - install_any::setPackages($o, $install_classes); + my ($o) = @_; + install_any::setPackages($o); } sub selectPackagesToUpgrade { my ($o) = @_; install_any::selectPackagesToUpgrade($o); } -sub choosePackages($$$) { - my ($o, $packages, $compss) = @_; +sub choosePackages($$$$) { + my ($o, $packages, $compss, $compssUsers) = @_; } sub beforeInstallPackages { @@ -223,8 +226,7 @@ sub configureNetwork($) { network::sethostname($o->{netc}) unless $::testing; network::addDefaultRoute($o->{netc}) unless $::testing; - install_any::pkg_install($o, "dhcpcd") if grep { $_->{BOOTPROTO} eq "dhcp" } @{$o->{intf}}; - install_any::pkg_install($o, "pump") if grep { $_->{BOOTPROTO} eq "bootp" } @{$o->{intf}}; + install_any::pkg_install($o, "dhcpcd") if grep { $_->{BOOTPROTO} =~ /^(dhcp|bootp)$/ } @{$o->{intf}}; #-res_init(); #- reinit the resolver so DNS changes take affect } @@ -264,13 +266,13 @@ sub printerConfig { } #------------------------------------------------------------------------------ -my @etc_pass_fields = qw(name password uid gid realname home shell); +my @etc_pass_fields = qw(name pw uid gid realname home shell); sub setRootPassword($) { my ($o) = @_; my $p = $o->{prefix}; - my %u = %{$o->{superuser} ||= {}}; + my $u = $o->{superuser} ||= {}; - $u{password} = install_any::crypt($u{password}) if $u{password}; + $u->{pw} ||= $u->{password} && install_any::crypt($u->{password}); my @lines = cat_(my $f = "$p/etc/passwd") or log::l("missing passwd file"), return; @@ -280,8 +282,8 @@ sub setRootPassword($) { if (/^root:/) { chomp; my %l; @l{@etc_pass_fields} = split ':'; - add2hash(\%u, \%l); - $_ = join(':', @u{@etc_pass_fields}) . "\n"; + add2hash($u, \%l); + $_ = join(':', @$u{@etc_pass_fields}) . "\n"; } print F $_; } @@ -306,7 +308,9 @@ sub addUser($) { if (!$g || getgrgid($g)) { for ($g = 500; getgrgid($g) || $gids{$g}; $g++) {} } $_->{home} ||= "/home/$_->{name}"; - @$_{qw(uid gid pw)} = ($u, $g, $_->{password} && install_any::crypt($_->{password})); + $_->{uid} = $u; + $_->{gid} = $g; + $_{pw} ||= $_->{password} && install_any::crypt($_->{password}); } my @passwd = cat_("$p/etc/passwd");; @@ -320,7 +324,11 @@ sub addUser($) { foreach (@l) { if (! -d "$p$_->{home}") { eval { commands::cp("-f", "$p/etc/skel", "$p$_->{home}") }; - if ($@) { log::l("copying of skel failed: $@"); mkdir("$p$_->{home}", 0750); } + if ($@) { + log::l("copying of skel failed: $@"); mkdir("$p$_->{home}", 0750); + } else { + chmod 0750, "$p$_->{home}"; + } } commands::chown_("-r", "$_->{uid}.$_->{gid}", "$p$_->{home}") if $_->{uid} != $_->{oldu} || $_->{gid} != $_->{oldg}; @@ -390,6 +398,17 @@ sub setupXfree { my ($o) = @_; } +#------------------------------------------------------------------------------ +sub miscellaneous { + my ($o) = @_; + setVarsInSh("$o->{prefix}/etc/sysconfig/system", { + LAPTOP => bool2text($o->{miscellaneous}{LAPTOP}), + HDPARM => $o->{miscellaneous}{HDPARM}, + TYPE => $o->{installClass}, + SECURITY => $o->{security}, + }); +} + #------------------------------------------------------------------------------ sub exitInstall { install_any::unlockCdroms } diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 9afea0269..9ce06b229 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -95,10 +95,11 @@ sub selectRootPartition($@) { #------------------------------------------------------------------------------ sub selectInstallClass($@) { my ($o, @classes) = @_; - $o->{installClass} = - $o->ask_from_list_(_("Install Class"), - _("What installation class do you want?"), - [ @classes ], $o->{installClass}); + my %c; $c{$_} = ucfirst translate($_) foreach @classes; + $o->{installClass} = ${{reverse %c}}{ + $o->ask_from_list(_("Install Class"), + _("What installation class do you want?"), + [ map { $c{$_} } @classes ], $c{$o->{installClass}})}; install_steps::selectInstallClass($o); } @@ -191,9 +192,9 @@ sub formatPartitions { } #------------------------------------------------------------------------------ sub setPackages { - my ($o, $install_classes) = @_; + my ($o) = @_; my $w = $o->wait_message('', _("Looking for available packages")); - $o->SUPER::setPackages($install_classes); + $o->SUPER::setPackages; } #------------------------------------------------------------------------------ sub selectPackagesToUpgrade { @@ -202,6 +203,20 @@ sub selectPackagesToUpgrade { $o->SUPER::selectPackagesToUpgrade(); } #------------------------------------------------------------------------------ +sub choosePackages { + my ($o, $packages, $compss, $compssUsers) = @_; + my %s; + + $o->ask_many_from_list_ref('', + _("Package Group Selection"), + [ keys %$compssUsers ], + [ map { \$s{$_} } keys %$compssUsers ] + ) or return; + foreach (grep { $s{$_} } keys %s) { + pkgs::select($o->{packages}, $_) foreach @{$compssUsers->{$_}}; + } +} +#------------------------------------------------------------------------------ sub configureNetwork($) { my ($o, $first_time) = @_; my $r = ''; @@ -243,13 +258,15 @@ sub configureNetwork($) { #- my $wait = $o->wait_message(_("Hostname"), _("Determining host name and domain...")); #- network::guessHostname($o->{prefix}, $o->{netc}, $o->{intf}); #- } - $o->configureNetworkNet($o->{netc}, $last ||= {}, @l) or return; + $last->{BOOTPROTO} =~ /^(dhcp|bootp)$/ || + $o->configureNetworkNet($o->{netc}, $last ||= {}, @l) or return; } install_steps::configureNetwork($o); } sub configureNetworkIntf { my ($o, $intf) = @_; + my $pump = 0; delete $intf->{NETWORK}; delete $intf->{BROADCAST}; my @fields = qw(IPADDR NETMASK); @@ -257,9 +274,11 @@ sub configureNetworkIntf { _("Please enter the IP configuration for this machine. Each item should be entered as an IP address in dotted-decimal notation (for example, 1.2.3.4)."), - [ _("IP address:"), _("Netmask:")], - [ \$intf->{IPADDR}, \$intf->{NETMASK} ], + [ _("IP address:"), _("Netmask:"), _("Automatic IP") ], + [ \$intf->{IPADDR}, \$intf->{NETMASK}, { val => \$pump, type => "bool", text => _("(bootp/dhcp)") } ], complete => sub { + $intf->{BOOTPROTO} = $pump ? "bootp" : "static"; + return 0 if $pump; for (my $i = 0; $i < @fields; $i++) { unless (network::is_ip($intf->{$fields[$i]})) { $o->ask_warn('', _("IP address should be in format 1.2.3.4")); @@ -277,6 +296,7 @@ notation (for example, 1.2.3.4)."), sub configureNetworkNet { my ($o, $netc, $intf, @devices) = @_; + $netc->{dnsServer} ||= network::dns($intf->{IPADDR}); $netc->{GATEWAY} ||= network::gateway($intf->{IPADDR}); @@ -505,7 +525,10 @@ sub setRootPassword($) { my $sup = $o->{superuser} ||= {}; $sup->{password2} ||= $sup->{password} ||= ""; - $o->ask_from_entries_ref([_("Set root password"), _("Ok"), _("No password")], + return if $o->{security} < 2; + + $o->{security} < 2 or + $o->ask_from_entries_ref([_("Set root password"), _("Ok"), _("No password")], _("Set root password"), [_("Password:"), _("Password (again):"), $o->{installClass} eq "server" || $::expert ? (_("Use shadow file"), _("Use MD5 passwords")) : () ], [{ val => \$sup->{password}, hidden => 1 }, @@ -515,10 +538,11 @@ sub setRootPassword($) { ], complete => sub { $sup->{password} eq $sup->{password2} or $o->ask_warn('', [ _("The passwords do not match"), _("Please try again") ]), return (1,1); - (length $sup->{password} < 6) and $o->ask_warn('', _("This password is too simple")), return (1,0); + length $sup->{password} < ($o->{security} > 4 ? 10 : 6) + and $o->ask_warn('', _("This password is too simple")), return (1,0); return 0 } - ); + ); install_steps::setRootPassword($o); } @@ -526,16 +550,16 @@ sub setRootPassword($) { #-addUser #------------------------------------------------------------------------------ sub addUser($) { - my ($o) = @_; - my $u = $o->{user} ||= {}; + my ($o, $clicked) = @_; + my $u = $o->{user} ||= $o->{security} < 2 ? { name => "mandrake", realname => "default" } : {}; $u->{password2} ||= $u->{password} ||= ""; my @fields = qw(realname name password password2); my @shells = install_any::shells($o); - if ($o->ask_from_entries_ref( - [ _("Add user"), _("Add user"), _("Done") ], + if ($o->{security} < 2 && !$clicked || $o->ask_from_entries_ref( + [ _("Add user"), _("Accept user"), _("Done") ], _("Enter a user\n%s", $o->{users} ? _("(already added %s)", join(", ", map { $_->{realname} } @{$o->{users}})) : ''), - [ _("Real name"), _("User name"), _("Password"), _("Password (again)"), _("Shell") ], + [ _("Real name"), _("User name"), $o->{security} < 3 ? () : (_("Password"), _("Password (again)")), $::beginner ? () : _("Shell") ], [ \$u->{realname}, \$u->{name}, {val => \$u->{password}, hidden => 1}, {val => \$u->{password2}, hidden => 1}, {val => \$u->{shell}, list => \@shells, not_edit => !$::expert}, @@ -555,7 +579,7 @@ sub addUser($) { )) { push @{$o->{users}}, $o->{user}; $o->{user} = {}; - goto &addUser;#- if $::expert; + goto &addUser unless $o->{security} < 2 && !$clicked; } install_steps::addUser($o); } @@ -623,8 +647,10 @@ _("Linear (needed for some SCSI drives)") => { val => \$b->{linear}, type => "bo _("Compact") => { val => \$b->{compact}, type => "bool", text => _("compact") }, _("Delay before booting default image") => \$b->{timeout}, _("Video mode") => { val => \$b->{vga}, list => [ keys %lilo::vga_modes ], not_edit => $::beginner }, +$o->{security} < 3 ? () : ( _("Password") => { val => \$b->{password}, hidden => 1 }, _("Restrict command line options") => { val => \$b->{restricted}, type => "bool", text => _("restrict") }, +) ); @l = @l[0..3] if $::beginner; @@ -634,6 +660,7 @@ _("Restrict command line options") => { val => \$b->{restricted}, type => "bool" [ grep_index { even($::i) } @l ], [ grep_index { odd($::i) } @l ], complete => sub { + $o->{security} > 4 && length($b->{password}) < 6 and $o->ask_warn('', _("At this level of security, a password (and a good one) in lilo is requested")), return 1; $b->{restricted} && !$b->{password} and $o->ask_warn('', _("Option ``Restrict command line options'' is of no use without a password")), return 1; 0; } @@ -706,6 +733,40 @@ _("Default") => { val => \$default, type => 'bool' }, } } +#------------------------------------------------------------------------------ +sub miscellaneous { + my ($o, $clicked) = @_; + my %l = ( + 1 => _("Windows(TM)"), + 2 => _("Low"), + 3 => _("Medium"), + 4 => _("High"), + 5 => _("Paranoid"), + ); + my $u = $o->{miscellaneous} ||= {}; + exists $u->{LAPTOP} or $u->{LAPTOP} = 1; + my $s = $o->{security} || ${{ + beginner => 2, + developer => 3, + server => 4, + expert => 3 + }}{$o->{installClass}}; + $s = $l{$s} || $s; + + !$::beginner || $clicked and $o->ask_from_entries_ref('', + _("Miscellaneous questions"), + [ _("Do you have a laptop?"), + _("Use hard drive optimizations"), + _("Security level") ], + [ { val => \$u->{LAPTOP}, type => 'bool' }, + { val => \$u->{HDPARM}, type => 'bool', text => _("(may cause disk problems)") }, + { val => \$s, list => [ map { $l{$_} } ikeys %l ] }, + ], + ) or return; + my %m = reverse %l; $o->{security} = $m{$s}; + $o->SUPER::miscellaneous; +} + #------------------------------------------------------------------------------ sub exitInstall { my ($o, $alldone) = @_; diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm index 49b4313ed..85840438e 100644 --- a/perl-install/interactive_gtk.pm +++ b/perl-install/interactive_gtk.pm @@ -57,16 +57,16 @@ sub ask_many_from_list_refW($$$$$) { my $n = 0; my $w = my_gtk->new('', %$o); gtkadd($w->{window}, - gtkpack(create_box_with_title($w, @$messages), - gtkpack(new Gtk::VBox(0,0), + gtkpack_(create_box_with_title($w, @$messages), + 1, gtkset_usize(createScrolledWindow(gtkpack(new Gtk::VBox(0,0), map { my $nn = $n++; my $o = Gtk::CheckButton->new($_); $o->set_active(${$val->[$nn]}); $o->signal_connect(clicked => sub { invbool \${$val->[$nn]} }); $o; - } @$list), - $w->create_okcancel, + } @$list)), 0, @$list > 11 ? 250 : @$list * 260 / 11 + 10), + 0, $w->create_okcancel, ) ); $w->{ok}->grab_focus; diff --git a/perl-install/modules.pm b/perl-install/modules.pm index 51e0096f5..828b92af7 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -26,6 +26,7 @@ my @drivers_by_category = ( "3c515" => "3com 3c515", "3c59x" => "3com 3c59x (Vortex)", "3c59x" => "3com 3c90x (Boomerang)", + "3c90x" => "3Com 3c90x (Cyclone/Hurricane/Tornado)", "at1700" => "Allied Telesis AT1700", "ac3200" => "Ansel Communication AC3200", "pcnet32" => "AMD PC/Net 32", diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 9a75983c5..073ecc1c3 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -22,46 +22,119 @@ use Data::Dumper; my %types = ( - 0 => "Empty", - 1 => "DOS 12-bit FAT", - 2 => "XENIX root", - 3 => "XENIX usr", - 4 => "DOS 16-bit <32M", - 5 => "Extended", - 6 => "DOS FAT16", - 7 => "OS/2 HPFS", #- or QNX? - 8 => "AIX", - 9 => "AIX bootable", - 10 => "OS/2 Boot Manager", - 0xb => "Win98 FAT32 0xb", - 0xc => "Win98 FAT32", - 0xe => "Win95 FAT16", - 0xf => "Win95 Ext'd (LBA)", - 0x12 => "Compaq setup", - 0x40 => "Venix 80286", - 0x51 => "Novell?", - 0x52 => "Microport", #- or CPM? - 0x63 => "GNU HURD", #- or System V/386? - 0x64 => "Novell Netware 286", - 0x65 => "Novell Netware 386", - 0x75 => "PC/IX", - 0x80 => "Old MINIX", #- Minix 1.4a and earlier - - 0x81 => "Linux/MINIX", #- Minix 1.4b and later - 0x82 => "Linux swap", - 0x83 => "Linux native", - - 0x93 => "Amoeba", - 0x94 => "Amoeba BBT", #- (bad block table) - 0xa5 => "BSD/386", - 0xb7 => "BSDI fs", - 0xb8 => "BSDI swap", - 0xc7 => "Syrinx", - 0xdb => "CP/M", #- or Concurrent DOS? - 0xe1 => "DOS access", - 0xe3 => "DOS R/O", - 0xf2 => "DOS secondary", - 0xff => "BBT" #- (bad track table) + 0x0 => 'Empty', + 0x1 => 'DOS 12-bit FAT', + 0x2 => 'XENIX root', + 0x3 => 'XENIX /usr', + 0x4 => 'DOS 16-bit FAT (up to 32M)', + 0x5 => 'DOS 3.3+ Extended Partition', + 0x6 => 'DOS FAT16', + 0x7 => 'OS/2 IFS (e.g., HPFS) / Windows NT NTFS / Advanced Unix / QNX2.x pre-1988 (see below under IDs 4d-4f)', + 0x8 => 'OS/2 (v1.0-1.3 only) / AIX boot partition / SplitDrive / Commodore DOS / DELL partition spanning multiple drives / QNX 1.x and 2.x ("qny")', + 0x9 => 'AIX data partition / Coherent filesystem / QNX 1.x and 2.x ("qnz")', + 0xa => 'OS/2 Boot Manager / Coherent swap partition / OPUS', + 0xb => 'Win98 FAT32', + 0xc => 'Win98 FAT32, LBA-mapped', + 0xe => 'Win95: DOS 16-bit FAT, LBA-mapped', + 0xf => 'Win95: Extended partition, LBA-mapped', + 0x10 => 'OPUS (?)', + 0x11 => 'Hidden DOS 12-bit FAT', + 0x12 => 'Compaq config partition', + 0x14 => 'Hidden DOS 16-bit FAT <32M', + 0x16 => 'Hidden DOS 16-bit FAT >=32M', + 0x17 => 'Hidden IFS (e.g., HPFS)', + 0x18 => 'AST Windows swapfile', + 0x1b => 'Hidden WIN95 OSR2 32-bit FAT', + 0x1c => 'Hidden WIN95 OSR2 32-bit FAT, LBA-mapped', + 0x1e => 'Hidden FAT95', + 0x22 => 'Used for Oxygen Extended Partition Table by ekstazya@sprint.ca.', + 0x24 => 'NEC DOS 3.x', + 0x38 => 'THEOS ver 3.2 2gb partition', + 0x39 => 'THEOS ver 4 spanned partition', + 0x3a => 'THEOS ver 4 4gb partition', + 0x3b => 'THEOS ver 4 extended partition', + 0x3c => 'PartitionMagic recovery partition', + 0x40 => 'Venix 80286', + 0x41 => 'Linux/MINIX (sharing disk with DRDOS) / Personal RISC Boot / PPC PReP (Power PC Reference Platform) Boot', + 0x42 => 'Linux swap (sharing disk with DRDOS) / SFS (Secure Filesystem) / W2K marker', + 0x43 => 'Linux native (sharing disk with DRDOS)', + 0x45 => 'EUMEL/Elan', + 0x46 => 'EUMEL/Elan 0x46', + 0x47 => 'EUMEL/Elan 0x47', + 0x48 => 'EUMEL/Elan 0x48', + 0x4d => 'QNX4.x', + 0x4e => 'QNX4.x 2nd part', + 0x4f => 'QNX4.x 3rd part / Oberon partition', + 0x50 => 'OnTrack Disk Manager (older versions) RO', + 0x51 => 'OnTrack Disk Manager RW (DM6 Aux1) / Novell', + 0x52 => 'CP/M / Microport SysV/AT', + 0x53 => 'Disk Manager 6.0 Aux3', + 0x54 => 'Disk Manager 6.0 Dynamic Drive Overlay', + 0x55 => 'EZ-Drive', + 0x56 => 'Golden Bow VFeature Partitioned Volume. / DM converted to EZ-BIOS', + 0x57 => 'DrivePro', + 0x5c => 'Priam EDisk', + 0x61 => 'SpeedStor', + 0x63 => 'Unix System V (SCO, ISC Unix, UnixWare, ...), Mach, GNU Hurd', + 0x64 => 'PC-ARMOUR protected partition / Novell Netware 2.xx', + 0x65 => 'Novell Netware 3.xx or 4.xx', + 0x67 => 'Novell', + 0x68 => 'Novell 0x68', + 0x69 => 'Novell 0x69', + 0x70 => 'DiskSecure Multi-Boot', + 0x75 => 'IBM PC/IX', + 0x80 => 'MINIX until 1.4a', + 0x81 => 'MINIX since 1.4b, early Linux / Mitac disk manager', + 0x82 => 'Linux swap', + 0x83 => 'Linux native', + 0x84 => 'OS/2 hidden C: drive / Hibernation partition', + 0x85 => 'Linux extended partition', + 0x86 => 'Old Linux RAID partition superblock / NTFS volume set', + 0x87 => 'NTFS volume set', + 0x8a => 'Linux Kernel Partition (used by AiR-BOOT)', + 0x8e => 'Linux Logical Volume Manager partition', + 0x93 => 'Amoeba', + 0x94 => 'Amoeba bad block table', + 0x99 => 'DCE376 logical drive', + 0xa0 => 'IBM Thinkpad hibernation partition / Phoenix NoteBIOS Power Management "Save-to-Disk" partition', + 0xa5 => 'BSD/386, 386BSD, NetBSD, FreeBSD', + 0xa6 => 'OpenBSD', + 0xa7 => 'NEXTSTEP', + 0xa9 => 'NetBSD', + 0xaa => 'Olivetti Fat 12 1.44Mb Service Partition', + 0xb7 => 'BSDI filesystem', + 0xb8 => 'BSDI swap partition', + 0xbe => 'Solaris boot partition', + 0xc0 => 'CTOS / REAL/32 secure small partition', + 0xc1 => 'DRDOS/secured (FAT-12)', + 0xc4 => 'DRDOS/secured (FAT-16, < 32M)', + 0xc6 => 'DRDOS/secured (FAT-16, >= 32M) / Windows NT corrupted FAT16 volume/stripe set', + 0xc7 => 'Windows NT corrupted NTFS volume/stripe set / Syrinx boot', + 0xcb => 'reserved for DRDOS/secured (FAT32)', + 0xcc => 'reserved for DRDOS/secured (FAT32, LBA)', + 0xcd => 'CTOS Memdump?', + 0xce => 'reserved for DRDOS/secured (FAT16, LBA)', + 0xd0 => 'REAL/32 secure big partition', + 0xd1 => 'Old Multiuser DOS secured FAT12', + 0xd4 => 'Old Multiuser DOS secured FAT16 <32M', + 0xd5 => 'Old Multiuser DOS secured extended partition', + 0xd6 => 'Old Multiuser DOS secured FAT16 >=32M', + 0xd8 => 'CP/M-86', + 0xdb => 'Digital Research CP/M, Concurrent CP/M, Concurrent DOS / CTOS (Convergent Technologies OS -Unisys) / KDG Telemetry SCPU boot', + 0xdd => 'Hidden CTOS Memdump?', + 0xe1 => 'DOS access or SpeedStor 12-bit FAT extended partition', + 0xe3 => 'DOS R/O or SpeedStor', + 0xe4 => 'SpeedStor 16-bit FAT extended partition < 1024 cyl.', + 0xeb => 'BeOS', + 0xee => 'Indication that this legacy MBR is followed by an EFI header', + 0xef => 'Partition that contains an EFI file system', + 0xf1 => 'SpeedStor', + 0xf2 => 'DOS 3.3+ secondary partition', + 0xf4 => 'SpeedStor large partition / Prologue single-volume partition', + 0xf5 => 'Prologue multi-volume partition', + 0xfd => 'Linux raid partition with autodetect using persistent superblock', + 0xfe => 'SpeedStor > 1024 cyl. or LANstep / IBM PS/2 IML (Initial Microcode Load) partition, located at the end of the disk. / Windows NT Disk Administrator hidden partition / Linux Logical Volume Manager partition (old)', + 0xff => 'Xenix Bad Block Table', ); my %type2fs = ( diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index e32d8c8f4..4c49d6a43 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -80,21 +80,21 @@ sub unselect($$;$) { } return if defined $size && $size <= 0; -# #- garbage collect for circular dependencies -# my $changed = 0; #1; -# while ($changed) { -# $changed = 0; -# NEXT: foreach my $p (grep { $_->{selected} > 0 && !$_->{base} } values %$packages) { -# my $set = set_new(@{$p->{provides}}); -# foreach (@{$set->{list}}) { -# my $q = Package($packages, $_); -# $q->{selected} == -1 || $q->{base} and next NEXT; -# set_add($set, @{$q->{provides}}) if $q->{selected}; -# } -# $p->{selected} = 0; -# $changed = 1; -# } -# } +#- #- garbage collect for circular dependencies +#- my $changed = 0; #1; +#- while ($changed) { +#- $changed = 0; +#- NEXT: foreach my $p (grep { $_->{selected} > 0 && !$_->{base} } values %$packages) { +#- my $set = set_new(@{$p->{provides}}); +#- foreach (@{$set->{list}}) { +#- my $q = Package($packages, $_); +#- $q->{selected} == -1 || $q->{base} and next NEXT; +#- set_add($set, @{$q->{provides}}) if $q->{selected}; +#- } +#- $p->{selected} = 0; +#- $changed = 1; +#- } +#- } } sub toggle($$) { my ($packages, $p) = @_; @@ -168,6 +168,11 @@ sub getDeps($) { } } +sub category2packages($) { + my ($p) = @_; + $p->{packages} || [ map { @{ category2packages($_) } } values %{$p->{childs}} ]; +} + sub readCompss($) { my ($packages) = @_; my ($compss, $compss_, $ps) = { childs => {} }; @@ -195,9 +200,17 @@ sub readCompss($) { ($compss, $compss_); } -sub readCompssList($$) { - my ($packages, $compss_) = @_; - +sub readCompssList($$$) { + my ($packages, $compss_, $lang) = @_; + my ($r, $s) = ('', ''); + if ($lang) { + local $SIG{__DIE__} = 'none'; + my ($l) = split ' ', lang::lang2text($lang); + $r = "($lang"; + $r .= "|$1" if $lang =~ /(..)./; + $r .= "|$l" if $l; + $r .= ")"; + } my $f = install_any::getFile("compssList") or die "can't find compssList"; local $_ = <$f>; my $level = [ split ]; @@ -206,25 +219,48 @@ sub readCompssList($$) { foreach (<$f>) { /^\s*$/ || /^#/ and next; - /^packages\s*$/ and do { $e = $packages; next }; - /^categories\s*$/ and do { $e = $compss_; next }; + /^packages\s*$/ and do { $e = $packages; $s = '-'; next }; + /^categories\s*$/ and do { $e = $compss_; $s = ':'; next }; my ($name, @values) = split; $e or log::l("neither packages nor categories"); - my $p = $e->{$name} or log::l("unknown entry $name (in compssList)"), next; + + @values = map { $_ + 40 } @values if $name =~ /$s$r$/i; $p->{values} = \@values; } $level; } -sub verif_lang($$) { - my ($p, $lang) = @_; +sub readCompssUsers { + my ($packages, $compss) = @_; + my (%compssUsers, $l); + + my $f = install_any::getFile("compssUsers") or die "can't find compssUsers"; + foreach (<$f>) { + /^\s*$/ || /^#/ and next; + s/#.*//; + + if (/^(\S.*)/) { + $compssUsers{$1} = $l = []; + } elsif (/\s+\+(.*)/) { + push @$l, $packages->{$1} || do { log::l("unknown package $1 (in compssUsers)"); next }; + } elsif (/\s+(.*)/) { + my $p = $compss; + $p &&= $p->{childs}{$_} foreach split ':', $1; + $p or log::l("unknown category $1 (in compssUsers)"), next; + push @$l, @{ category2packages($p) }; + } + } + \%compssUsers; +} + +sub isLangSensitive($$) { + my ($name, $lang) = @_; local $SIG{__DIE__} = 'none'; - $p->{options} =~ /l/ or return 1; - $p->{name} =~ /-([^-]*)$/ or return 1; - !($1 eq $lang || eval { lang::text2lang($1) eq $lang } && !$@); + $name =~ /-([^-]*)$/ or return; + $1 eq $lang || eval { lang::text2lang($1) eq $lang } && !$@; } sub setSelectedFromCompssList($$$$$$) { @@ -244,7 +280,6 @@ sub setSelectedFromCompssList($$$$$$) { $level = min($level, $p->{values}[$ind]); last if $level == 0; - verif_lang($p, $lang) or next; &select($packages, $p) unless $isUpgrade; my $nb = 0; foreach (@packages) { diff --git a/perl-install/share/compssList b/perl-install/share/compssList index 97db5de56..dbcb4350d 100644 --- a/perl-install/share/compssList +++ b/perl-install/share/compssList @@ -429,7 +429,7 @@ mouseconfig 90 0 90 mpage 55 0 80 mpg123 47 0 42 mswordview 60 0 54 -mtools 79 0 70 +mtools 79 0 84 mt-st 55 0 49 multimedia 65 0 53 mutt 50 0 45 @@ -800,27 +800,27 @@ daemons:sound 00 00 00 daemons:time 00 00 00 daemons:xfree86 00 00 00 database 10 80 00 -developpment:debuggers:console 00 00 90 -developpment:debuggers:x11 10 10 90 -developpment:libs:cdrecord 00 00 90 -developpment:libs:compression 00 00 90 -developpment:libs:database 00 00 90 -developpment:libs:fonts 00 00 90 -developpment:libs:gnome 00 00 90 -developpment:libs:graphics 00 00 90 -developpment:libs:gtk 00 00 90 -developpment:libs:filesystems 00 00 90 -developpment:libs:kde 00 00 90 -developpment:libs:language 00 10 90 -developpment:libs:misc 00 00 90 -developpment:libs:mouse 00 00 90 -developpment:libs:network 00 00 90 -developpment:libs:qt 00 00 90 -developpment:libs:sound 00 00 90 -developpment:libs:user-interface 00 00 90 -developpment:language 00 00 90 -developpment:tools:console 00 00 90 -developpment:tools:x11 00 00 90 +development:debuggers:console 00 00 90 +development:debuggers:x11 10 10 90 +development:libs:cdrecord 00 00 90 +development:libs:compression 00 00 90 +development:libs:database 00 00 90 +development:libs:fonts 00 00 90 +development:libs:gnome 00 00 90 +development:libs:graphics 00 00 90 +development:libs:gtk 00 00 90 +development:libs:filesystems 00 00 90 +development:libs:kde 00 00 90 +development:libs:language 00 10 90 +development:libs:misc 00 00 90 +development:libs:mouse 00 00 90 +development:libs:network 00 00 90 +development:libs:qt 00 00 90 +development:libs:sound 00 00 90 +development:libs:user-interface 00 00 90 +development:language 00 00 90 +development:tools:console 00 00 90 +development:tools:x11 00 00 90 disks 00 50 70 documentation:languages:chinese 90 90 90 documentation:languages:croatian 90 90 90 diff --git a/perl-install/share/list b/perl-install/share/list index 57bf1526d..2fe5262e3 100644 --- a/perl-install/share/list +++ b/perl-install/share/list @@ -51,6 +51,7 @@ /usr/lib/perl5/5.00503/vars.pm /usr/lib/perl5/site_perl/5.005/i386-linux/Gtk.pm /usr/lib/perl5/site_perl/5.005/i386-linux/Gtk/Types.pm +/usr/lib/perl5/site_perl/5.005/i386-linux/Gtk/XmHTML.pm /usr/lib/perl5/site_perl/5.005/i386-linux/Net/Cmd.pm /usr/lib/perl5/site_perl/5.005/i386-linux/Net/Config.pm /usr/lib/perl5/site_perl/5.005/i386-linux/Net/FTP.pm -- cgit v1.2.1