From: Mate Kukri <mate.kukri@canonical.com>
To: grub-devel@gnu.org
Cc: Mate Kukri <mate.kukri@canonical.com>
Subject: [PATCH] grub-install: Move platdir path canonicalization after files were copied to grubdir
Date: Fri, 8 Dec 2023 16:57:55 +0000 [thread overview]
Message-ID: <20231208165754.656797-1-mate.kukri@canonical.com> (raw)
The previous grub-install patch delaying the copying of files caused a
regression when installing without an existing directory structure.
This patch ensures that the platform directory actually exists by the
time the code tries to canonicalize its filename.
Signed-off-by: Mate Kukri <mate.kukri@canonical.com>
---
util/grub-install.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/util/grub-install.c b/util/grub-install.c
index 9feb4ea9e..7dc5657bb 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -1366,18 +1366,6 @@ main (int argc, char *argv[])
relative_grubdir = xstrdup ("/");
}
- char *platname = grub_install_get_platform_name (platform);
- char *platdir;
- {
- char *t = grub_util_path_concat (2, grubdir,
- platname);
- platdir = grub_canonicalize_file_name (t);
- if (!platdir)
- grub_util_error (_("failed to get canonical path of `%s'"),
- t);
- free (t);
- }
-
char *prefix_drive = NULL;
char *install_drive = NULL;
@@ -1408,6 +1396,18 @@ main (int argc, char *argv[])
if (!grub_util_is_regular (envfile))
grub_util_create_envblk_file (envfile);
+ char *platname = grub_install_get_platform_name (platform);
+ char *platdir;
+ {
+ char *t = grub_util_path_concat (2, grubdir,
+ platname);
+ platdir = grub_canonicalize_file_name (t);
+ if (!platdir)
+ grub_util_error (_("failed to get canonical path of `%s'"),
+ t);
+ free (t);
+ }
+
load_cfg = grub_util_path_concat (2, platdir,
"load.cfg");
--
2.39.2
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next reply other threads:[~2023-12-08 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 16:57 Mate Kukri [this message]
2023-12-11 16:18 ` [PATCH] grub-install: Move platdir path canonicalization after files were copied to grubdir Daniel Kiper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231208165754.656797-1-mate.kukri@canonical.com \
--to=mate.kukri@canonical.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).