summaryrefslogtreecommitdiffstats
path: root/perl-install
ModeNameSize
-rw-r--r--.cvsignore54logstatsplain
-rw-r--r--.perl_checker376logstatsplain
-rw-r--r--ChangeLog2786943logstatsplain
-rw-r--r--Makefile7801logstatsplain
-rw-r--r--Makefile.config1472logstatsplain
-rw-r--r--Makefile.drakxtools3635logstatsplain
d---------Newt304logstatsplain
d---------Xconfig454logstatsplain
-rw-r--r--any.pm42015logstatsplain
-rw-r--r--authentication.pm22995logstatsplain
-rw-r--r--bootloader.pm47012logstatsplain
-rw-r--r--bootsplash.pm6764logstatsplain
-rw-r--r--c.pm354logstatsplain
d---------c431logstatsplain
-rwxr-xr-xcommands428logstatsplain
-rw-r--r--commands.pm13002logstatsplain
-rw-r--r--common.pm7990logstatsplain
-rw-r--r--crypto.pm56768logstatsplain
-rw-r--r--detect_devices.pm33088logstatsplain
-rw-r--r--devices.pm6733logstatsplain
d---------diskdrake320logstatsplain
-rw-r--r--do_pkgs.pm5766logstatsplain
-rw-r--r--drakxtools.spec233424logstatsplain
-rw-r--r--fs.pm10821logstatsplain
d---------fs350logstatsplain
-rw-r--r--fsedit.pm18626logstatsplain
-rw-r--r--ftp.pm2241logstatsplain
-rw-r--r--handle_configs.pm4192logstatsplain
d---------harddrake216logstatsplain
-rw-r--r--help.pm42408logstatsplain
-rw-r--r--http.pm1275logstatsplain
-rwxr-xr-xinstall21201logstatsplain
-rw-r--r--install2.pm24033logstatsplain
-rw-r--r--install_any.pm67883logstatsplain
-rw-r--r--install_gtk.pm8566logstatsplain
-rw-r--r--install_interactive.pm11514logstatsplain
-rw-r--r--install_messages.pm6952logstatsplain
-rw-r--r--install_steps.pm35465logstatsplain
-rw-r--r--install_steps_auto_install.pm3363logstatsplain
-rw-r--r--install_steps_gtk.pm26280logstatsplain
-rw-r--r--install_steps_interactive.pm47613logstatsplain
-rw-r--r--install_steps_newt.pm1357logstatsplain
-rw-r--r--install_steps_stdio.pm667logstatsplain
-rw-r--r--interactive.pm18174logstatsplain
d---------interactive140logstatsplain
-rw-r--r--keyboard.pm28317logstatsplain
-rw-r--r--lang.pm62954logstatsplain
-rw-r--r--log.pm1314logstatsplain
-rw-r--r--lvm.pm5616logstatsplain
-rw-r--r--modules.pm9633logstatsplain
d---------modules209logstatsplain
-rw-r--r--mouse.pm21632logstatsplain
-rw-r--r--mygtk2.pm28164logstatsplain
d---------network870logstatsplain
-rw-r--r--partition_table.pm20410logstatsplain
d---------partition_table240logstatsplain
d---------patch563logstatsplain
-rwxr-xr-xperl2etags154logstatsplain
d---------pixmaps2388logstatsplain
-rw-r--r--pkgs.pm47236logstatsplain
d---------printer333logstatsplain
-rw-r--r--raid.pm7102logstatsplain
d---------resize_fat531logstatsplain
-rw-r--r--run_program.pm3998logstatsplain
d---------sbus_probing35logstatsplain
-rwxr-xr-xscanner.pm20765logstatsplain
d---------security179logstatsplain
-rw-r--r--services.pm17603logstatsplain
d---------share1445logstatsplain
-rw-r--r--standalone.pm10541logstatsplain
d---------standalone2251logstatsplain
-rw-r--r--steps.pm2365logstatsplain
-rw-r--r--timezone.pm7885logstatsplain
-rw-r--r--ugtk2.pm53026logstatsplain
d---------unused396logstatsplain
-rwxr-xr-xverify_c303logstatsplain
-rw-r--r--wizards.pm8210logstatsplain
d---------xf86misc183logstatsplain
pan> ((/map-drive/ .. /to/) && /to/) { $e->{mapdrive}{$e->{'map-drive'}} = $v; } else { $e->{$_} = $v || 1; } } } delete $b{timeout} unless $b{prompt}; $_->{append} =~ s/^\s*"?(.*?)"?\s*$/$1/ foreach \%b, @{$b{entries}}; $b{timeout} = $b{timeout} / 10 if $b{timeout}; $b{message} = cat_("$prefix$b{message}") if $b{message}; \%b; } sub suggest_onmbr ($) { my ($hds) = @_; my $type = partition_table_raw::typeOfMBR($hds->[0]{device}); !$type || member($type, qw(dos dummy lilo grub empty)), !$type; } sub compare_entries ($$) { my ($a, $b) = @_; my %entries; @entries{keys %$a, keys %$b} = (); $a->{$_} eq $b->{$_} and delete $entries{$_} foreach keys %entries; scalar keys %entries; } sub add_entry($$) { my ($entries, $v) = @_; my (%usedold, $freeold); do { $usedold{$1 || 0} = 1 if $_->{label} =~ /^old([^_]*)_/ } foreach @$entries; foreach (0..scalar keys %usedold) { exists $usedold{$_} or $freeold = $_ || '', last } foreach (@$entries) { if ($_->{label} eq $v->{label}) { compare_entries($_, $v) or return; #- avoid inserting it twice as another entry already exists ! $_->{label} = "old${freeold}_$_->{label}"; } } push @$entries, $v; } sub add_kernel($$$$$) { my ($prefix, $lilo, $kernelVersion, $specific, $v) = @_; my $ext = $specific && "-$specific"; $specific =~ s/\d+\.\d+|hack//; my ($vmlinuz, $image, $initrdImage) = ("vmlinuz-$kernelVersion$specific", "/boot/vmlinuz$ext", "/boot/initrd$ext.img"); -e "$prefix/boot/$vmlinuz" or log::l("unable to find kernel image $prefix/boot/$vmlinuz"), return; { my $f = "initrd-$kernelVersion$specific.img"; eval { mkinitrd($prefix, "$kernelVersion$specific", "/boot/$f") }; undef $initrdImage if $@; symlinkf $f, "$prefix$initrdImage" or $initrdImage = "/boot/$f" if $initrdImage; } symlinkf "$vmlinuz", "$prefix/$image" or $image = "/boot/$vmlinuz"; add2hash($v, { type => 'image', label => 'linux', kernel_or_dev => $image, initrd => $initrdImage, append => $lilo->{perImageAppend}, }); add_entry($lilo->{entries}, $v); $v; } sub get_append { my ($b, $key) = @_; ($b->{perImageAppend} =~ /\b$key=(\S*)/)[0]; } sub add_append { my ($b, $key, $val) = @_; foreach ({ append => $b->{perImageAppend} }, @{$b->{entries}}) { $_->{append} =~ s/\b$key=\S*\s*//; $_->{append} =~ s/\s*$/ $key=$val)/ if $val; } } sub configure_entry($$) { my ($prefix, $entry) = @_; if ($entry->{type} eq 'image') { my $specific_version; $entry->{kernel_or_dev} =~ /vmlinu.-(.*)/ and $specific_version = $1; readlink("$prefix/$entry->{kernel_or_dev}") =~ /vmlinu.-(.*)/ and $specific_version = $1; if ($specific_version) { $entry->{initrd} or $entry->{initrd} = "/boot/initrd-$specific_version.img"; unless (-e "$prefix/$entry->{initrd}") { eval { mkinitrd($prefix, $specific_version, "$entry->{initrd}") }; undef $entry->{initrd} if $@; } } } $entry; } sub dev2prompath { #- SPARC only my ($dev) = @_; my ($wd, $num) = $dev =~ /^(.*\D)(\d*)$/; require c; $dev = c::disk2PromPath($wd) and $dev = $dev =~ /^sd\(/ ? "$dev$num" : "$dev;$num"; $dev; } sub suggest { my ($prefix, $lilo, $hds, $fstab, $kernelVersion, $vga_fb) = @_; my $root_part = fsedit::get_root($fstab); my $root = isLoopback($root_part) ? "loop7" : $root_part->{device}; my $boot = fsedit::get_root($fstab, 'boot')->{device}; my $partition = first($boot =~ /\D*(\d*)/); require c; c::initSilo() if arch() =~ /sparc/; my ($onmbr, $unsafe) = $lilo->{crushMbr} ? (1, 0) : suggest_onmbr($hds); add2hash_($lilo, arch() =~ /sparc/ ? { default => "linux", entries => [], timeout => 5, use_partition => 0, #- we should almost always have a whole disk partition. root => "/dev/$root", partition => $partition || 1, boot => $root eq $boot && "/boot", #- this helps for getting default partition for silo. } : arch =~ /ppc/ ? { defaultos => "linux", default => "linux", entries => [], initmsg => "Welcome to Mandrake Linux!", delay => 30, #- OpenFirmware delay timeout => 50, enableofboot => 1, enablecdboot => 1, useboot => $boot, } : { bootUnsafe => $unsafe, default => "linux", lba32 => 1, entries => [], timeout => $onmbr && 5, if_(arch() !~ /ia64/, boot => "/dev/" . ($onmbr ? $hds->[0]{device} : fsedit::get_root($fstab, 'boot')->{device}), map => "/boot/map", install => "/boot/boot.b", ), }); if (!$lilo->{message} || $lilo->{message} eq "1") { $lilo->{message} = join('', cat_("$prefix/boot/message")); if (!$lilo->{message}) { my $msg_en = #-PO: these messages will be displayed at boot time in the BIOS, use only ASCII (7bit) __("Welcome to %s the operating system chooser! Choose an operating system in the list above or wait %d seconds for default boot. "); my $msg = translate($msg_en); #- use the english version if more than 20% of 8bits chars $msg = $msg_en if int(grep { $_ & 0x80 } unpack "c*", $msg) / length($msg) > 0.2; $lilo->{message} = sprintf $msg, arch() =~ /sparc/ ? "SILO" : "LILO", $lilo->{timeout}; } } add2hash_($lilo, { getVarsFromSh("$prefix/etc/sysconfig/system") }); #- for CLEAN_TMP add2hash_($lilo, { memsize => $1 }) if cat_("/proc/cmdline") =~ /mem=(\S+)/; #- give more priority to secure kernel because if the user want security, he will got it... my $isSecure = -e "$prefix/boot/vmlinuz-${kernelVersion}secure"; my $isEnterprise = -e "$prefix/boot/vmlinuz-${kernelVersion}enterprise"; my $isSMP = detect_devices::hasSMP(); if ($isSMP && !-e "$prefix/boot/vmlinuz-${kernelVersion}smp") { log::l("SMP machine, but no SMP kernel found") unless $isSecure; $isSMP = 0; } my $entry = add_kernel($prefix, $lilo, $kernelVersion, $isSecure ? 'secure' : $isEnterprise ? 'enterprise' : $isSMP ? 'smp' : '', { label => 'linux', root => "/dev/$root", if_($vga_fb, vga => $vga_fb), #- using framebuffer }); add_kernel($prefix, $lilo, $kernelVersion, '', { label => $isSecure || $isEnterprise || $isSMP ? 'linux-up' : 'linux-nonfb', root => "/dev/$root", }) if $isSecure || $isEnterprise || $isSMP || $vga_fb; my $failsafe = add_kernel($prefix, $lilo, $kernelVersion, '', { label => 'failsafe', root => "/dev/$root", }); $entry->{append} .= " quiet" if $vga_fb; $failsafe->{append} .= " failsafe" if $failsafe && !$lilo->{password}; #- manage older kernel if installed. foreach (qw(2.2 hack)) { my $hasOld = -e "$prefix/boot/vmlinuz-$_"; if ($hasOld) { my $oldVersion = first(readlink("$prefix/boot/vmlinuz-$_") =~ /vmlinuz-(.*mdk)/); my $oldSecure = -e "$prefix/boot/vmlinuz-${_}secure"; my $oldSMP = $isSMP && -e "$prefix/boot/vmlinuz-${_}smp"; add_kernel($prefix, $lilo, $oldVersion, $oldSecure ? "${_}secure" : $oldSMP ? "${_}smp" : $_, { label => "linux-$_", root => "/dev/$root", $vga_fb ? ( vga => $vga_fb) : (), #- using framebuffer }); add_kernel($prefix, $lilo, $oldVersion, $_, { label => $oldSecure || $oldSMP ? "linux-${_}up" : "linux-${_}nonfb", root => "/dev/$root", }) if $oldSecure || $oldSMP || $vga_fb; my $entry = add_kernel($prefix, $lilo, $oldVersion, $_, { label => "failsafe-$_", root => "/dev/$root", }); $entry->{append} .= " failsafe" if $entry && !$lilo->{password}; } } if (arch() =~ /sparc/) { #- search for SunOS, it could be a really better approach to take into account #- partition type for mounting point. my $sunos = 0; foreach (@$hds) { foreach (@{$_->{primary}{normal}}) { my $path = $_->{device} =~ m|^/| && $_->{device} !~ m|^/dev/| ? $_->{device} : dev2prompath($_->{device}); add_entry($lilo->{entries}, { type => 'other', kernel_or_dev => $path, label => "sunos" . ($sunos++ ? $sunos : ''), }) if $path && isSunOS($_) && type2name($_->{type}) =~ /root/i; } } } elsif (arch() =~ /ppc/) { #- if we identified a MacOS partition earlier - add it if (defined $partition_table_mac'macos_part) { add_entry($lilo->{entries}, { label => "macos", kernel_or_dev => $partition_table_mac'macos_part }); } } else { #- search for dos (or windows) boot partition. Don't look in extended partitions! my %nbs; foreach (@$hds) { foreach (@{$_->{primary}{normal}}) { my $label = isNT($_) ? 'NT' : isDos($_) ? 'dos' : 'windows'; add_entry($lilo->{entries}, { type => 'other', kernel_or_dev => "/dev/$_->{device}", label => $label . ($nbs{$label}++ ? $nbs{$label} : ''), table => "/dev/$_->{rootDevice}", unsafe => 1 }) if isNT($_) || isFat($_) && isFat({ type => fsedit::typeOfPart($_->{device}) }); } } } my %l = ( yaboot => bool(arch() =~ /ppc/), silo => bool(arch() =~ /sparc/), lilo => bool(arch() !~ /sparc|ppc/) && !isLoopback(fsedit::get_root($fstab)), grub => bool(arch() !~ /sparc|ppc/ && availableRamMB() < 800), #- don't use grub if more than 800MB loadlin => bool(arch() !~ /sparc|ppc/) && -e "/initrd/loopfs/lnx4win", ); unless ($lilo->{methods}) { $lilo->{methods} ||= { map { $_ => 1 } grep { $l{$_} } keys %l }; if ($lilo->{methods}{lilo} && -e "$prefix/boot/lilo-graphic") { $lilo->{methods}{lilo} = "lilo-graphic"; exists $lilo->{methods}{grub} and $lilo->{methods}{grub} = undef; } } } sub suggest_floppy { my ($bootloader) = @_; my $floppy = detect_devices::floppy() or return; $floppy eq 'fd0' or log::l("suggest_floppy: not adding $floppy"), return; add_entry($bootloader->{entries}, { type => 'other', kernel_or_dev => '/dev/fd0', label => 'floppy', unsafe => 1 }); } sub keytable($$) { my ($prefix, $f) = @_; local $_ = $f; if ($_ && !/\.klt$/) { $f = "/boot/$_.klt"; run_program::rooted($prefix, "keytab-lilo.pl", ">", $f, $_) or undef $f; } $f && -r "$prefix/$f" && $f; } sub has_profiles { bool(get_label("office", $b)) } sub set_profiles { my ($b, $want_profiles) = @_; my $office = get_label("office", $b); if ($want_profiles xor $office) { my $e = get_label("linux", $b); if ($want_profiles) { push @{$b->{entries}}, { %$e, label => "office", append => "$e->{append} prof=Office" }; $e->{append} .= " prof=Home"; } else { # remove profiles $e->{append} =~ s/\s*prof=\w+//; @{$b->{entries}} = grep { $_ != $office } @{$b->{entries}}; } } } sub get_of_dev($$) { my ($prefix, $unix_dev) = @_; #- don't care much for this - need to run ofpath rooted, and I need the result