summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig
Commit message (Expand)AuthorAgeFilesLines
* fix typo causing "Out of memory"Pascal Rigaux2004-06-081-1/+1
* switch to xorgPascal Rigaux2004-06-083-5/+5
* add resolution 1920x1200 called WUXGA (used by Dell Laptops Inspiron 8500, 86...Pascal Rigaux2004-06-031-1/+1
* switch from deprecated OptionMenu into new ComboBox widgetThierry Vignaud2004-05-241-1/+1
* restore the ability to specify the file where the config should be written (s...Pascal Rigaux2004-05-171-4/+6
* simplify Xconfig::resolution_and_depth::allowed(): adapt it to the way it's r...Pascal Rigaux2004-05-131-13/+14
* $prefered_depth defaults to the greatest depths, no need to set it to 24Pascal Rigaux2004-05-131-1/+0
* vmware doesn't like 24bpp (bugzilla #9755)Pascal Rigaux2004-05-131-0/+2
* speed-up monitor choosing dialog when {VendorName} is undef (esp. when using ...Pascal Rigaux2004-05-131-1/+1
* perl_checker compliancePascal Rigaux2004-05-111-1/+2
* fix typoPascal Rigaux2004-05-111-1/+1
* remove debugging codePascal Rigaux2004-05-071-2/+0
* you can now configure monitors on heads > 1Pascal Rigaux2004-05-075-64/+82
* fix an old typoPascal Rigaux2004-05-071-1/+1
* rename monitors() and $monitors to monitors_db() and $monitors_dbPascal Rigaux2004-05-071-11/+11
* don't succeed automatic configuration (not auto_install) when there is many c...Pascal Rigaux2004-05-061-1/+3
* XFree 3 is gone!Pascal Rigaux2004-05-0312-1139/+512
* handle --autoThierry Vignaud2004-04-231-1/+1
* catch exception (bugzilla #8726)Pascal Rigaux2004-03-091-2/+2
* well we reverted to 4.3Guillaume Cottenceau2004-02-171-1/+1
* handle case where rpm can't be found (eg: XFree86-SVGA for xfree3) (part of b...Pascal Rigaux2004-02-121-1/+7
* prefer BoardName to card_namePascal Rigaux2004-02-101-1/+1
* RIVA128 fails miserably when using 16bppGuillaume Cottenceau2004-02-091-0/+1
* fix typoPascal Rigaux2004-02-091-1/+3
* handle allowNVIDIA_rpms & allowATI_rpms directly in Xconfig::card::install_se...Pascal Rigaux2004-02-091-6/+9
* force XF4 on all archsPascal Rigaux2004-02-091-1/+1
* move Xtest() and setMouseLive() out of c/stuff to xf86misc::mainPascal Rigaux2004-02-081-3/+4
* make XFdrake startup be instantenous for non nv|ati cards (allowNVIDIA_rpms andThierry Vignaud2004-02-081-2/+2
* - ensure ModelName comes from the ddc probe when choosing "Plug'n Play"Pascal Rigaux2004-02-061-2/+2
* don't test X config if using driver vmware (bugzilla #5346)Pascal Rigaux2004-02-061-1/+1
* - add ->prepare_write to allow comparing raw_X'sPascal Rigaux2004-02-054-9/+36
* allow 24bpp for DRI (since all drivers now support it: we had mga tdfx r128Pascal Rigaux2004-02-051-2/+1
* replace 4.3 with 4.4 (XFree version) (bugzilla #7378)Pascal Rigaux2004-02-041-1/+1
* detect_devices::matching_driver -> matching_desc but matching driver names (k...Guillaume Cottenceau2004-01-131-1/+1
* perl_checker compliancePascal Rigaux2004-01-081-2/+2
* pass --splash <resolution> to mkinitrdPascal Rigaux2004-01-071-0/+5
* obsolete livedrake, live_install, live_updatePascal Rigaux2004-01-061-1/+0
* use Options "IgnoreEDID" when using the proprietary X driver "nvidia"Pascal Rigaux2003-12-041-0/+1
* fix destroying HorizSync & VertRefresh (especially when coming from ddcxinfosPascal Rigaux2003-11-251-2/+5
* check that libglx.so is a link instead of checking if it exists (since it isPascal Rigaux2003-11-251-1/+1
* choose a not-to-bad default when X auto config fails in auto installPascal Rigaux2003-11-101-2/+5
* perl_checker fixesPascal Rigaux2003-09-291-1/+1
* avoid using other depth than 24 for fglrx in automatic mode.Francois Pons2003-09-151-0/+5
* configure_resolution() must return 'config_changed' when a new resolution is ...Pascal Rigaux2003-09-151-0/+1
* use center_always for popped windows (if transient is not used), and force ce...Pascal Rigaux2003-09-111-1/+1
* fixed depth to 24 when using driver fglrx (it won't work unless 24 bits)Francois Pons2003-09-111-0/+3
* fixup default fglrx config to be included in Device Section. thanks pixelNicolas Planel2003-09-101-51/+52
* cleanGuillaume Cottenceau2003-09-101-2/+0
* we don't have .jpg loader in install, file needs to be in .pngGuillaume Cottenceau2003-09-101-1/+1
* fixed perl_checker fixes.Francois Pons2003-09-101-2/+2
tr">'--') { 0; } else { 1; } } split(',', $options)); } s/\\040/ /g foreach $mntpoint, $dev, $options; my $h = { mntpoint => $mntpoint, fs_type => $fs_type, options => $options, comment => $comment, if_(member('keep_freq_passno', @reading_options), freq => $freq, passno => $passno), }; put_in_hash($h, fs::wild_device::to_subpart($dev)); if ($h->{device_LABEL} && !$h->{device_alias} && member('keep_device_LABEL', @reading_options)) { $h->{prefer_device_LABEL} = 1; } elsif ($h->{device_UUID} && !$h->{device_alias} && member('keep_device_UUID', @reading_options)) { $h->{prefer_device_UUID} = 1; } else { $h->{prefer_device} = 1; } if ($h->{options} =~ /credentials=/ && !member('verbatim_credentials', @reading_options)) { require fs::remote::smb; #- remove credentials=file with username=foo,password=bar,domain=zoo #- the other way is done in fstab_to_string my ($options, $unknown) = fs::mount_options::unpack($h); my $file = delete $options->{'credentials='}; my $credentials = fs::remote::smb::read_credentials_raw($file); if ($credentials->{username}) { $options->{"$_="} = $credentials->{$_} foreach qw(username password domain); fs::mount_options::pack($h, $options, $unknown); } } elsif ($h->{fs_type} eq 'davfs2' && !member('verbatim_credentials', @reading_options)) { require fs::remote::davfs; if (my $credentials = fs::remote::davfs::read_credentials($h->{mntpoint})) { my ($options, $unknown) = fs::mount_options::unpack($h); $options->{"$_="} = $credentials->{$_} foreach qw(username password); fs::mount_options::pack($h, $options, $unknown); } } $h; } @l; } sub merge_fstabs { my ($loose, $fstab, @l) = @_; foreach my $p (@$fstab) { my ($l1, $l2) = partition { fs::get::is_same_hd($_, $p) } @l; my ($p2) = @$l1 or next; @l = @$l2; $p->{mntpoint} = $p2->{mntpoint} if delete $p->{unsafeMntpoint}; if (!$loose) { $p->{fs_type} = $p2->{fs_type} if $p2->{fs_type}; $p->{options} = $p2->{options} if $p2->{options}; add2hash_($p, $p2); } else { $p->{isMounted} ||= $p2->{isMounted}; $p->{real_mntpoint} ||= $p2->{real_mntpoint}; } $p->{device_alias} ||= $p2->{device_alias} if $p->{device} ne $p2->{device} && $p2->{device} !~ m|/|; $p->{fs_type} && $p2->{fs_type} && $p->{fs_type} ne $p2->{fs_type} && $p->{fs_type} ne 'auto' && $p2->{fs_type} ne 'auto' and log::l("err, fstab and partition table do not agree for $p->{device} type: $p->{fs_type} vs $p2->{fs_type}"); } @l; } sub add2all_hds { my ($all_hds, @l) = @_; @l = merge_fstabs('', [ fs::get::really_all_fstab($all_hds) ], @l); foreach (@l) { my $s = $_->{fs_type} eq 'nfs' ? 'nfss' : $_->{fs_type} eq 'cifs' ? 'smbs' : $_->{fs_type} eq 'davfs2' ? 'davs' : isTrueLocalFS($_) || isSwap($_) || isOtherAvailableFS($_) ? '' : 'special'; push @{$all_hds->{$s}}, $_ if $s; } } sub get_major_minor { my ($fstab) = @_; foreach (@$fstab) { eval { my (undef, $major, $minor) = devices::entry($_->{device}); ($_->{major}, $_->{minor}) = ($major, $minor); } if !$_->{major}; } } sub merge_info_from_mtab { my ($fstab) = @_; my @l1 = map { my $l = $_; my $h = fs::type::fs_type2subpart('swap'); $h->{$_} = $l->{$_} foreach qw(device major minor); $h; } 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} =~ m!^/tmp/\w*image$!) { $_->{real_mntpoint} = delete $_->{mntpoint}; } $_->{isMounted} = 1; set_isFormatted($_, 1); } 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 = fs::get::mntpoint2part($_->{mntpoint}, $fstab); !$part || fs::get::is_same_hd($part, $_); #- keep it only if it is the mountpoint AND the same device } else { 1; } } read_fstab($prefix, '/etc/fstab', 'keep_default'); merge_fstabs($loose, $fstab, @l); } sub get_info_from_fstab { my ($all_hds) = @_; my @l = read_fstab($::prefix, '/etc/fstab', 'keep_default'); add2all_hds($all_hds, @l); } sub prepare_write_fstab { my ($fstab, $o_prefix, $b_keep_credentials) = @_; $o_prefix ||= ''; my %new; my (@smb_credentials, @davfs_credentials); my @l = map { my $device = isLoopback($_) ? ($_->{mntpoint} eq '/' ? "/initrd/loopfs" : $_->{loopback_device}{mntpoint}) . $_->{loopback_file} : fs::wild_device::from_part($o_prefix, $_); my $comment = $_->{comment}; $comment = '' if $comment =~ m!^Entry for /dev/.* :!; $comment ||= "# Entry for /dev/$_->{device} :\n" if $device =~ /^(UUID|LABEL)=/; my $real_mntpoint = $_->{mntpoint} || ${{ '/tmp/hdimage' => '/mnt/hd' }}{$_->{real_mntpoint}}; mkdir_p("$o_prefix$real_mntpoint") if $real_mntpoint =~ m|^/|; my $mntpoint = fs::type::carry_root_loopback($_) ? '/initrd/loopfs' : $real_mntpoint; my ($freq, $passno) = exists $_->{freq} ? ($_->{freq}, $_->{passno}) : isTrueLocalFS($_) && !$_->{dmcrypt_name} && $_->{options} !~ /encryption=/ && (!$_->{is_removable} || member($_->{mntpoint}, fs::type::directories_needed_to_boot())) ? (1, $_->{mntpoint} eq '/' ? 1 : fs::type::carry_root_loopback($_) ? 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} || 'defaults'; if ($_->{fs_type} eq 'cifs' && $options =~ /password=/ && !$b_keep_credentials) { require fs::remote::smb; if (my ($opts, $smb_credentials) = fs::remote::smb::fstab_entry_to_credentials($_)) { $options = $opts; push @smb_credentials, $smb_credentials; } } elsif ($_->{fs_type} eq 'davfs2' && $options =~ /password=/ && !$b_keep_credentials) { require fs::remote::davfs; if (my ($opts, $davfs_credentials) = fs::remote::davfs::fstab_entry_to_credentials($_)) { $options = $opts || 'defaults'; push @davfs_credentials, $davfs_credentials; } } my $fs_type = $_->{fs_type} || 'auto'; s/ /\\040/g foreach $mntpoint, $device, $options; my $file_dep = $options =~ /\b(loop|bind)\b/ ? $device : ''; [ $file_dep, $mntpoint, $comment . join(' ', $device, $mntpoint, $fs_type, $options, $freq, $passno) . "\n" ]; } else { (); } } grep { $_->{device} && ($_->{mntpoint} || $_->{real_mntpoint}) && $_->{fs_type} && ($_->{isFormatted} || !$_->{notFormatted}) } @$fstab; sub sort_it { my (@l) = @_; if (my $file_based = find { $_->[0] } @l) { my ($before, $other) = partition { $file_based->[0] =~ /^\Q$_->[1]/ } @l; $file_based->[0] = ''; #- all dependencies are now in before if (@$other && @$before) { sort_it(@$before), sort_it(@$other); } else { sort_it(@l); } } else { sort { $a->[1] cmp $b->[1] } @l; } } @l = sort_it(@l); join('', map { $_->[2] } @l), \@smb_credentials, \@davfs_credentials; } sub fstab_to_string { my ($all_hds, $o_prefix) = @_; my $fstab = [ fs::get::really_all_fstab($all_hds), @{$all_hds->{special}} ]; my ($s, undef) = prepare_write_fstab($fstab, $o_prefix, 'keep_credentials'); $s; } sub write_fstab { my ($all_hds, $o_prefix) = @_; log::l("writing $o_prefix/etc/fstab"); my $fstab = [ fs::get::really_all_fstab($all_hds), @{$all_hds->{special}} ]; my ($s, $smb_credentials, $davfs_credentials) = prepare_write_fstab($fstab, $o_prefix, ''); renamef("$o_prefix/etc/fstab", "$o_prefix/etc/fstab.old"); output("$o_prefix/etc/fstab", $s); require fs::remote::davfs; fs::remote::smb::save_credentials($_) foreach @$smb_credentials; fs::remote::davfs::save_credentials($davfs_credentials); fs::dmcrypt::save_crypttab($all_hds) if @{$all_hds->{dmcrypts}}; } sub set_removable_mntpoints { my ($all_hds) = @_; my %names; foreach (@{$all_hds->{raw_hds}}) { my $name = detect_devices::suggest_mount_point($_) or next; $name eq 'zip' || $name eq 'cdrom' and next; my $s = ++$names{$name}; $_->{mntpoint} ||= "/media/$name" . ($s == 1 ? '' : $s); } } sub get_raw_hds { my ($prefix, $all_hds) = @_; push @{$all_hds->{raw_hds}}, detect_devices::removables(); $_->{is_removable} = 1 foreach @{$all_hds->{raw_hds}}; get_major_minor($all_hds->{raw_hds}); my @fstab = read_fstab($prefix, '/etc/fstab', 'keep_default'); $all_hds->{nfss} = [ grep { $_->{fs_type} eq 'nfs' } @fstab ]; $all_hds->{smbs} = [ grep { $_->{fs_type} eq 'cifs' } @fstab ]; $all_hds->{davs} = [ grep { $_->{fs_type} eq 'davfs2' } @fstab ]; $all_hds->{special} = [ (grep { $_->{fs_type} eq 'tmpfs' } @fstab), { device => 'none', mntpoint => '/proc', fs_type => 'proc' }, ]; } ################################################################################ # various functions ################################################################################ sub df { my ($part, $o_prefix) = @_; my $dir = "/tmp/tmp_fs_df"; return $part->{free} if exists $part->{free}; if ($part->{isMounted}) { $dir = ($o_prefix || '') . $part->{mntpoint}; } elsif ($part->{notFormatted} && !$part->{isFormatted}) { return; #- will not even try! } else { mkdir_p($dir); eval { fs::mount::mount(devices::make($part->{device}), $dir, $part->{fs_type}, 'readonly') }; if ($@) { set_isFormatted($part, 0); unlink $dir; return; } } my (undef, $free) = MDK::Common::System::df($dir); if (!$part->{isMounted}) { fs::mount::umount($dir); unlink($dir); } $part->{free} = 2 * $free if defined $free; $part->{free}; } 1;