summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/Makefile4
-rw-r--r--perl-install/Xconfig.pm17
-rw-r--r--perl-install/Xconfigurator.pm9
-rw-r--r--perl-install/commands.pm68
-rw-r--r--perl-install/install2.pm2
-rw-r--r--perl-install/install_any.pm2
-rw-r--r--perl-install/install_steps.pm10
-rw-r--r--perl-install/install_steps_interactive.pm2
-rw-r--r--perl-install/keyboard.pm2
-rw-r--r--perl-install/share/install.rc8
-rw-r--r--perl-install/share/list1
11 files changed, 83 insertions, 42 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile
index b9d66b7a1..b434dfbc2 100644
--- a/perl-install/Makefile
+++ b/perl-install/Makefile
@@ -9,7 +9,7 @@ BASE = $(ROOTDEST)/Mandrake/base
DESTREP4PMS = $(DEST)/usr/bin/perl-install
STAGE2TMP = /tmp/stage2_tmp
PERL = perl
-LOCALFILES = $(PERL) mouseconfig
+LOCALFILES = $(PERL) mouseconfig ddcxinfo
DIRS = po pci_probing
EXCLUDE = $(LOCALFILES) boot.img keymaps consolefonts install
RPMS = $(wildcard $(ROOTDEST)/Mandrake/RPMS/*.rpm)
@@ -178,7 +178,7 @@ stage2:
rm $(STAGE2TMP)/usr/X11R6/bin/XF86_SVGA
for i in /usr/share/locale /usr/share/keymaps /usr/share/xmodmap; do \
name=`basename $$i` ; \
- (cd $(STAGE2TMP)/$$i ; find * | cpio --quiet -o 2>/dev/null | bzip2 > ../$$name.cpio.bz2 ; rm -rf $$name) \
+ (cd $(STAGE2TMP)/$$i ; find * | cpio -o 2>/dev/null | bzip2 > ../$$name.cpio.bz2 ; cd .. ; rm -rf $$name) \
done
$(SUDO) cp -a $(STAGE2TMP)/* /mnt/stage2
$(SUDO) rm -rf $(STAGE2TMP)
diff --git a/perl-install/Xconfig.pm b/perl-install/Xconfig.pm
index 2e93b5679..e22168377 100644
--- a/perl-install/Xconfig.pm
+++ b/perl-install/Xconfig.pm
@@ -18,7 +18,8 @@ sub keymap_translate {
sub getinfo {
my $o = {};
- getinfoFromXF86Config($o);
+# getinfoFromXF86Config($o);
+ getinfoFromDDC($o);
getinfoFromSysconfig($o);
$o-> my @all_values = map { @{ $_->$field }
+ $o;
+}
my (@unique, %duplicates, %duplicate_count, %seen); foreach my $value (@all_values) { my $lc_name = lc($value->name); if ($seen{$lc_name}) { $duplicate_count{$seen{$lc_name}->id}++; $duplicates{$value->id} = $seen{$lc_name}; next; } push(@unique, $value); $seen{$lc_name} = $value; } $field =~ s/s$//; if ($field eq 'version') { @unique = sort { vers_cmp(lc($a->name), lc($b->name)) } @unique; } else { @unique = sort { lc($a->name) cmp lc($b->name) } @unique; } $field = 'target_milestone' if $field eq 'milestone'; $vars->{duplicates}->{$field} = \%duplicates; $vars->{duplicate_count}->{$field} = \%duplicate_count; # "component" is a reserved word in Template Toolkit. $field = 'component_' if $field eq 'component'; $vars->{$field} = \@unique; } ############### # Main Script # ############### my $cgi = Bugzilla->cgi; my $dbh = Bugzilla->dbh; my $template = Bugzilla->template; my $vars = {}; my $buffer = $cgi->query_string(); first(cat_("/proc/uptime"));
my $hertz = 100;
- format STDOUT_TOP =
+ open PS, ">&STDOUT";
+ format PS_TOP =
PID CMD
.
- format =
+ format PS =
@>>>> @>>> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$pid, $cpu, $cmd
.
-
foreach $pid (sort {$a <=> $b} grep { /\d+/ } all('/proc')) {
my @l = split(' ', cat_("/proc/$pid/stat"));
$cpu = sprintf "%2.1f", max(0, min(99, ($l[13] + $l[14]) * 100 / $hertz / ($uptime - $l[21] / $hertz)));
(($cmd) = cat_("/proc/$pid/cmdline")) =~ s/\0/ /g;
$cmd ||= (split ' ', (cat_("/proc/$pid/stat"))[0])[1];
- write;
+ write PS;
}
}
@@ -397,11 +389,11 @@ sub insmod {
}
sub route {
- @ARGV and die "usage: route\nsorry, no modification handled\n";
+ @_ == 0 or die "usage: route\nsorry, no modification handled\n";
my ($titles, @l) = cat_("/proc/net/route");
my @titles = split ' ', $titles;
my %l;
- local *ROUTE = *STDOUT;
+ open ROUTE, ">&STDOUT";
format ROUTE_TOP =
Destination Gateway Mask Iface
.
@@ -418,3 +410,37 @@ $l{Destination}, $l{Gateway}, $l{Mask}, $l{Iface}
write ROUTE;
}
}
+
+sub df {
+ my ($h) = getopts(\@_, qw(h));
+ my ($dev, $size, $free, $used, $use, $mntpoint);
+ open DF, ">&STDOUT";
+ format DF_TOP =
+Filesystem Size Used Avail Use Mounted on
+.
+ format DF =
+@<<<<<<<<<<<<<<<< @>>>>>>> @>>>>>>> @>>>>>>> @>>>>>% @<<<<<<<<<<<<<<<<<<<<<<<<<
+$dev, $size, $used, $free, $use, $mntpoint
+.
+ my %h;
+ foreach (cat_("/proc/mounts"), cat_("/etc/mtab")) {
+ ($dev, $mntpoint) = split;
+ $h{$dev} = $mntpoint;
+ }
+ foreach $dev (sort keys %h) {
+ $mntpoint = $h{$dev};
+ my $buf = ' ' x 20000;
+ syscall_('statfs', $mntpoint, $buf) or next;
+ (undef, undef, $size, $free) = unpack "l7", $buf;
+ $size or next;
+
+ $use = int (100 * ($size - $free) / $size);
+ $used = $size - $free;
+ if ($h) {
+ $used = int ($used / 1024) . "M";
+ $size = int ($size / 1024) . "M";
+ $free = int ($free / 1024) . "M";
+ }
+ write DF if $size;
+ }
+}
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 45340f8e9..e43b47ded 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -576,8 +576,8 @@ sub main {
#-the main cycle
my $clicked = 0;
MAIN: for ($o->{step} = $o->{steps}{first};; $o->{step} = getNextStep()) {
- $o->enteringStep($o->{step});
$o->{steps}{$o->{step}}{entered}++;
+ $o->enteringStep($o->{step});
eval {
&{$install2::{$o->{step}}}($clicked, $o->{steps}{$o->{step}}{entered});
};
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 4c96920a0..0820eb24e 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -138,6 +138,6 @@ sub install_cpio {
eval { commands::rm "-r", $dir };
mkdir $dir, 0755;
- run_program::run("cd $dir ; bzip2 -cd $cpio | cpio -i $name");
+ run_program::run("cd $dir ; bzip2 -cd $cpio | cpio -id $name $name/*");
"$dir/$name";
}
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index cf3df79dc..584bf1fb3 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -163,16 +163,14 @@ sub mouseConfig($) {
sub configureNetwork($) {
my ($o) = @_;
my $etc = "$o->{prefix}/etc";
-#
-# rc = checkNetConfig(&$o->{intf}, &$o->{netc}, &$o->{intfFinal},
-# &$o->{netcFinal}, &$o->{driversLoaded}, $o->{direction});
+
network::write_conf("$etc/sysconfig/network", $o->{netc});
network::write_resolv_conf("$etc/resolv.conf", $o->{netc});
network::write_interface_conf("$etc/sysconfig/network-scripts/ifcfg-$_->{DEVICE}", $_) foreach @{$o->{intf}};
network::add2hosts("$etc/hosts", $o->{netc}{HOSTNAME}, map { $_->{IPADDR} } @{$o->{intf}});
network::sethostname($o->{netc}) unless $::testing;
network::addDefaultRoute($o->{netc}) unless $::testing;
- #-res_init(); # reinit the resolver so DNS changes take affect
+ #-res_init(); #- reinit the resolver so DNS changes take affect
}
#------------------------------------------------------------------------------
@@ -180,7 +178,9 @@ sub timeConfig {
my ($o, $f) = @_;
my $t = $o->{timezone};
- setVarsInSh($f, {
+ eval { commands::cp("-f", "/usr/share/zoneinfo/$t->{timezone}", "/etc/localtime") };
+ $@ and log::l("installing /etc/localtime failed");
+ setVarsInSh($f, {
ZONE => $t->{timezone},
GMT => bool2text($t->{GMT}),
ARC => "false",
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 296441bb9..4bb7e6aab 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -458,7 +458,7 @@ sub addUser($) {
},
complete => sub {
$u->{password} eq $u->{password2} or $o->ask_warn('', [ _("You must enter the same password"), _("Please try again") ]), return (1,3);
- (length $u->{password} < 6) and $o->ask_warn('', _("This password is too simple")), return (1,2);
+ #(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);
return 0;
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index fdd821465..44a9fc32a 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -119,7 +119,7 @@ sub setup($) {
if (my $file = install_any::install_cpio("/usr/share/keymaps", "$o->[1].kmap")) {
log::l("loading keymap $o->[1]");
- load(cat_($file));
+ load(cat_($file)) if -e $file;
}
if (my $file = install_any::install_cpio("/usr/share/xmodmap", "xmodmap.$o->[2]")) {
eval { run_program::run('xmodmap', $file) } unless $::testing;
diff --git a/perl-install/share/install.rc b/perl-install/share/install.rc
index c55e37a71..b9a32a2e1 100644
--- a/perl-install/share/install.rc
+++ b/perl-install/share/install.rc
@@ -1,8 +1,8 @@
style "default-font"
{
fontset = "\
--*-arial-medium-r-normal-*-*-120-*-*-*-*-*-*,\
--*-helvetica-medium-r-normal-*-*-120-*-*-*-*-*-*,\
+-*-arial-medium-r-normal-*-*-100-*-*-*-*-*-*,\
+-*-helvetica-medium-r-normal-*-*-100-*-*-*-*-*-*,\
-*-tahoma-medium-r-normal-*-*-*-*-*-*-*-*-*,\
-*-*-medium-r-normal-*-*-*-*-*-*-*-jisx0208.1990-0,\
-*-*-medium-r-normal-*-*-*-*-*-*-*-jisx0208.1983-0,\
@@ -23,8 +23,8 @@ style "steps"
fg[NORMAL] = { 1.0, 1.0, 1.0 }
fontset = "\
--*-arial-medium-r-normal-*-*-100-*-*-*-*-*-*,\
--*-helvetica-medium-r-normal-*-*-100-*-*-*-*-*-*,\
+-*-arial-medium-r-normal-*-*-80-*-*-*-*-*-*,\
+-*-helvetica-medium-r-normal-*-*-80-*-*-*-*-*-*,\
-*-tahoma-medium-r-normal-*-*-*-*-*-*-*-*-*,\
-*-*-medium-r-normal-*-*-*-*-*-*-*-jisx0208.1990-0,\
-*-*-medium-r-normal-*-*-*-*-*-*-*-jisx0208.1983-0,\
diff --git a/perl-install/share/list b/perl-install/share/list
index beffbce8f..01750371f 100644
--- a/perl-install/share/list
+++ b/perl-install/share/list
@@ -77,7 +77,6 @@
/usr/X11R6/lib/X11/fonts/misc/fonts.alias
/usr/X11R6/lib/X11/fonts/misc/6x13.pcf.gz
/usr/X11R6/lib/X11/fonts/misc/cursor.pcf.gz
-/usr/X11R6/lib/X11/fonts/misc/jiskan16.pcf.gz
/usr/X11R6/lib/X11/fonts/misc/7x14rk.pcf.gz
/usr/share/fonts/ISO8859-9/75dpi/fonts.dir
/usr/share/fonts/ISO8859-9/75dpi/fonts.alias