Index: b/util/grub-setup.c =================================================================== --- a/util/grub-setup.c +++ b/util/grub-setup.c @@ -76,6 +76,7 @@ #define DEFAULT_BOOT_FILE "boot.img" #define DEFAULT_CORE_FILE "core.img" +#define CORE_IMG_IN_FS "setup_left_core_image_in_filesystem" #ifdef GRUB_MACHINE_SPARC64 #define grub_target_to_host16(x) grub_be_to_cpu16(x) @@ -489,6 +490,8 @@ grub_free (sectors); + unlink (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS); + goto finish; } #endif @@ -514,6 +517,9 @@ /* The core image must be put on a filesystem unfortunately. */ grub_util_info ("will leave the core image on the filesystem"); + fp = fopen (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS, "w"); + fclose (fp); + /* Make sure that GRUB reads the identical image as the OS. */ tmp_img = xmalloc (core_size); core_path_dev_full = grub_util_get_path (dir, core_file);