From: Andrey Borzenkov Subject: [PATCH] grub-mkrescue: save load.cfg in image platform directory --- util/grub-mkrescue.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c index 4511826..ed86d44 100644 --- a/util/grub-mkrescue.c +++ b/util/grub-mkrescue.c @@ -257,7 +257,9 @@ make_image_abs (enum grub_install_plat plat, grub_util_info (N_("enabling %s support ..."), mkimage_target); - load_cfg = grub_util_make_temporary_file (); + load_cfg = grub_util_path_concat (3, boot_grub, + grub_install_get_platform_name (plat), + "load.cfg"); load_cfg_f = grub_util_fopen (load_cfg, "wb"); fprintf (load_cfg_f, "search --fs-uuid --set=root %s\n", iso_uuid); @@ -273,7 +275,7 @@ make_image_abs (enum grub_install_plat plat, mkimage_target, 0); grub_install_pop_module (); grub_install_pop_module (); - grub_util_unlink (load_cfg); + free (load_cfg); } static void @@ -300,7 +302,9 @@ make_image_fwdisk_abs (enum grub_install_plat plat, grub_util_info (N_("enabling %s support ..."), mkimage_target); - load_cfg = grub_util_make_temporary_file (); + load_cfg = grub_util_path_concat (3, boot_grub, + grub_install_get_platform_name (plat), + "load.cfg"); load_cfg_f = grub_util_fopen (load_cfg, "wb"); write_part (load_cfg_f, source_dirs[plat]); @@ -310,6 +314,7 @@ make_image_fwdisk_abs (enum grub_install_plat plat, grub_install_make_image_wrap (source_dirs[plat], "()/boot/grub", output, 0, load_cfg, mkimage_target, 0); grub_install_pop_module (); + free (load_cfg); } static int @@ -572,7 +577,7 @@ main (int argc, char *argv[]) char *load_cfg; FILE *load_cfg_f; char *output = grub_util_path_concat (3, boot_grub, "i386-pc", "eltorito.img"); - load_cfg = grub_util_make_temporary_file (); + load_cfg = grub_util_path_concat (3, boot_grub, "i386-pc", "load.cfg"); grub_util_info (N_("enabling %s support ..."), "BIOS"); load_cfg_f = grub_util_fopen (load_cfg, "wb"); @@ -647,6 +652,7 @@ main (int argc, char *argv[]) } grub_install_pop_module (); grub_install_pop_module (); + free (load_cfg); } /** build multiboot core.img */ -- tg: (3bca85b..) u/load_cfg (depends on: master)