summaryrefslogtreecommitdiffstats
path: root/perl-install
ModeNameSize
-rw-r--r--.cvsignore54logstatsplain
-rw-r--r--.perl_checker166logstatsplain
-rw-r--r--ChangeLog2018203logstatsplain
-rw-r--r--Makefile10116logstatsplain
-rw-r--r--Makefile.config1613logstatsplain
-rw-r--r--Makefile.drakxtools3164logstatsplain
d---------Newt304logstatsplain
d---------Xconfig565logstatsplain
-rw-r--r--any.pm36730logstatsplain
-rw-r--r--apps.net_monitor73logstatsplain
-rw-r--r--authentication.pm8328logstatsplain
-rw-r--r--bootloader.pm40303logstatsplain
-rw-r--r--c.pm352logstatsplain
d---------c431logstatsplain
-rw-r--r--class_discard.pm189logstatsplain
-rwxr-xr-xcommands394logstatsplain
-rw-r--r--commands.pm13917logstatsplain
-rw-r--r--common.pm8153logstatsplain
-rw-r--r--crypto.pm5737logstatsplain
-rw-r--r--detect_devices.pm26462logstatsplain
-rw-r--r--devices.pm7051logstatsplain
d---------diskdrake278logstatsplain
-rw-r--r--do_pkgs.pm5954logstatsplain
-rw-r--r--drakxtools.spec144720logstatsplain
-rw-r--r--fs.pm29479logstatsplain
-rw-r--r--fsedit.pm26600logstatsplain
-rw-r--r--ftp.pm2204logstatsplain
-rw-r--r--handle_configs.pm4192logstatsplain
d---------harddrake177logstatsplain
-rw-r--r--help.pm48283logstatsplain
-rw-r--r--http.pm1254logstatsplain
-rwxr-xr-xinstall21206logstatsplain
-rw-r--r--install2.pm25895logstatsplain
-rw-r--r--install_any.pm41103logstatsplain
-rw-r--r--install_gtk.pm9221logstatsplain
-rw-r--r--install_interactive.pm11276logstatsplain
-rw-r--r--install_messages.pm6745logstatsplain
-rw-r--r--install_steps.pm37047logstatsplain
-rw-r--r--install_steps_auto_install.pm3306logstatsplain
-rw-r--r--install_steps_gtk.pm25514logstatsplain
-rw-r--r--install_steps_interactive.pm48407logstatsplain
-rw-r--r--install_steps_newt.pm1308logstatsplain
-rw-r--r--install_steps_stdio.pm667logstatsplain
-rw-r--r--interactive.pm17577logstatsplain
d---------interactive140logstatsplain
-rw-r--r--keyboard.pm23232logstatsplain
-rw-r--r--lang.pm54555logstatsplain
-rw-r--r--list.sparc2771logstatsplain
-rw-r--r--log.pm1366logstatsplain
-rw-r--r--loopback.pm3425logstatsplain
-rw-r--r--lvm.pm4560logstatsplain
-rw-r--r--modules.pm14561logstatsplain
d---------modules83logstatsplain
-rw-r--r--mouse.pm19924logstatsplain
d---------network568logstatsplain
-rw-r--r--pam.net_monitor225logstatsplain
-rw-r--r--partition_table.pm30941logstatsplain
d---------partition_table277logstatsplain
d---------patch460logstatsplain
-rwxr-xr-xperl2etags154logstatsplain
d---------pixmaps2303logstatsplain
-rw-r--r--pkgs.pm41926logstatsplain
d---------printer405logstatsplain
-rw-r--r--raid.pm4543logstatsplain
d---------resize_fat531logstatsplain
-rw-r--r--run_program.pm3894logstatsplain
d---------sbus_probing35logstatsplain
-rwxr-xr-xscanner.pm20071logstatsplain
d---------security179logstatsplain
-rw-r--r--services.pm17030logstatsplain
d---------share1721logstatsplain
-rw-r--r--standalone.pm10346logstatsplain
d---------standalone1733logstatsplain
-rw-r--r--steps.pm2356logstatsplain
-rw-r--r--swap.pm667logstatsplain
-rw-r--r--timezone.pm7885logstatsplain
-rw-r--r--ugtk2.pm57608logstatsplain
d---------unused288logstatsplain
-rwxr-xr-xverify_c303logstatsplain
-rw-r--r--wizards.pm8207logstatsplain
d---------xf86misc183logstatsplain
&& $p2->{type} ne 'auto' and log::l("err, fstab and partition table do not agree for $p->{device} type: " . (type2fs($p) || type2name($p->{type})) . " vs ", (type2fs($p2) || type2name($p2->{type}))); } @l; } sub add2all_hds { my ($all_hds, @l) = @_; @l = merge_fstabs('', [ fsedit::get_really_all_fstab($all_hds) ], @l); foreach (@l) { my $s = isThisFs('nfs', $_) ? 'nfss' : isThisFs('smbfs', $_) ? 'smbs' : isThisFs('davfs', $_) ? 'davs' : 'special'; push @{$all_hds->{$s}}, $_; } } sub get_major_minor { eval { my (undef, $major, $minor) = devices::entry($_->{device}); ($_->{major}, $_->{minor}) = ($major, $minor); } foreach @_; } sub merge_info_from_mtab { my ($fstab) = @_; my @l1 = map { my $l = $_; my %l = (type => fs2type('swap')); $l{$_} = $l->{$_} foreach qw(device major minor); \%l; } read_fstab('', '/proc/swaps'); my @l2 = map { read_fstab('', $_) } '/etc/mtab', '/proc/mounts'; foreach (@l1, @l2) { log::l("found mounted partition on $_->{device} with $_->{mntpoint}"); if ($::isInstall && $_->{mntpoint} eq '/tmp/hdimage') { log::l("found hdimage on $_->{device}"); $_->{real_mntpoint} = delete $_->{mntpoint}; $_->{mntpoint} = common::usingRamdisk() && "/mnt/hd"; #- remap for hd install. } $_->{isMounted} = $_->{isFormatted} = 1; delete $_->{options}; } merge_fstabs('loose', $fstab, @l1, @l2); } # - when using "$loose", it does not merge in type&options from the fstab sub merge_info_from_fstab { my ($fstab, $prefix, $uniq, $loose) = @_; my @l = grep { if ($uniq) { my $part = fsedit::mntpoint2part($_->{mntpoint}, $fstab); !$part || fsedit::is_same_hd($part, $_); #- keep it only if it is the mountpoint AND the same device } else { 1; } } read_fstab($prefix, "/etc/fstab", 'all_options'); merge_fstabs($loose, $fstab, @l); } sub prepare_write_fstab { my ($all_hds, $prefix, $keep_smb_credentials) = @_; $prefix ||= ''; my @l_in = (fsedit::get_really_all_fstab($all_hds), @{$all_hds->{special}}); my %new; my @smb_credentials; my @l = map { my $device = $_->{device} eq 'none' || member($_->{type}, qw(nfs smbfs davfs)) ? $_->{device} : isLoopback($_) ? ($_->{mntpoint} eq '/' ? "/initrd/loopfs" : "$_->{loopback_device}{mntpoint}") . $_->{loopback_file} : do { my $dir = $_->{device} =~ m!^(/|LABEL=)! ? '' : '/dev/'; eval { devices::make("$prefix$dir$_->{device}") }; "$dir$_->{device}"; }; my $real_mntpoint = $_->{mntpoint} || ${{ '/tmp/hdimage' => '/mnt/hd' }}{$_->{real_mntpoint}}; mkdir_p("$prefix$real_mntpoint", 0755) if $real_mntpoint =~ m|^/|; my $mntpoint = loopback::carryRootLoopback($_) ? '/initrd/loopfs' : $real_mntpoint; my ($freq, $passno) = exists $_->{freq} ? ($_->{freq}, $_->{passno}) : isTrueFS($_) && $_->{options} !~ /encryption=/ ? (1, $_->{mntpoint} eq '/' ? 1 : loopback::carryRootLoopback($_) ? 0 : 2) : (0, 0); if (($device eq 'none' || !$new{$device}) && ($mntpoint eq 'swap' || !$new{$mntpoint})) { #- keep in mind the new line for fstab. $new{$device} = 1; $new{$mntpoint} = 1; my $options = $_->{options}; if (isThisFs('smbfs', $_) && $options =~ /password=/ && !$keep_smb_credentials) { require network::smb; if (my ($opts, $smb_credentials) = network::smb::fstab_entry_to_credentials($_)) { $options = $opts; push @smb_credentials, $smb_credentials; } } my $type = type2fs($_); my $dev = $_->{device_LABEL} ? $_->{device_LABEL} : $_->{device_alias} ? "/dev/$_->{device_alias}" : $device; $mntpoint =~ s/ /\\040/g; $dev =~ s/ /\\040/g; # handle bloody supermount special case if ($options =~ /supermount/) { my @l = grep { $_ ne 'supermount' } split(',', $options); my @l1 = grep { member($_, 'ro', 'exec') } @l; my @l2 = difference2(\@l, \@l1); $options = join(",", "dev=$dev", "fs=$type", @l1, if_(@l2, '--', @l2)); ($dev, $type) = ('none', 'supermount'); } [ $mntpoint, $_->{comment} . join(' ', $dev, $mntpoint, $type, $options || 'defaults', $freq, $passno) . "\n" ]; } else { () } } grep { $_->{device} && ($_->{mntpoint} || $_->{real_mntpoint}) && $_->{type} } @l_in; join('', map { $_->[1] } sort { $a->[0] cmp $b->[0] } @l), \@smb_credentials; } sub fstab_to_string { my ($all_hds, $prefix) = @_; my ($s, undef) = prepare_write_fstab($all_hds, $prefix, 'keep_smb_credentials'); $s; } sub write_fstab { my ($all_hds, $prefix) = @_; log::l("writing $prefix/etc/fstab"); my ($s, $smb_credentials) = prepare_write_fstab($all_hds, $prefix, ''); output("$prefix/etc/fstab", $s); network::smb::save_credentials($_) foreach @$smb_credentials; } sub auto_fs() { grep { chop; $_ && !/nodev/ } cat_("/etc/filesystems"); } sub mount_options { my %non_defaults = ( sync => 'async', noatime => 'atime', noauto => 'auto', ro => 'rw', user => 'nouser', nodev => 'dev', noexec => 'exec', nosuid => 'suid', ); my @user_implies = qw(noexec nodev nosuid); \%non_defaults, \@user_implies; } # simple function # use mount_options_unpack + mount_options_pack for advanced stuff sub add_options(\$@) { my ($option, @options) = @_; my %l; @l{split(',', $$option), @options} = (); delete $l{defaults}; $$option = join(',', keys %l) || "defaults"; } sub mount_options_unpack { my ($part) = @_; my $packed_options = $part->{options}; my ($non_defaults, $user_implies) = mount_options(); my @auto_fs = auto_fs(); my %per_fs = ( iso9660 => [ qw(unhide) ], vfat => [ qw(umask=0) ], nfs => [ qw(rsize=8192 wsize=8192) ], smbfs => [ qw(username= password=) ], davfs => [ qw(username= password= uid= gid=) ], reiserfs => [ 'notail' ], ); push @{$per_fs{$_}}, 'usrquota', 'grpquota' foreach 'ext2', 'ext3', 'xfs'; while (my ($fs, $l) = each %per_fs) { isThisFs($fs, $part) || $part->{type} eq 'auto' && member($fs, @auto_fs) or next; $non_defaults->{$_} = 1 foreach @$l; } $non_defaults->{encrypted} = 1 if !$part->{isFormatted} || isSwap($part); $non_defaults->{supermount} = 1 if member(type2fs($part), 'auto', @auto_fs); my $defaults = { reverse %$non_defaults }; my %options = map { $_ => '' } keys %$non_defaults; my @unknown; foreach (split(",", $packed_options)) { if ($_ eq 'user') { $options{$_} = 1 foreach ('user', @$user_implies); } elsif (exists $non_defaults->{$_}) { $options{$_} = 1; } elsif ($defaults->{$_}) { $options{$defaults->{$_}} = 0; } elsif (/(.*?=)(.*)/) { $options{$1} = $2; } else { push @unknown, $_; } } # merge those, for cleaner help $options{'rsize=8192,wsize=8192'} = delete $options{'rsize=8192'} && delete $options{'wsize=8192'} if exists $options{'rsize=8192'}; my $unknown = join(",", @unknown); \%options, $unknown; } sub mount_options_pack_ { my ($part, $options, $unknown) = @_; my ($non_defaults, $user_implies) = mount_options(); my @l; if (delete $options->{user}) { push @l, 'user'; foreach (@$user_implies) { if (!delete $options->{$_}) { # overriding $options->{$non_defaults->{$_}} = 1; } } } push @l, map_each { if_($::b, $::a =~ /=$/ ? "$::a$::b" : $::a) } %$options; push @l, $unknown; join(",", uniq(grep { $_ } @l)); } sub mount_options_pack { my ($part, $options, $unknown) = @_; $part->{options} = mount_options_pack_($part, $options, $unknown); noreturn(); } sub mount_options_help { my %help = map { $_ => '' } @_; my %short = map { if_(/(.*?)=/, "$1=" => $_) } keys %help; foreach (split(':', $ENV{LANGUAGE}), '') { my $manpage = "/usr/share/man/$_/man8/mount.8.bz2"; -e $manpage or next; my ($tp, $option); foreach (`bzip2 -dc $manpage`) { my $prev_tp = $tp; $tp = /^\.(TP|RE)/; my ($s) = /^\.B (.*)/; if ($prev_tp && $s eq '\-o' .. /X^/) { if (my $v = $prev_tp && $s =~ /^[a-z]/i .. $tp) { if ($v == 1) { $s = $short{$s} || $s; $option = exists $help{$s} && !$help{$s} ? $s : ''; } elsif ($v !~ 'E0') { s/\\//g; s/\s*"(.*?)"\s*/$1/g if s/^\.BR\s+//; s/^\.B\s+//; $help{$option} .= $_ if $option; } } } } } %help; } sub set_default_options { my ($part, $is_removable, $useSupermount, $security, $iocharset, $codepage) = @_; my ($options, $unknown) = mount_options_unpack($part); if ($is_removable) { $options->{supermount} = $useSupermount; $part->{type} = 'auto'; # if supermount, code below will handle choosing the right type } my $is_auto = isThisFs('auto', $part); if ($part->{media_type} eq 'cdrom') { $options->{ro} = 1; } if ($part->{media_type} eq 'fd') { # slow device so don't loose time, write now! $options->{sync} = 1; } if (isTrueFS($part)) { #- noatime on laptops (do not wake up the hd) #- Do not update inode access times on this #- file system (e.g, for faster access on the #- news spool to speed up news servers). $options->{noatime} = detect_devices::isLaptop(); } if (isThisFs('nfs', $part)) { put_in_hash($options, { nosuid => 1, 'rsize=8192,wsize=8192' => 1, soft => 1, }); } if (isFat($part) || $is_auto) { put_in_hash($options, { user => 1, noexec => 0, }) if !exists $part->{rootDevice}; # partition means no removable media put_in_hash($options, { 'umask=0' => $security < 3, 'iocharset=' => $iocharset, 'codepage=' => $codepage, }); } if (isThisFs('ntfs', $part) || $is_auto) { put_in_hash($options, { 'iocharset=' => $iocharset }); } if (isThisFs('iso9660', $part) || $is_auto) { put_in_hash($options, { user => 1, noexec => 0, 'iocharset=' => $iocharset }); } if (isThisFs('reiserfs', $part)) { $options->{notail} = 1; } if (isLoopback($part) && !isSwap($part)) { #- no need for loop option for swap files $options->{loop} = 1; } # rationalize: no need for user if ($options->{autofs} || $options->{supermount}) { $options->{user} = 0; } # have noauto when we have user $options->{noauto} = 1 if $options->{user}; if ($options->{user}) { # ensure security (user_implies - noexec as noexec is not a security matter) $options->{$_} = 1 foreach 'nodev', 'nosuid'; } mount_options_pack($part, $options, $unknown); } sub set_all_default_options { my ($all_hds, $useSupermount, $security, $iocharset, $codepage) = @_; my @removables = @{$all_hds->{raw_hds}}; foreach my $part (fsedit::get_really_all_fstab($all_hds)) { set_default_options($part, member($part, @removables), $useSupermount, $security, $iocharset, $codepage); } } sub set_removable_mntpoints { my ($all_hds) = @_; my %names; foreach (@{$all_hds->{raw_hds}}) { my $name = $_->{media_type}; if (member($name, 'hd', 'fd')) { if (detect_devices::isZipDrive($_)) { $name = 'zip'; } elsif ($name eq 'fd') { $name = 'floppy'; } else { log::l("set_removable_mntpoints: don't know what to with hd $_->{device}"); next; } } if ($name) { my $s = ++$names{$name}; $_->{mntpoint} ||= "/mnt/$name" . ($s == 1 ? '' : $s); } } } sub get_raw_hds { my ($prefix, $all_hds) = @_; $all_hds->{raw_hds} = [ detect_devices::floppies(), detect_devices::cdroms__faking_ide_scsi(), detect_devices::zips__faking_ide_scsi(), ]; get_major_minor(@{$all_hds->{raw_hds}}); my @fstab = read_fstab($prefix, "/etc/fstab", 'all_options'); $all_hds->{nfss} = [ grep { isThisFs('nfs', $_) } @fstab ]; $all_hds->{smbs} = [ grep { isThisFs('smbfs', $_) } @fstab ]; $all_hds->{davs} = [ grep { isThisFs('davfs', $_) } @fstab ]; $all_hds->{special} = [ (grep { isThisFs('tmpfs', $_) } @fstab), { device => 'none', mntpoint => '/proc', type => 'proc' }, { device => 'none', mntpoint => '/dev/pts', type => 'devpts', options => 'mode=0620' }, ]; } ################################################################################ # formatting functions ################################################################################ sub disable_forced_fsck { my ($dev) = @_; run_program::run("tune2fs", "-c0", "-i0", devices::make($dev)); } sub format_ext2($@) { #- mke2fs -b (1024|2048|4096) -c -i(1024 > 262144) -N (1 > 100000000) -m (0-100%) -L volume-label #- tune2fs my ($dev, @options) = @_; $dev =~ m,(rd|ida|cciss)/, and push @options, qw(-b 4096 -R stride=16); #- For RAID only. push @options, qw(-b 1024 -O none) if arch() =~ /alpha/; run_program::run('mke2fs', '-F', @options, devices::make($dev)) or die _("%s formatting of %s failed", "ext2", $dev); } sub format_ext3 { my ($dev, @options) = @_; format_ext2($dev, "-j", @options); disable_forced_fsck($dev); } sub format_reiserfs { my ($dev, @options) = @_; #TODO add -h tea run_program::run("mkreiserfs", "-ff", @options, devices::make($dev)) or die _("%s formatting of %s failed", "reiserfs", $dev); } sub format_xfs { my ($dev, @options) = @_; run_program::run("mkfs.xfs", "-f", "-q", @options, devices::make($dev)) or die _("%s formatting of %s failed", "xfs", $dev); } sub format_jfs { my ($dev, @options) = @_; run_program::run("mkfs.jfs", "-f", @options, devices::make($dev)) or die _("%s formatting of %s failed", "jfs", $dev); } sub format_dos { my ($dev, @options) = @_; run_program::run("mkdosfs", @options, devices::make($dev)) or die _("%s formatting of %s failed", "dos", $dev); } sub format_hfs { my ($dev, @options) = @_; run_program::run("hformat", @options, devices::make($dev)) or die _("%s formatting of %s failed", "HFS", $dev); } sub real_format_part { my ($part) = @_; $part->{isFormatted} and return; my $dev = $part->{real_device} || $part->{device}; my @options = $part->{toFormatCheck} ? "-c" : (); log::l("formatting device $dev (type ", type2name($part->{type}), ")"); if (isExt2($part)) { push @options, "-F" if isLoopback($part); push @options, "-m", "0" if $part->{mntpoint} =~ m|^/home|; format_ext2($dev, @options); } elsif (isThisFs("ext3", $part)) { push @options, "-m", "0" if $part->{mntpoint} =~ m|^/home|; format_ext3($dev, @options);