|
|
bbc6a89 |
From 9e962fd3c42081e2eef1f99a0eaab38fd04d2620 Mon Sep 17 00:00:00 2001
|
|
|
bbc6a89 |
From: Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
bbc6a89 |
Date: Mon, 7 Aug 2017 18:05:17 +0200
|
|
|
63f1a98 |
Subject: [PATCH 054/250] mkrescue: Check xorriso presence before doing
|
|
|
bbc6a89 |
anything else.
|
|
|
bbc6a89 |
|
|
|
bbc6a89 |
mkrescue can't do anything useful without xorriso, so abort early if it's
|
|
|
bbc6a89 |
not available.
|
|
|
bbc6a89 |
---
|
|
|
bbc6a89 |
util/grub-mkrescue.c | 9 ++++++++-
|
|
|
bbc6a89 |
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
|
bbc6a89 |
|
|
|
bbc6a89 |
diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c
|
|
|
ec4acbb |
index 238d4840e2f..38f1543974e 100644
|
|
|
bbc6a89 |
--- a/util/grub-mkrescue.c
|
|
|
bbc6a89 |
+++ b/util/grub-mkrescue.c
|
|
|
bbc6a89 |
@@ -323,6 +323,7 @@ check_xorriso (const char *val)
|
|
|
bbc6a89 |
char *buf = NULL;
|
|
|
bbc6a89 |
size_t len = 0;
|
|
|
bbc6a89 |
int ret = 0;
|
|
|
bbc6a89 |
+ int wstatus = 0;
|
|
|
bbc6a89 |
|
|
|
bbc6a89 |
argv[0] = xorriso;
|
|
|
bbc6a89 |
argv[1] = "-as";
|
|
|
bbc6a89 |
@@ -347,8 +348,10 @@ check_xorriso (const char *val)
|
|
|
bbc6a89 |
}
|
|
|
bbc6a89 |
|
|
|
bbc6a89 |
close (fd);
|
|
|
bbc6a89 |
- waitpid (pid, NULL, 0);
|
|
|
bbc6a89 |
+ waitpid (pid, &wstatus, 0);
|
|
|
bbc6a89 |
free (buf);
|
|
|
bbc6a89 |
+ if (!WIFEXITED (wstatus) || WEXITSTATUS(wstatus) != 0)
|
|
|
bbc6a89 |
+ return 0;
|
|
|
bbc6a89 |
return ret;
|
|
|
bbc6a89 |
}
|
|
|
bbc6a89 |
|
|
|
bbc6a89 |
@@ -478,6 +481,10 @@ main (int argc, char *argv[])
|
|
|
bbc6a89 |
if (!output_image)
|
|
|
bbc6a89 |
grub_util_error ("%s", _("output file must be specified"));
|
|
|
bbc6a89 |
|
|
|
bbc6a89 |
+ if (!check_xorriso ("graft-points")) {
|
|
|
bbc6a89 |
+ grub_util_error ("%s", _("xorriso not found"));
|
|
|
bbc6a89 |
+ }
|
|
|
bbc6a89 |
+
|
|
|
bbc6a89 |
grub_init_all ();
|
|
|
bbc6a89 |
grub_hostfs_init ();
|
|
|
bbc6a89 |
grub_host_init ();
|
|
|
bbc6a89 |
--
|
|
|
63f1a98 |
2.14.3
|
|
|
bbc6a89 |
|