summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-03-12 15:18:34 +0000
committerFrancois Pons <fpons@mandriva.com>2001-03-12 15:18:34 +0000
commit18a5572ee8e3850f1d1f928d43d2e1799594dbd9 (patch)
treea8d7ff802b09c27d3cf3d169167fb4371836cba9 /perl-install
parentece757a4920eb93a5eef727f710094c65b767118 (diff)
downloaddrakx-backup-do-not-use-18a5572ee8e3850f1d1f928d43d2e1799594dbd9.tar
drakx-backup-do-not-use-18a5572ee8e3850f1d1f928d43d2e1799594dbd9.tar.gz
drakx-backup-do-not-use-18a5572ee8e3850f1d1f928d43d2e1799594dbd9.tar.bz2
drakx-backup-do-not-use-18a5572ee8e3850f1d1f928d43d2e1799594dbd9.tar.xz
drakx-backup-do-not-use-18a5572ee8e3850f1d1f928d43d2e1799594dbd9.zip
fixed live update between GLIBC 2.1 and GLIBC 2.2. should work for other
combination but not tested. fixed locale usage and gtk environment interaction (added LOCPATH, GCONV_PATH and GTK_EXE_PREFIX). created LD_LOADER environment variable to keep track of right ELF loader to be used for the GLIBC used by the live update. added internal PATH to LD_LIBRARY_PATH as ELF loader only check this one and not PATH.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/commands.pm8
-rw-r--r--perl-install/detect_devices.pm4
-rw-r--r--perl-install/lang.pm2
-rwxr-xr-xperl-install/live_install222
-rw-r--r--perl-install/modules.pm5
-rw-r--r--perl-install/pkgs.pm2
6 files changed, 30 insertions, 13 deletions
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index fb905aaf5..ffdc306a7 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -438,7 +438,7 @@ sub insmod {
};
#run_program::run("packdrake -x $cz /tmp $_.o");
} elsif (-e "/lib/modules.cpio.bz2") {
- run_program::run("cd /tmp ; bzip2 -cd /lib/modules.cpio.bz2 | cpio -i $_.o");
+ run_program::run("cd /tmp ; $ENV{LD_LOADER} bzip2 -cd /lib/modules.cpio.bz2 | $ENV{LD_LOADER} cpio -i $_.o");
} else {
die "unable to find an archive for modules";
}
@@ -564,7 +564,7 @@ sub install_cpio($$;@) {
require run_program;
my $more = join " ", map { $_ && "$_ $_/*" } @more;
- run_program::run("cd $dir ; bzip2 -cd $cpio | cpio -id $name $name/* $more");
+ run_program::run("cd $dir ; $ENV{LD_LOADER} bzip2 -cd $cpio | $ENV{LD_LOADER} cpio -id $name $name/* $more");
"$dir/$name";
}
@@ -579,7 +579,7 @@ sub report_bug {
join '', map { chomp; "$_\n" }
header("lspci"), detect_devices::stringlist(),
header("pci_devices"), cat_("/proc/bus/pci/devices"),
- header("fdisk"), arch() =~ /ppc/ ? `pdisk -l` : `fdisk -l`,
+ header("fdisk"), arch() =~ /ppc/ ? `$ENV{LD_LOADER} pdisk -l` : `$ENV{LD_LOADER} fdisk -l`,
header("scsi"), cat_("/proc/scsi/scsi"),
header("lsmod"), cat_("/proc/modules"),
header("cmdline"), cat_("/proc/cmdline"),
@@ -588,7 +588,7 @@ sub report_bug {
header("partitions"), cat_("/proc/partitions"),
header("cpuinfo"), cat_("/proc/cpuinfo"),
header("syslog"), cat_("/tmp/syslog"),
- header("ddcxinfos"), `ddcxinfos`,
+ header("ddcxinfos"), `$ENV{LD_LOADER} ddcxinfos`,
header("ddebug.log"), cat_("/tmp/ddebug.log"),
header("install.log"), cat_("/mnt/root/install.log"),
;
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index d96e438d1..e0e95f465 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -243,7 +243,7 @@ sub tryWrite($) {
sub syslog {
-r "/tmp/syslog" and return map { /<\d+>(.*)/ } cat_("/tmp/syslog");
- `dmesg`;
+ `/bin/dmesg`;
}
sub hasSMP { c::detectSMP() }
@@ -328,7 +328,7 @@ sub probeSerialDevices {
print STDERR "Please wait while probing serial ports...\n";
#- start probing all serial ports... really faster than before ...
#- ... but still take some time :-)
- local *F; open F, "serial_probe 2>/dev/null |";
+ local *F; open F, "$ENV{LD_LOADER} serial_probe 2>/dev/null |";
local $_;
my %current = (); while (<F>) {
$serialprobe{$current{DEVICE}} = { %current } and %current = () if /^\s*$/ && $current{DEVICE};
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index e6cd1220b..76dea427c 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -388,7 +388,7 @@ sub load_po {
unless ($f && -e $f) {
-e ($f = "$_/po/$lang.po.bz2") and last foreach @INC;
if (-e $f) {
- open F, "bzip2 -dc $f 2>/dev/null |";
+ open F, "$ENV{LD_LOADER} bzip2 -dc $f 2>/dev/null |";
} else {
-e ($f = "$_/po.cz2") and last foreach @INC;
log::l("trying to load $lang.po from $f");
diff --git a/perl-install/live_install2 b/perl-install/live_install2
index 6c0cb9ef5..6e4486e48 100755
--- a/perl-install/live_install2
+++ b/perl-install/live_install2
@@ -4,14 +4,30 @@ my $dir = `pwd`;
chomp $dir;
$dir .= "/../../..";
+#- keep it mind the ELF loader to use.
+$ENV{LD_LOADER} = "$dir/lib/ld-linux.so.2";
+
+$ENV{LOCPATH}="$dir/usr/share/locale";
+$ENV{GCONV_PATH}="$dir/usr/lib/gconv";
$ENV{PERL5LIB} = join ":", map { "$dir/$_" } @INC;
-$ENV{LD_LIBRARY_PATH} = "$dir/lib:$dir/usr/lib:$dir/usr/lib/perl5/5.6.0/i386-linux/CORE";
+$ENV{LD_LIBRARY_PATH} = "$dir/usr/bin:$dir/bin:$dir/sbin:$dir/usr/sbin:$dir/usr/X11R6/bin:$dir/lib:$dir/usr/lib:$dir/usr/lib/perl5/5.6.0/i386-linux/CORE";
$ENV{PATH} = join(":", map { "$dir/$_" } split ":", "/usr/bin:/bin:/sbin:/usr/sbin:/usr/X11R6/bin") . ":$ENV{PATH}";
$ENV{SHARE_PATH} = "$dir/usr/share";
$ENV{RPMRC_FILE} = "$dir/usr/lib/rpm/rpmrc";
+$ENV{GTK_EXE_PREFIX} = "$dir/usr";
+
+system $ENV{LD_LOADER}, "../perl", "-i", "-pe", "s,^(.*macrofiles[^/]*)(.*),\$1$dir/usr/lib/rpm/macros:\$2,", $ENV{RPMRC_FILE};
+system $ENV{LD_LOADER}, "../perl", "./install2", "--live", @ARGV;
-system "../../../lib/ld-linux.so.2", "../perl", "-i", "-pe", "s,(macrofiles:\\s*)(.*),$1$dir/usr/lib/rpm/macros:$2,", $ENV{RPMRC_FILE};
-system "../../../lib/ld-linux.so.2", "../perl", "./install2", "--live", @ARGV;
+#- at this point, unwind above else they will not run correctly (wrong ld-linux.so.2)
+delete $ENV{GTK_EXE_PREFIX};
+delete $ENV{RPMRC_FILE};
+delete $ENV{LOCPATH};
+delete $ENV{SHARE_PATH};
+delete $ENV{PATH};
+delete $ENV{LD_LIBRARY_PATH};
+delete $ENV{PERL5LIB};
+delete $ENV{LD_LOADER};
$ENV{DISPLAY} and system "xset", "-fp", "/tmp/drakx/mdkinst/usr/X11R6/lib/X11/fonts/";
foreach (qw(misc PEX Speedo Type1 mdk 75dpi 100dpi cyrillic)) {
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index ac3eea669..ee0187d04 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -425,7 +425,8 @@ sub load {
if ($::testing) {
log::l("i try to install $name module (@options)");
} elsif ($::isStandalone || $::live) {
- run_program::run("modprobe", $name, @options) or die "insmod'ing module $name failed";
+ run_program::run(-x "/sbin/modprobe.static" ? "/sbin/modprobe.static" : "/sbin/modprobe", $name, @options)
+ or die "insmod'ing module $name failed";
} else {
$conf{$name}{loaded} and return;
@@ -450,7 +451,7 @@ sub load_multi {
if ($::testing) {
log::l("i would install modules @l");
} elsif ($::isStandalone || $::live) {
- foreach (@l) { run_program::run("modprobe", $_) }
+ foreach (@l) { run_program::run(-x "/sbin/modprobe.static" ? "/sbin/modprobe.static" : "/sbin/modprobe", $_) }
} else {
load_raw(map { [ $_ ] } @l);
}
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index ba6fa0d48..c345b5f17 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -1066,7 +1066,7 @@ sub selectPackagesToUpgrade($$$;$$) {
close OUTPUT;
open STDIN, "<&INPUT_CHILD";
open STDOUT, ">&OUTPUT_CHILD";
- exec "parsehdlist", "--interactive", map { "/tmp/$_->{hdlist}" } values %{$packages->{mediums}}
+ exec if_($ENV{LD_LOADER}, $ENV{LD_LOADER}), "parsehdlist", "--interactive", map { "/tmp/$_->{hdlist}" } values %{$packages->{mediums}}
or c::_exit(1);
}