From 1bf914e86184b84d02465f8bb04747a7edd1517c Mon Sep 17 00:00:00 2001
From: Thierry Vignaud <thierry.vignaud@gmail.com>
Date: Fri, 3 Apr 2015 18:29:19 +0200
Subject: grub2-install output too (mga#15439)

---
 perl-install/NEWS          | 2 ++
 perl-install/bootloader.pm | 5 ++++-
 perl-install/install/NEWS  | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

(limited to 'perl-install')

diff --git a/perl-install/NEWS b/perl-install/NEWS
index b99fcd634..67f6cabec 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,5 @@
+- drakboot:
+  o log grub2-install failures (mga#15439)
 - diskdrake:
   o really try to detect recovery partitions on GPT
 
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index d85a02d39..75990bf40 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1974,7 +1974,10 @@ sub install_raw_grub2 {
     my $error;
     # if (member($boot, map { "/dev/$_->{device}" } @{$all_hds->{hds}}) {
     my @options = $boot =~ /\d$/ ? ('--grub-setup=/bin/true', $boot) : $boot;
-    run_program::rooted($::prefix, 'grub2-install', '2>', \$error, '--grub-setup=/bin/true', @options) or die "grub2-install failed: $error";
+    if (!run_program::rooted($::prefix, 'grub2-install', '2>', \$error, '--grub-setup=/bin/true', @options)) {
+	log::explanations("grub2-install failed:\n(grub2-install @options)\nError: <$error>");
+	die "grub2-install failed: $error";
+    }
     setVarsInSh("$::prefix/boot/grub2/drakboot.conf", { boot => $boot });
 }
 
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 367ed1d6b..3c4c7c43b 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,5 @@
+- bootloader config:
+  o log grub2-install failures (mga#15439)
 - partitionning:
   o log fdisk -l output before/after partitionning
   o really try to detect recovery partitions on GPT
-- 
cgit v1.2.1