grub-install: Move platdir path canonicalization after files were copied to grubdir
PATCH 1/1 grub-install: Move platdir path canonicalization after files were copied to grubdir
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 <[email protected]>
--- util/grub-install.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
util/grub-install.c +12 -12
@@ -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" );
Signature · 7 lines
2.39.2 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 7 lines · Mate Kukri
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 <[email protected]>
Reviewed-by Daniel Kiper <[email protected]>
Daniel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel