All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: bug-grub@gnu.org
Cc: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: Each grub-mkrescue run leaves a file in /tmp/
Date: Mon, 28 Dec 2015 06:40:13 +0300	[thread overview]
Message-ID: <5680AF1D.80905@gmail.com> (raw)
In-Reply-To: <21871572876213560699@scdbackup.webframe.org>

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

27.12.2015 23:48, Thomas Schmitt пишет:
> Hi,
> 
> when running grub-mkrescue from Debian Sid, i get a
> growing collection of files in /tmp. One per run.
> 
> Names are like:
>   /tmp/grub.00529W
> 
> Content is always the same:
>   insmod part_acorn
>   insmod part_amiga
>   insmod part_apple
>   insmod part_bsd
>   insmod part_dfly
>   insmod part_dvh
>   insmod part_gpt
>   insmod part_msdos
>   insmod part_plan
>   insmod part_sun
>   insmod part_sunpc
> 

That's load.cfg used to build image. I'm surprised this is the only one
left, there should be more.

> grub-mkrescue -V
>   grub-mkrescue (GRUB) 2.02~beta2-33
> 
> Where to report ? Upstream or distro ?
> 

Yes, I have this hanging around. Not because of garbage in /tmp, but to
better documentation of generated image (load.cfg is stored by
grub-install as well).

Vladimir?




[-- Attachment #2: load_cfg.patch --]
[-- Type: text/x-patch, Size: 2358 bytes --]

From: Andrey Borzenkov <arvidjaar@gmail.com>
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)

       reply	other threads:[~2015-12-28  3:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <21871572876213560699@scdbackup.webframe.org>
2015-12-28  3:40 ` Andrei Borzenkov [this message]
2015-12-29 16:51   ` Each grub-mkrescue run leaves a file in /tmp/ Vladimir 'φ-coder/phcoder' Serbinenko
2015-12-29 18:04     ` Andrei Borzenkov
2015-12-29 18:13       ` Vladimir 'phcoder' Serbinenko
2015-12-29 18:31         ` Andrei Borzenkov
2015-12-29 18:55           ` Vladimir 'phcoder' Serbinenko

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=5680AF1D.80905@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=bug-grub@gnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.