summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2010-02-10 16:58:23 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2010-02-10 16:58:23 +0000
commit5262467c1206558e55d891c49b9e6c643fb47c6a (patch)
treefddcff72e6c6a7413f80faebded85c2f51ce34cd
parente725c284becc41ffddc8b0187cbc7834d1f338df (diff)
downloaddrakx-5262467c1206558e55d891c49b9e6c643fb47c6a.tar
drakx-5262467c1206558e55d891c49b9e6c643fb47c6a.tar.gz
drakx-5262467c1206558e55d891c49b9e6c643fb47c6a.tar.bz2
drakx-5262467c1206558e55d891c49b9e6c643fb47c6a.tar.xz
drakx-5262467c1206558e55d891c49b9e6c643fb47c6a.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 c7944a377..84bca9173 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1676,7 +1676,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)) {