summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2010-02-10 16:59:13 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2010-02-10 16:59:13 +0000
commita5976d2b12ad70dc97b2918b6b985f70b3d012c1 (patch)
tree6b5aefc4c3e0f6c76c4792b8eb451f8ff2c6d9e9
parentefa7674024d31b5a5350c6dc7daf9c865d2e600b (diff)
downloaddrakx-a5976d2b12ad70dc97b2918b6b985f70b3d012c1.tar
drakx-a5976d2b12ad70dc97b2918b6b985f70b3d012c1.tar.gz
drakx-a5976d2b12ad70dc97b2918b6b985f70b3d012c1.tar.bz2
drakx-a5976d2b12ad70dc97b2918b6b985f70b3d012c1.tar.xz
drakx-a5976d2b12ad70dc97b2918b6b985f70b3d012c1.zip
fix generation of grub md5 password on 64 bit installs
we can't directly run grub-md5-crypt in 64 bit installs since it will run grub which is a 32 bit binary, and the install root fs doesn't have 32 bit user-land support. chroot into the target system if ::prefix is set to have proper 32 bit support if needed.
-rw-r--r--perl-install/bootloader.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index d6078ec35..c81cd6c17 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1636,7 +1636,9 @@ sub crypt_grub_password {
require IPC::Open2;
local $ENV{LC_ALL} = 'C';
my ($his_out, $his_in);
- my $pid = IPC::Open2::open2($his_out, $his_in, "$::prefix/sbin/grub-md5-crypt", $::prefix ? "--grub-shell=$::prefix/sbin/grub" : ());
+ my $cmd = ($::prefix ? "chroot $::prefix " : "") . "/sbin/grub-md5-crypt";
+
+ my $pid = IPC::Open2::open2($his_out, $his_in, $cmd);
my ($line, $res);
while (sysread($his_out, $line, 100)) {