From f0b2cf434b3a176276e79046eafc71a26d94ca3d Mon Sep 17 00:00:00 2001 From: Mystery Man Date: Tue, 11 May 2004 12:41:07 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'MDK-10-update'. --- move/move.pm | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) (limited to 'move/move.pm') diff --git a/move/move.pm b/move/move.pm index 2d072deed..fd20c558d 100644 --- a/move/move.pm +++ b/move/move.pm @@ -30,6 +30,7 @@ use log; use lang; use Digest::MD5 qw(md5_hex); +my @ALLOWED_LANGS = qw(en_US fr es it de nl); my $key_disabled; my ($using_existing_user_config, $using_existing_host_config); @@ -64,7 +65,7 @@ sub handle_etcfiles { } -sub handle_virtual_key() { +sub handle_virtual_key { return if $key_disabled; if (my ($device, $file, $options) = cat_('/proc/cmdline') =~ /\bvirtual_key=([^,\s]+),([^,\s]+)(,\S+)?/) { log::l("using device=$device file=$file as a virtual key with options $options"); @@ -104,7 +105,6 @@ sub init { mkdir "/etc/$_" foreach qw(X11); touch '/etc/modules.conf'; - touch '/etc/modprobe.conf'; symlinkf "/proc/mounts", "/etc/mtab"; #- these files need be writable but we need a sensible first contents @@ -139,13 +139,7 @@ sub init { #- create remaining /etc and /var subdirectories if not already copied or symlinked, #- because programs most often won't try to create the missing subdir before trying #- to write a file, leading to obscure unexpected failures - foreach (cat_('/image/move/directories-to-create')) { - my ($mode, $uid, $gid, $name) = split; - next if -d $name; - mkdir($name); - chmod(oct($mode), $name); - chown($uid, $gid, $name); - } + -d $_ or mkdir_p $_ foreach chomp_(cat_('/image/move/directories-to-create')); chmod 01777, '/tmp', '/var/tmp'; #- /var/tmp -> badly needed for printing from OOo @@ -155,7 +149,7 @@ sub init { #- or O_RDWR -> in that case, they should be handled in the #- OVERWRITE section of data/etcfiles) foreach (chomp_(cat_('/image/move/all-etcfiles'))) { - -f $_ or symlinkf_short("/image$_", $_); + -f or symlinkf_short("/image$_", $_); } #- free up stage1 memory @@ -164,7 +158,6 @@ sub init { #- devfsd needed for devices accessed by old names fs::mount("none", "/dev", "devfs", 0); - fs::mount("none", "/dev/pts", "devpts", 0); run_program::run('/sbin/devfsd', '/dev'); -d '/lib/modules/' . c::kernel_version() or warn("ERROR: kernel package " . c::kernel_version() . " not installed\n"), c::_exit(1); @@ -213,6 +206,7 @@ drakx_stuff: #- don't use shadow passwords since pwconv overwrites /etc/shadow hence contents will be lost for usb key delete $o->{authentication}{shadow}; + member($_, @ALLOWED_LANGS) or delete $lang::langs{$_} foreach keys %lang::langs; } sub lomount_clp { @@ -229,7 +223,7 @@ sub lomount_clp { log::l("lomount_clp: lomounting $name"); mkdir_p($dir); - my $dev = devices::find_free_loop(); + my $dev = devices::find_free_chloop(); run_program::run('losetup', '-r', '-e', 'gz', $dev, $clp); run_program::run('mount', '-r', $dev, $dir); } @@ -280,7 +274,7 @@ sub key_umount { eval { fs::umount_part($_) foreach key_parts($o); 1 }; } -sub machine_ident() { +sub machine_ident { #- , c::get_hw_address('eth0'); before detect of network :( md5_hex(join '', (map { (split)[1] } cat_('/proc/bus/pci/devices'))); } @@ -348,7 +342,7 @@ sub key_installfiles { unlink($_), run_program::run('cp', "/image$_", $_) foreach qw(/etc/sudoers); } -sub reboot() { +sub reboot { output('/var/run/rebootctl', "reboot"); #- tell X_move to not respawn run_program::run('killall', 'X'); #- kill it ourselves to be sure that it won't lock console when killed by our init exit 0; @@ -425,8 +419,8 @@ unplug it, remove write protection, and then plug it again.")), close F; unlink '/home/.touched'; - my $_wait = $using_existing_host_config - || $o->wait_message(N("Setting up USB key"), N("Please wait, setting up system configuration files on USB key...")); + my $wait = $using_existing_host_config + || $o->wait_message(N("Setting up USB key"), N("Please wait, setting up system configuration files on USB key...")); key_installfiles('full'); setup_userconf($o); @@ -458,7 +452,7 @@ sub install2::configMove { $::noauto and goto after_autoconf; - my $_wait = $o->wait_message(N("Auto configuration"), N("Please wait, detecting and configuring devices...")); + my $wait = $o->wait_message(N("Auto configuration"), N("Please wait, detecting and configuring devices...")); #- automatic printer, timezone, network configs require install_steps_interactive; @@ -476,7 +470,7 @@ sub install2::configMove { after_autoconf: require timezone; - timezone::write($o->{timezone}); + timezone::write($o->{prefix}, $o->{timezone}); $o->{useSupermount} = 1; fs::set_removable_mntpoints($o->{all_hds}); @@ -485,7 +479,7 @@ after_autoconf: require install_any; install_any::write_fstab($o); - modules::write_conf(); + modules::write_conf(''); require mouse; mouse::write_conf($o, $o->{mouse}, 1); #- write xfree mouse conf detect_devices::install_addons(''); @@ -642,7 +636,7 @@ sub install2::startMove { if (cat_('/proc/mounts') =~ m|\s/home\s|) { output '/var/lib/machine_ident', machine_ident(); run_program::run('/usr/bin/etc-monitorer.pl', uniq map { dirname($_) } (chomp_(`find /etc -type f`), - grep { readlink($_) !~ m|^/| } chomp_(`find /etc -type l`))); + grep { readlink !~ m|^/| } chomp_(`find /etc -type l`))); run_program::raw({ detach => 1 }, '/usr/bin/dnotify', '-MCRD', '/etc', '-r', '-e', '/usr/bin/etc-monitorer.pl', '{}') or die "dnotify not found!"; } @@ -656,8 +650,8 @@ sub install2::startMove { sleep 1; log::l("DrakX waves bye-bye"); - open STDOUT, ">>/tmp/.kde-errors"; #- don't display startkde shit on first console - open STDERR, ">>/tmp/.kde-errors"; + open STDOUT, ">/dev/tty10"; #- don't display startkde shit on first console + open STDERR, ">/dev/tty10"; my (undef, undef, $uid, $gid, undef, undef, undef, $home, $shell) = getpwnam($username); $( = $) = "$gid $gid"; @@ -668,7 +662,7 @@ sub install2::startMove { $ENV{XDM_MANAGED} = '/var/run/rebootctl,maysd,mayfn,sched'; #- for reboot/halt availability of "logout" by kde $ENV{GDMSESSION} = 1; #- disable ~/.xsession-errors in Xsession (waste of usb key writes) $ENV{LD_LIBRARY_PATH} = "$home/lib"; - chdir $home; + chdir; exec 'startkde_move'; } else { exec 'xwait', '-permanent' or c::_exit(0); @@ -692,13 +686,11 @@ sub automatic_xconf { require class_discard; Xconfig::main::configure_everything_auto_install($o->{raw_X}, class_discard->new, {}, { allowNVIDIA_rpms => sub { [] }, allowATI_rpms => sub { [] }, allowFB => $o->{allowFB} }); + + my $card = Xconfig::card::from_raw_X($o->{raw_X}); } - modules::load_category('various/agpgart'); - - my $file = '/etc/X11/XF86Config'; - $file = "$file-4" if -e "$file-4"; - my ($Driver) = cat_($file) =~ /Section "Device".*Driver\s*"(.*?)"/s; + my ($Driver) = cat_('/etc/X11/XF86Config-4') =~ /Section "Device".*Driver\s*"(.*?)"/s; if ($Driver eq 'nvidia') { modules::load('nvidia'); lomount_clp('nvidia', '/usr/lib/libGLcore.so.1'); -- cgit v1.2.1