diff options
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/XFdrake | 60 | ||||
-rwxr-xr-x | perl-install/standalone/adduserdrake | 73 | ||||
-rwxr-xr-x | perl-install/standalone/diskdrake | 14 | ||||
-rwxr-xr-x | perl-install/standalone/drakboot | 34 | ||||
-rwxr-xr-x | perl-install/standalone/draknet | 63 | ||||
-rwxr-xr-x | perl-install/standalone/draksec | 34 | ||||
-rwxr-xr-x | perl-install/standalone/drakxconf | 4 | ||||
-rwxr-xr-x | perl-install/standalone/drakxservices | 20 | ||||
-rw-r--r-- | perl-install/standalone/icons/findf.xpm | 57 | ||||
-rw-r--r-- | perl-install/standalone/icons/ftin.xpm | 46 | ||||
-rw-r--r-- | perl-install/standalone/icons/ftout.xpm | 46 | ||||
-rwxr-xr-x | perl-install/standalone/keyboarddrake | 17 | ||||
-rwxr-xr-x | perl-install/standalone/livedrake | 52 | ||||
-rwxr-xr-x | perl-install/standalone/mousedrake | 40 | ||||
-rwxr-xr-x | perl-install/standalone/printerdrake | 24 |
15 files changed, 290 insertions, 294 deletions
diff --git a/perl-install/standalone/XFdrake b/perl-install/standalone/XFdrake index 072f770a1..46c5b6f63 100755 --- a/perl-install/standalone/XFdrake +++ b/perl-install/standalone/XFdrake @@ -17,41 +17,43 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -use lib qw(/usr/lib/libDrakX); +use lib qw(/usr/lib/libDrakX .); -use interactive; +use common qw(:file); use Xconfigurator; use Xconfig; -use c; local $_ = join '', @ARGV; -/-h/ and die "usage: XFdrake [--xf3] [--beginner] [--expert] [--auto] [--noauto] [--skiptest] [--testing]\n"; - -my $i = {}; +/-h/ and die "usage: XFdrake [--beginner] [--expert] [--auto] [--noauto] [--skiptest] [--testing]\n"; +$::beginner = /--beginner/; +$::expert = /--expert/; +$::auto = /--auto/; +$::noauto = /--noauto/; +$::skiptest = /--skiptest/; +$::testing = /--testing/; $::isStandalone = 1; -$::force_xf3 = /-xf3/; -$::beginner = /-beginner/; -$::expert = /-expert/; -$::auto = /-auto/; -$::noauto = /-noauto/; -$::testing = /-testing/; -$i->{skiptest} = /-skiptest/; - -my $f = "/usr/X11R6/lib/X11/Cards"; --e $f or system("urpmi --auto XFree86 XFree86-75dpi-fonts"); --e $f or die "install XFree86 first!\n"; - -my $in = vnew interactive('su'); - -`pidof xfs` > 0 or system("/etc/rc.d/init.d/xfs start"); - -system("mount /proc 2>/dev/null"); # ensure /proc is mounted for pci probing - -Xconfig::getinfoFromXF86Config($i) if $0 =~ Xdrakres; -Xconfig::getinfo($i); - -Xconfigurator::main('', $i, $in, 0, -e "/etc/pcmcia", sub { system("urpmi --auto XFree86-$_[0]") }); -$in->exit(0); +my $hasX = do { `xtest`; $? == 0 }; + +my $in; if ($hasX) { + require 'interactive_gtk.pm'; + $in = interactive_gtk->new; +} else { + *log::l = undef; + *log::l = sub {}; + require 'interactive_newt.pm'; + $in = interactive_newt->new; +} + +Xconfigurator::main('', Xconfig::getinfo(), $in, +# sub { +# use install_any; +# print "Here\n"; +# my ($X) = glob_("/mnt/disk/XFree86-$_[0]-*") or die "$_[0]'s X server rpm not found"; +# pkgs::install('', [ { name => $_[0], file => $X } ], 1, 0); +# } +); + +exec 'true' if $hasX; #- workaround for perl-GTK diff --git a/perl-install/standalone/adduserdrake b/perl-install/standalone/adduserdrake index 6cd88bf32..52fbdfd68 100755 --- a/perl-install/standalone/adduserdrake +++ b/perl-install/standalone/adduserdrake @@ -4,34 +4,23 @@ use lib qw(/usr/lib/libDrakX); use common qw(:common :functional :system :file); use interactive; -use any; local $_ = join '', @ARGV; -/-h/ and die "usage: adduserdrake [--beginner] [--expert] [<users...>]\n"; +/-h/ and die "usage: adduserdrake [--beginner] [--expert]\n"; -$::beginner = /-beginner/; -$::expert = /-expert/; +$::beginner = /--beginner/; +$::expert = /--expert/; $::isStandalone = 1; +my $in = vnew interactive('su'); + my @etc_pass_fields = qw(name pw uid gid realname home shell); -my @shells = grep { -x $_ } map { "/bin/$_" } qw(bash tcsh zsh ash ksh); +my @shells = map { "/bin/$_" } qw(bash tcsh zsh ash ksh); my $isMD5 = cat_("/etc/pam.d/passwd") =~ /md5/; -my $isShadow = cat_("/etc/pam.d/passwd") =~ /shadow/; -my $security = $ENV{SECURE_LEVEL}; - - - -if (my @l = grep { ! /^-/ } @ARGV) { - addusers(map {{ name => $_, realname => $_ }} @l); - exit 0; -} - -my $in = vnew interactive('su'); -my @users; +my $security = $ENV{SECURITY_LEVEL}; new: -$u = { icon => translate('automagic') }; if ($in->ask_from_entries_refH( [ _("Add user"), _("Accept user"), _("Done") ], _("Enter a user\n%s", $users ? _("(already added %s)", join(", ", map { $_->{realname} || $_->{name} } @users)) : ''), @@ -43,8 +32,6 @@ if ($in->ask_from_entries_refH( _("Password (again)") => {val => \$u->{password2}, hidden => 1}, ), $::beginner ? () : ( _("Shell") => {val => \$u->{shell}, list => \@shells, not_edit => !$::expert} - ), $security > 3 ? () : ( - _("Icon") => {val => \$u->{icon}, list => [ map { translate($_) } @any::users ], not_edit => 1 }, ), ], focus_out => sub { @@ -53,43 +40,29 @@ if ($in->ask_from_entries_refH( } }, complete => sub { - $u->{password} eq $u->{password2} or $in->ask_warn('', [ _("The passwords do not match"), _("Please try again") ]), return (1,3); - $security > 3 && length($u->{password}) < 6 and $in->ask_warn('', _("This password is too simple")), return (1,2); - $u->{name} or $in->ask_warn('', _("Please give a user name")), return (1,0); - $u->{name} =~ /^[a-z0-9_-]+$/ or $in->ask_warn('', _("The user name must contain only lower cased letters, numbers, `-' and `_'")), return (1,0); - member($u->{name}, map { $_->{name} } @users) and $in->ask_warn('', _("This user name is already added")), return (1,0); - $u->{icon} = untranslate($u->{icon}, @any::users); + $u->{password} eq $u->{password2} or $o->ask_warn('', [ _("The passwords do not match"), _("Please try again") ]), return (1,3); + $security > 3 && length($u->{password}) < 6 and $o->ask_warn('', _("This password is too simple")), return (1,2); + $u->{name} or $o->ask_warn('', _("Please give a user name")), return (1,0); + $u->{name} =~ /^[a-z0-9_-]+$/ or $o->ask_warn('', _("The user name must contain only lower cased letters, numbers, `-' and `_'")), return (1,0); + member($u->{name}, map { $_->{name} } @users) and $o->ask_warn('', _("This user name is already added")), return (1,0); return 0; }, )) { push @users, $u; - goto new; -} - -addusers(@users); - -sub addusers { - my @u = map { $_->{name} } my @users = @_; - - foreach (@users) { - $_->{pw} = any::crypt($_->{password}, $isMD5); - $_->{shell} ||= "/bin/bash"; - } - - system("adduser $_") foreach @u; - any::addUsers('', @_); - + $u->{pw} = $isMD5 ? c::crypt_md5($u->{password}, salt(8)) : crypt($u->{password}, salt(2)); + system("adduser $u->{name}"); substInFile { - foreach my $u (@users) { - if (/^$u->{name}:/) { - chomp; - my %l; @l{@etc_pass_fields} = split ':'; - add2hash($u, \%l); - $_ = join(':', @$u{@etc_pass_fields}) . "\n"; - } + if (/^$u->{name}:/) { + chomp; + my %l; @l{@etc_pass_fields} = split ':'; + add2hash($u, \%l); + $_ = join(':', @$u{@etc_pass_fields}) . "\n"; } } "/etc/passwd"; - system("pwconv") if $isShadow; + + $u = {}; + goto new; } + $in->exit(0); diff --git a/perl-install/standalone/diskdrake b/perl-install/standalone/diskdrake index 6696f29f4..a3ffafe83 100755 --- a/perl-install/standalone/diskdrake +++ b/perl-install/standalone/diskdrake @@ -22,7 +22,7 @@ # DiskDrake is also based upon the libfdisk and the install from Red Hat Software -use lib qw(/usr/lib/libDrakX); +use lib qw(/usr/lib/libDrakX .); use common qw(:common :functional); use diskdrake; use interactive_gtk; @@ -30,15 +30,9 @@ use detect_devices; use fsedit; use fs; use log; -use c; -local $_ = join '', @ARGV; - -/-h/ and die "usage: diskdrake [--expert] [--testing]\n"; - -$::expert = /-expert/; -$::testing = /-testing/; $::isStandalone = 1; +#$::expert = 1; if ($>) { $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}"; @@ -62,11 +56,11 @@ my $hds = I'll try to go on blanking bad partitions"), $err]); }; -$SIG{__DIE__} = sub { chomp (my $m = $_[0]); log::l("ERROR: $m") }; +$SIG{__DIE__} = sub { chomp $_[0]; log::l("ERROR: $_[0]") }; my $fstab = [ fsedit::get_fstab(@$hds) ]; fs::get_mntpoints_from_fstab($fstab); fs::check_mounted($fstab); diskdrake::main($hds, {}, $in); -$in->exit(0); +exec "true"; diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot index a1c252f3c..33af4079a 100755 --- a/perl-install/standalone/drakboot +++ b/perl-install/standalone/drakboot @@ -2,7 +2,7 @@ use lib qw(/usr/lib/libDrakX); -use common qw(:common :system :file :functional); +use common qw(:system :file :functional); use interactive; use any; use lilo; @@ -12,37 +12,13 @@ use c; local $_ = join '', @ARGV; -/-h/ and die "usage: drakboot [--expert]\n"; +/-h/ and die "usage: drakboot\n"; -$::expert = /-expert/; $::isStandalone = 1; my $in = vnew interactive('su'); -my %l = ( - arch() !~ /sparc|alpha/ ? ( - _("Configure LILO/GRUB") => '', - _("Create a boot floppy") => ['/usr/X11R6/bin/drakfloppy'], - ) : (), - _("Format floppy") => [ '/usr/bin/kfloppy', '/usr/bin/gfloppy' ], -); - -while (my ($k, $v) = each %l) { - $v or next; - foreach (@$v) { - -x $_ and $l{$k} = $_, last; - } - -x $l{$k} or delete $l{$k}; -} - -if ($ENV{DISPLAY} && c::Xtest($ENV{DISPLAY})) { - my $cmd = $l{$in->ask_from_list(_("Choice"), _("What do you want to do?"), [ keys %l ])}; - exec $cmd if $cmd; -} - my $bootloader = lilo::read('', '/etc/lilo.conf'); -local ($_) = `detectloader`; -$bootloader->{methods} = { lilo => 1, grub => !!/grub/i }; my $hds = catch_cdie { fsedit::hds([ detect_devices::hds() ], {}) } sub { 1 }; my $fstab = [ fsedit::get_fstab(@$hds) ]; @@ -51,9 +27,11 @@ fs::get_mntpoints_from_fstab($fstab); ask: any::setupBootloader($in, $bootloader, $hds, $fstab, $ENV{SECURE_LEVEL}) or $in->exit(0); -eval { lilo::install('', $bootloader, $fstab, $hds) }; +eval { lilo::install('', $bootloader) }; +my $err = $@; +eval { lilo::install_grub('', $bootloader, $fstab, $hds) }; -if ($@) { +if ($err && $@) { $in->ask_warn('', [ _("Installation of LILO failed. The following error occured:"), grep { !/^Warning:/ } cat_("/tmp/.error") ]); diff --git a/perl-install/standalone/draknet b/perl-install/standalone/draknet new file mode 100755 index 000000000..d34342dec --- /dev/null +++ b/perl-install/standalone/draknet @@ -0,0 +1,63 @@ +#!/usr/bin/perl + +#- CHANGE THIS! (dam's) +# DrakFuck + +# Copyright (C) 1999 MandrakeSoft (damien@mandrakesoft.com) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +use lib ".."; #qw(/usr/lib/libDrakX); + +use interactive; +use netconnect; +#use Xconfig; +use c; + +local $_ = join '', @ARGV; + +#/-h/ and die "usage: DrakFuck[--xf3] [--beginner] [--expert] [--auto] [--noauto] [--skiptest] [--testing]\n"; + +my $i = {}; + +$::isStandalone = 1; +#$::force_xf3 = /-xf3/; +#$::beginner = /-beginner/; +#$::expert = /-expert/; +#$::auto = /-auto/; +#$::noauto = /-noauto/; +#$::testing = /-testing/; +#$i->{skiptest} = /-skiptest/; + +#my $f = "/usr/X11R6/lib/X11/Cards"; +#-e $f or system("urpmi --auto XFree86 XFree86-75dpi-fonts"); +#-e $f or die "install XFree86 first!\n"; + +my $in = vnew interactive;#('su'); + +#`pidof xfs` > 0 or system("/etc/rc.d/init.d/xfs start"); + +#system("mount /proc 2>/dev/null"); # ensure /proc is mounted for pci probing + +#Xconfig::getinfoFromXF86Config($i) if $0 =~ Xdrakres; +#Xconfig::getinfo($i); + +#Xconfigurator::main('', $i, $in, 0, -e "/etc/pcmcia", sub { system("urpmi --auto XFree86-$_[0]") }); + +#netconnect::isdn_ask('', $i, $in, -e "/etc/pcmcia"); +netconnect::isdn_detect('', $i, $in, -e "/etc/pcmcia"); +#netconnect::isdn_write_config('', $i, $in, -e "/etc/pcmcia"); + +$in->exit(0); diff --git a/perl-install/standalone/draksec b/perl-install/standalone/draksec index 8ca34947d..8877501b5 100755 --- a/perl-install/standalone/draksec +++ b/perl-install/standalone/draksec @@ -2,7 +2,7 @@ use lib qw(/usr/lib/libDrakX); -use common qw(:system :file); +use common qw(:system); use interactive; use mouse; use c; @@ -11,48 +11,24 @@ local $_ = join '', @ARGV; /-h/ and die "usage: draksec [--expert]\n"; -$::expert = /-expert/ || cat_("/etc/sysconfig/system") =~ /^TYPE="?expert/m; #" +$::expert = /--expert/; $::isStandalone = 1; my $in = vnew interactive('su'); my %m = reverse (my %l = ( - 0 => _("Welcome To Crackers"), + 0 => _("Windows(TM)"), 1 => _("Poor"), 2 => _("Low"), 3 => _("Medium"), 4 => _("High"), 5 => _("Paranoid"), )); -my %help = ( - 0 => _("This level is to be used with care. It makes your system more easy to use, -but very sensitive: it must not be used for a machine connected to others -or to the Internet. There is no password access."), - 1 => _("Password are now enabled, but use as a networked computer is still not recommended."), - 2 => _("Few improvements for this security level, the main one is that there are -more security warnings and checks."), - 3 => _("This is the standard security recommended for a computer that will be used -to connect to the Internet as a client. There are now security checks. "), - 4 => _("With this security level, the use of this system as a server becomes possible. -The security is now high enough to use the system as a server which accept -connections from many clients. "), - 5 => _("We take level 4 features, but now the system is entirely closed. -Security features are at their maximum."), -); - delete @l{0,1,5} unless $::expert; -delete @help{0,1,5} unless $::expert; -if (my $level = $in->ask_from_list('', _("Choose security level") . "\n\n" . - join('', map { "$l{$_}: $help{$_}\n\n" } keys %l), - [ values %l ], $l{$ENV{SECURE_LEVEL}})) { +if (my $level = $in->ask_from_list('', _("Choose security level"), [ values %l ], $l{$ENV{SECURE_LEVEL}})) { my $w = $in->wait_message('', _("Setting security level")); - $in->suspend; - - $ENV{LILO_PASSWORD} = ''; # make it non interactive - system "/usr/sbin/msec", $m{$level}; - - $in->resume; + system("/etc/security/msec/init.sh ". $m{$level}); } $in->exit(0); diff --git a/perl-install/standalone/drakxconf b/perl-install/standalone/drakxconf index e4e4e9bd3..f4adb9989 100755 --- a/perl-install/standalone/drakxconf +++ b/perl-install/standalone/drakxconf @@ -11,7 +11,7 @@ use c; local $_ = join '', @ARGV; -/-h/ and die "usage: drakxconf\n"; +/-h/ and die "usage: draxconf\n"; $::isStandalone = 1; @@ -20,7 +20,7 @@ my $in = vnew interactive('su'); my $choice = $in->ask_from_list("drakxconf", _("Choose the tool you want to use"), [ grep { my $prog = $_; int grep { -x "$_/$prog" } split ":", $ENV{PATH} } - qw(XFdrake adduserdrake diskdrake drakxservices keyboarddrake mousedrake netdrake printerdrake draksec drakboot) ]) or c::_exit(0); #- workaround for perl-GTK + qw(XFdrake diskdrake keyboarddrake mousedrake netdrake printerdrake ) ]) or c::_exit(0); #- workaround for perl-GTK $in->end; diff --git a/perl-install/standalone/drakxservices b/perl-install/standalone/drakxservices index 63318a031..621def75f 100755 --- a/perl-install/standalone/drakxservices +++ b/perl-install/standalone/drakxservices @@ -2,10 +2,8 @@ use lib qw(/usr/lib/libDrakX); -use common qw(:common :functional :file); +use common qw(:common :functional); use interactive; -use services; -use log; local $_ = join '', @ARGV; @@ -14,7 +12,19 @@ local $_ = join '', @ARGV; $::isStandalone = 1; my $in = vnew interactive('su'); -my $l = services::ask($in); -services::doit($in, $l) if $l; + +my @l = map { chop; $_ } `cd /etc/rc.d/init.d ; grep -l "chkconfig:" *`; +my @before = map { bool(@_ = glob("/etc/rc.d/rc*.d/*$_")) } @l; + +my $after = $in->ask_many_from_list("drakxservices", +_("Choose which services should be automatically started at boot time"), + \@l, \@before); + +mapn { + my ($name, $before, $after) = @_; + if ($before != $after) { + system("chkconfig", $after ? "--add" : "--del", $name); + } +} \@l, \@before, $after; $in->exit(0); diff --git a/perl-install/standalone/icons/findf.xpm b/perl-install/standalone/icons/findf.xpm index 792007335..91b25cee5 100644 --- a/perl-install/standalone/icons/findf.xpm +++ b/perl-install/standalone/icons/findf.xpm @@ -1,31 +1,28 @@ /* XPM */ -static char * findf_xpm[] = { -"16 22 6 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #0000FF", -"# c #BEBEFF", -"$ c #C0C0C0", -" ", -" ", -" ", -" ........... ", -".+++++++++++. ", -".++++++++@#+. ", -".+++++++++@+. ", -".++++$...$++. ", -".+++$.+++.$+. ", -".+++.+#+#+.+. ", -".+++.+@@++.+. ", -".+++.++@#+.+. ", -".+++$.+++..+. ", -".@#++$....+.. ", -".+@+++++++.+. ", -".++++++++++.+. ", -".++@#+++++++.+. ", -" ........... .+.", -" . ", -" ", -" ", -" "}; +/* Drawn by Nico Schwiring and Mark Donohoe for the K Desktop Environment */ +/* See http://www.kde.org */ +static char*kfind[]={ +"16 16 6 1", +"# c #000000", +"d c #c0c0c0", +"a c #ffffff", +"b c #0000ff", +"c c #bebeff", +". c None", +".###########....", +"#aaaaaaaaaaa#...", +"#aaaaaaaabca#...", +"#aaaaaaaaaba#...", +"#aaaad###daa#...", +"#aaad#aaa#da#...", +"#aaa#acaca#a#...", +"#aaa#abbaa#a#...", +"#aaa#aabca#a#...", +"#aaad#aaa##a#...", +"#bcaad####a##...", +"#abaaaaaaa#a#...", +"#aaaaaaaaaa#a#..", +"#aabcaaaaaaa#a#.", +".###########.#a#", +"..............#."}; + diff --git a/perl-install/standalone/icons/ftin.xpm b/perl-install/standalone/icons/ftin.xpm index d0326d3ce..e70d56d19 100644 --- a/perl-install/standalone/icons/ftin.xpm +++ b/perl-install/standalone/icons/ftin.xpm @@ -1,30 +1,24 @@ /* XPM */ -static char * ftin_xpm[] = { -"15 22 5 1", +static char * kmfolderin_xpm[] = { +/* width height num_colors chars_per_pixel */ +"15 13 5 1", +/* colors */ " c None", -". c #CD0000", -"+ c #FFFFFF", -"@ c #C0C0C0", -"# c #808080", -" ", -" ", -" ", -" ", -" ", +". c red3", +"X c white", +"o c #c0c0c0", +"O c #808080", +/* pixels */ " . . ", " ... ", -" ...++++++++", -" ...@@@@@@++", -" .......+++++#", -" .....@@@++#+", -" ++...+++++#+#", -" +@@@.@@@++#+#+", -"++++++++++#+#+ ", -"##########+#+ ", -"++++++++++#+ ", -"##########+ ", -"++++++++++ ", -" ", -" ", -" ", -" "}; +" ...XXXXXXXX", +" ...ooooooXX", +" .......XXXXXO", +" .....oooXXOX", +" XX...XXXXXOXO", +" Xooo.oooXXOXOX", +"XXXXXXXXXXOXOX ", +"OOOOOOOOOOXOX ", +"XXXXXXXXXXOX ", +"OOOOOOOOOOX ", +"XXXXXXXXXX "}; diff --git a/perl-install/standalone/icons/ftout.xpm b/perl-install/standalone/icons/ftout.xpm index b4e0135b8..db28a8e5d 100644 --- a/perl-install/standalone/icons/ftout.xpm +++ b/perl-install/standalone/icons/ftout.xpm @@ -1,30 +1,24 @@ /* XPM */ -static char * ftout_xpm[] = { -"15 22 5 1", +static char * kmfolderout_xpm[] = { +/* width height num_colors chars_per_pixel */ +"15 13 5 1", +/* colors */ " c None", -". c #00008B", -"+ c #FFFFFF", -"@ c #C0C0C0", -"# c #808080", -" ", -" ", -" ", -" ", -" ", +". c blue4", +"X c white", +"o c #c0c0c0", +"O c #808080", +/* pixels */ " . ", " ... ", -" .....+++++++", -" .......@@@@++", -" ...+++++++#", -" +...@@@@++#+", -" ++...+++++#+#", -" +@@.+.@@++#+#+", -"++++++++++#+#+ ", -"##########+#+ ", -"++++++++++#+ ", -"##########+ ", -"++++++++++ ", -" ", -" ", -" ", -" "}; +" .....XXXXXXX", +" .......ooooXX", +" ...XXXXXXXO", +" X...ooooXXOX", +" XX...XXXXXOXO", +" Xoo.X.ooXXOXOX", +"XXXXXXXXXXOXOX ", +"OOOOOOOOOOXOX ", +"XXXXXXXXXXOX ", +"OOOOOOOOOOX ", +"XXXXXXXXXX "}; diff --git a/perl-install/standalone/keyboarddrake b/perl-install/standalone/keyboarddrake index 016202c68..9bb77e6bb 100755 --- a/perl-install/standalone/keyboarddrake +++ b/perl-install/standalone/keyboarddrake @@ -7,16 +7,15 @@ use interactive; use keyboard; use Xconfigurator_consts; use common qw(:system); -use c; local $_ = join '', @ARGV; /-h/ and die "usage: keyboarddrake [--expert]\n"; -$::expert = /-expert/; +$::expert = /--expert/; $::isStandalone = 1; -my $in = vnew interactive('su'); +my $in = vnew interactive; my $keyboard = keyboard::text2keyboard( $in->ask_from_list_(_("Keyboard"), @@ -33,8 +32,6 @@ my $xkb = keyboard::keyboard2xkb($keyboard); `setxkbmap $xkb`; my $f = "/etc/X11/XF86Config"; -my $g = "/etc/X11/XF86Config-4"; - substInFile { if (/^Section "Keyboard"/ .. /^EndSection/) { s|^(\s*XkbLayout\s+).*|$1"$xkb"| @@ -43,14 +40,6 @@ substInFile { } } $f if -e $f && !$::testing; -substInFile { - if (/^Identifier "Keyboard1"/ .. /^EndSection/) { - s|^(\s*Option\s+"XkbLayout"\s+).*|$1"$xkb"| - and $_ .= join '', map { /(\S+)(.*)/; qq( Option "$1" $2\n) } @{$xkb_options{$xkb} || []}; - s,^(\s*Option\s+"(XkbVariant|XkbOptions)"\s+).*,,; # remove existing one - } -} $g if -e $g && !$::testing; - keyboard::write('', $keyboard, $isNotDelete); -$in->exit(0); +exec 'true' if ref($in) =~ /gtk/; #- workaround for perl-GTK diff --git a/perl-install/standalone/livedrake b/perl-install/standalone/livedrake new file mode 100755 index 000000000..397294543 --- /dev/null +++ b/perl-install/standalone/livedrake @@ -0,0 +1,52 @@ +#!/usr/bin/perl + +use lib qw(/usr/lib/libDrakX); + +use common qw(:common :system); +use interactive; +use mouse; +use c; + +local $_ = join '', @ARGV; + +/-h/ and die "usage: livedrake [--auto] [--testing]\n"; + +$::auto = /-auto/; +$::testing = /-testing/; +$::isStandalone = 1; + +my $in = vnew interactive('su'); + +my $cd_mntpoint = "/mnt/cdrom"; + +while (! -x "$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/live_install") { + ejectCdrom(); + $in->ask_okcancel(_("Change Cd-Rom"), +_("Please insert the Installation Cd-Rom in your drive and press Ok when done. +If you don't have it, press Cancel to avoid live upgrade."), 1) or $in->exit(0); + eval { fs::mount("/mnt/cdrom") }; +} + +if (-x "$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/live_install") { + chdir "/$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/"; + exec "./live_install"; +} + +$in->ask_warn('', _("Unable to start live upgrade !!!\n")); +$in->exit(1); + +sub unlockCdrom(;$) { + my ($cdrom) = @_; + $cdrom or cat_("/proc/mounts") =~ m|(/dev/\S+)\s+/mnt/cdrom\s| and $cdrom = $1; + $cdrom or cat_("/etc/fstab") =~ m|(/dev/\S+)\s+/mnt/cdrom\s| and $cdrom = $1; + eval { $cdrom and ioctl detect_devices::tryOpen($1), c::CDROM_LOCKDOOR(), 0 }; +} + +sub ejectCdrom(;$) { + my ($cdrom) = @_; + $cdrom or cat_("/proc/mounts") =~ m|(/dev/\S+)\s+/mnt/cdrom\s| and $cdrom = $1; + my $f = eval { $cdrom && detect_devices::tryOpen($cdrom) } or return; + getFile("XXX"); #- close still opened filehandle + eval { fs::umount("/mnt/cdrom") }; + ioctl $f, c::CDROMEJECT(), 1; +} diff --git a/perl-install/standalone/mousedrake b/perl-install/standalone/mousedrake index 2b646e334..852c5e612 100755 --- a/perl-install/standalone/mousedrake +++ b/perl-install/standalone/mousedrake @@ -5,28 +5,26 @@ use lib qw(/usr/lib/libDrakX); use common qw(:system); use interactive; use mouse; -use c; local $_ = join '', @ARGV; /-h/ and die "usage: mousedrake [--auto] [--noauto] [--testing]\n"; -$::auto = /-auto/; -$::noauto = /-noauto/; -$::testing = /-testing/; +$::auto = /--auto/; +$::noauto = /--noauto/; +$::testing = /--testing/; $::isStandalone = 1; -my $in = vnew interactive('su'); +my $in = vnew interactive; -my $mouse = eval { mouse::detect() } unless $::noauto; +my $mouse = mouse::detect() unless $::noauto; -if (!(my $name = $mouse && $mouse->{FULLNAME}) || !$::auto) { +if (!(my $name = $mouse->{FULLNAME}) || !$::auto) { $name ||= "Generic Mouse (serial)"; $name = $in->ask_from_list_('', _("What is the type of your mouse?"), [ mouse::names() ], $name); $mouse = mouse::name2mouse($name); if ($mouse->{device} eq "usbmouse") { - require pci_probing::main; my ($c) = pci_probing::main::probe("serial_usb") or die _("no serial_usb found\n"); eval { modules::load($c->[1], "serial_usb") }; } @@ -40,32 +38,14 @@ $mouse->{device} = mouse::serial_ports_names2dev( [ mouse::serial_ports_names() ])) if $mouse->{device} eq "ttyS"; mouse::write('', $mouse); -modules::write_conf('') if $mouse->{device} eq "usbmouse" && !$::testing; +modules::write_conf("/etc/conf.modules") if $mouse->{device} eq "usbmouse" && !$::testing; my $f = "/etc/X11/XF86Config"; -my $g = "/etc/X11/XF86Config-4"; - -my $zaxis = "\n ZAxisMapping 4 5" if $mouse->{nbuttons} > 3; - $zaxis .= "\n ZAxisMapping 6 7" if $mouse->{nbuttons} > 5; - $zaxis = " - Emulate3Buttons - Emulate3Timeout 50" if $mouse->{nbuttons} < 3; - substInFile { if (/^Section "Pointer"/ .. /^EndSection/) { - $_ = '' if /(ZAxisMapping|Emulate3)/; #- remove existing line - s|^(\s*Protocol\s+).*|$1"$mouse->{XMOUSETYPE}"|; - s|^(\s*Device\s+).*|$1"/dev/mouse"$zaxis|; + s|^(\s*Protocol\s+).*|$1 "$mouse->{XMOUSETYPE}"|; + s|^(\s*Device\s+).*|$1 "/dev/mouse"|; } } $f if -e $f && !$::testing; -$zaxis =~ s/(ZAxisMapping|Emulate3\w+)/Option "$1"/g; -substInFile { - if (/^Identifier "Mouse1"/ .. /^EndSection/) { - $_ = '' if /(ZAxisMapping|Emulate3)/; #- remove existing line - s|^(\s*Option\s+"Protocol"\s+).*|$1"$mouse->{XMOUSETYPE}"|; - s|^(\s*Option\s+"Device"\s+).*|$1"/dev/mouse"$zaxis|; - } -} $g if -e $g && !$::testing; - -$in->exit(0); +exec 'true' if ref($in) =~ /gtk/; #- workaround for perl-GTK diff --git a/perl-install/standalone/printerdrake b/perl-install/standalone/printerdrake index 4903e3bc4..3ccd01311 100755 --- a/perl-install/standalone/printerdrake +++ b/perl-install/standalone/printerdrake @@ -21,28 +21,22 @@ use lib qw(/usr/lib/libDrakX); use interactive; -use printer; use printerdrake; -use c; local $_ = join '', @ARGV; /-h/ and die "usage: printerdrake [--beginner] [--expert] [--auto] [--noauto] [--skiptest] [--testing]\n"; -$::beginner = /-beginner/; -$::expert = /-expert/; -$::auto = /-auto/; -$::noauto = /-noauto/; -$::skiptest = /-skiptest/; -$::testing = /-testing/; +$::beginner = /--beginner/; +$::expert = /--expert/; +$::auto = /--auto/; +$::noauto = /--noauto/; +$::skiptest = /--skiptest/; +$::testing = /--testing/; $::isStandalone = 1; -my $f = "/usr/lib/rhs/rhs-printfilters"; --e $f or system("urpmi --auto rhs-printfilters"); --e $f or die "install rhs-printfilters first!\n"; +my $in = vnew interactive; -my $in = vnew interactive('su'); +printerdrake::main('', printerdrake::getinfo(''), $in, sub { `urpmi --auto $_[0]` }); -printerdrake::main(eval { printer::getinfo('') } || {}, $in, sub { `urpmi --auto $_[0]` }); - -$in->exit(0); +exec 'true' if ref($in) =~ /gtk/; #- workaround for perl-GTK |