From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aDOfX-0006B3-Sx for mharc-grub-devel@gnu.org; Sun, 27 Dec 2015 22:40:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDOfW-0006Aw-Bb for grub-devel@gnu.org; Sun, 27 Dec 2015 22:40:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aDOfR-0007fN-AN for grub-devel@gnu.org; Sun, 27 Dec 2015 22:40:22 -0500 Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]:33889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDOfR-0007eU-2r; Sun, 27 Dec 2015 22:40:17 -0500 Received: by mail-lb0-x234.google.com with SMTP id pv2so100816649lbb.1; Sun, 27 Dec 2015 19:40:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=x77garCxv1CzK4e7RJmDCoCOFkVFAeDciGIrA6D/jg0=; b=v30wNSjHvSRKnpVu1zxzYzVgjQGhU4ICYDcfCmh96hydZtrasu/TgKHcnAx/0lsiQk mQ1hc9/F4ZGJ3xgEsynk7yM2kriynGsYPeCR4kOykgChS7j8Du/evVqrBeRPv5FOgSEQ wyiYMSWWyA8GSB/dV0js6jzsJDyym7T0c2WonJ1ZN5TPeQCWgdWjJtDCaTk12G1ZrnJs lV7H7l/IU60sqwXB6qfnnXY2SAGx44uDdaw+UUWNXPU9p4U1dCqF0pWDWvkDk/78CCro cCVBONkVnGNGRgBDXDLfNQaaavQZpz7kyBX46ZR8D8NYo2xov36gzD2WfFj1DtXF61R2 EKcQ== X-Received: by 10.112.84.44 with SMTP id v12mr17771538lby.46.1451274016077; Sun, 27 Dec 2015 19:40:16 -0800 (PST) Received: from [192.168.1.41] (ppp91-76-25-247.pppoe.mtu-net.ru. [91.76.25.247]) by smtp.gmail.com with ESMTPSA id pf5sm10169170lbc.19.2015.12.27.19.40.14 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Dec 2015 19:40:14 -0800 (PST) Subject: Re: Each grub-mkrescue run leaves a file in /tmp/ To: bug-grub@gnu.org References: <21871572876213560699@scdbackup.webframe.org> From: Andrei Borzenkov Message-ID: <5680AF1D.80905@gmail.com> Date: Mon, 28 Dec 2015 06:40:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <21871572876213560699@scdbackup.webframe.org> Content-Type: multipart/mixed; boundary="------------020501060102080400000806" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::234 Cc: The development of GNU GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2015 03:40:23 -0000 This is a multi-part message in MIME format. --------------020501060102080400000806 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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? --------------020501060102080400000806 Content-Type: text/x-patch; name="load_cfg.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="load_cfg.patch" 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) --------------020501060102080400000806--