diff --git a/0002-grub-install-Avoid-incompleted-install-on-i386-pc.patch b/0002-grub-install-Avoid-incompleted-install-on-i386-pc.patch index f282c1c..248e419 100644 --- a/0002-grub-install-Avoid-incompleted-install-on-i386-pc.patch +++ b/0002-grub-install-Avoid-incompleted-install-on-i386-pc.patch @@ -18,6 +18,11 @@ V1: This fixed "failed to get canonical path of `/boot/grub2/i386-pc`" error during grub-install. +V2: Do not clean up core.img and boot.img in i386-pc platform directory. + The core.img is required by blocklist install that will load it from + platform directory. Both files can be used by grub2-bios-setup to + reinstall images to disk made by previous grub2-install. + Signed-off-by: Michael Chang --- util/grub-install.c | 7 +++++-- @@ -56,3 +61,37 @@ Index: grub-2.04/util/grub-install.c break; } case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275: +Index: grub-2.04/util/grub-install-common.c +=================================================================== +--- grub-2.04.orig/util/grub-install-common.c ++++ grub-2.04/util/grub-install-common.c +@@ -190,18 +190,28 @@ clean_grub_dir (const char *di) + { + grub_util_fd_dir_t d; + grub_util_fd_dirent_t de; ++ int skip_img = 0; + + d = grub_util_fd_opendir (di); + if (!d) + grub_util_error (_("cannot open directory `%s': %s"), + di, grub_util_fd_strerror ()); + ++ { ++ char *plat_i386_pc = grub_install_get_platform_name (GRUB_INSTALL_PLATFORM_I386_PC); ++ const char *plat = strrchr (di, '/'); ++ ++ if (plat && strcmp (plat + 1, plat_i386_pc) == 0) ++ skip_img = 1; ++ free (plat_i386_pc); ++ } ++ + while ((de = grub_util_fd_readdir (d))) + { + const char *ext = strrchr (de->d_name, '.'); + if ((ext && (strcmp (ext, ".mod") == 0 + || strcmp (ext, ".lst") == 0 +- || strcmp (ext, ".img") == 0 ++ || (!skip_img && strcmp (ext, ".img") == 0) + || strcmp (ext, ".mo") == 0) + && strcmp (de->d_name, "menu.lst") != 0) + || strcmp (de->d_name, "efiemu32.o") == 0 diff --git a/grub2.changes b/grub2.changes index 0e51509..5f5a8f1 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 2 06:42:04 UTC 2020 - Michael Chang + +- Fix boot failure in blocklist installation (bsc#1178278) + * Modified 0002-grub-install-Avoid-incompleted-install-on-i386-pc.patch + ------------------------------------------------------------------- Thu Oct 22 06:19:13 UTC 2020 - Michael Chang