|
|
6b3c76 |
From d98c0be0194a7c0d618b87293f5fc926c09ee611 Mon Sep 17 00:00:00 2001
|
|
|
a85e8e |
From: Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
a85e8e |
Date: Sat, 25 Jan 2014 19:54:51 +0400
|
|
|
6b3c76 |
Subject: [PATCH 044/261] do not set default prefix in grub-mkimage
|
|
|
a85e8e |
|
|
|
a85e8e |
Default prefix is likely wrong on Unix and completely wrong on Windows.
|
|
|
a85e8e |
Let caller set it explicitly to avoid any ambiguity.
|
|
|
a85e8e |
---
|
|
|
d41074 |
ChangeLog | 4 ++++
|
|
|
6b3c76 |
util/grub-mkimage.c | 16 +++++++++++-----
|
|
|
a85e8e |
2 files changed, 15 insertions(+), 5 deletions(-)
|
|
|
a85e8e |
|
|
|
6b3c76 |
diff --git a/ChangeLog b/ChangeLog
|
|
|
6b3c76 |
index e149d8ef3..b405b7ee5 100644
|
|
|
6b3c76 |
--- a/ChangeLog
|
|
|
6b3c76 |
+++ b/ChangeLog
|
|
|
6b3c76 |
@@ -1,3 +1,7 @@
|
|
|
6b3c76 |
+2014-01-25 Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
6b3c76 |
+
|
|
|
6b3c76 |
+ * util/grub-mkimage.c: Make prefix argument mandatory.
|
|
|
6b3c76 |
+
|
|
|
6b3c76 |
2014-01-24 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
6b3c76 |
|
|
|
6b3c76 |
Fix several translatable strings.
|
|
|
a85e8e |
diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c
|
|
|
6b3c76 |
index a2bd4c196..1e0bcf1bf 100644
|
|
|
a85e8e |
--- a/util/grub-mkimage.c
|
|
|
a85e8e |
+++ b/util/grub-mkimage.c
|
|
|
a85e8e |
@@ -64,7 +64,7 @@ static struct argp_option options[] = {
|
|
|
a85e8e |
{"directory", 'd', N_("DIR"), 0,
|
|
|
a85e8e |
/* TRANSLATORS: platform here isn't identifier. It can be translated. */
|
|
|
a85e8e |
N_("use images and modules under DIR [default=%s/<platform>]"), 0},
|
|
|
a85e8e |
- {"prefix", 'p', N_("DIR"), 0, N_("set prefix directory [default=%s]"), 0},
|
|
|
a85e8e |
+ {"prefix", 'p', N_("DIR"), 0, N_("set prefix directory"), 0},
|
|
|
a85e8e |
{"memdisk", 'm', N_("FILE"), 0,
|
|
|
a85e8e |
/* TRANSLATORS: "memdisk" here isn't an identifier, it can be translated.
|
|
|
a85e8e |
"embed" is a verb (command description). "*/
|
|
|
a85e8e |
@@ -93,8 +93,6 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused)))
|
|
|
a85e8e |
{
|
|
|
a85e8e |
case 'd':
|
|
|
a85e8e |
return xasprintf (text, grub_util_get_pkglibdir ());
|
|
|
a85e8e |
- case 'p':
|
|
|
a85e8e |
- return xasprintf (text, DEFAULT_DIRECTORY);
|
|
|
a85e8e |
case 'O':
|
|
|
a85e8e |
{
|
|
|
a85e8e |
char *formats = grub_install_get_image_targets_string (), *ret;
|
|
|
a85e8e |
@@ -268,6 +266,15 @@ main (int argc, char *argv[])
|
|
|
a85e8e |
exit(1);
|
|
|
a85e8e |
}
|
|
|
a85e8e |
|
|
|
a85e8e |
+ if (!arguments.prefix)
|
|
|
a85e8e |
+ {
|
|
|
a85e8e |
+ char *program = xstrdup(program_name);
|
|
|
a85e8e |
+ printf ("%s\n", _("Prefix not specified (use the -p option)."));
|
|
|
a85e8e |
+ argp_help (&argp, stderr, ARGP_HELP_STD_USAGE, program);
|
|
|
a85e8e |
+ free (program);
|
|
|
a85e8e |
+ exit(1);
|
|
|
a85e8e |
+ }
|
|
|
a85e8e |
+
|
|
|
a85e8e |
if (arguments.output)
|
|
|
a85e8e |
{
|
|
|
a85e8e |
fp = grub_util_fopen (arguments.output, "wb");
|
|
|
a85e8e |
@@ -287,8 +294,7 @@ main (int argc, char *argv[])
|
|
|
a85e8e |
strcpy (ptr, dn);
|
|
|
a85e8e |
}
|
|
|
a85e8e |
|
|
|
a85e8e |
- grub_install_generate_image (arguments.dir,
|
|
|
a85e8e |
- arguments.prefix ? : DEFAULT_DIRECTORY, fp,
|
|
|
a85e8e |
+ grub_install_generate_image (arguments.dir, arguments.prefix, fp,
|
|
|
a85e8e |
arguments.output, arguments.modules,
|
|
|
a85e8e |
arguments.memdisk, arguments.pubkeys,
|
|
|
a85e8e |
arguments.npubkeys, arguments.config,
|
|
|
6b3c76 |
--
|
|
|
6b3c76 |
2.13.5
|
|
|
6b3c76 |
|