Bugzilla – Bug 1161641
grub2-install fails with "not a directory" error
Last modified: 2023-05-11 06:48:58 UTC
Created attachment 828118 [details] reproducer script I recently came across a strange grub2-install error when building kiwi images in OBS. The reason is a bug in the minix file system detection. I filed upstream bug https://savannah.gnu.org/bugs/index.php?57652 Note I experienced this on SLES15-SP1. The bug is still present in current Tumbleweed (see attached reproducer script) This bug thus needs fixing in all supported openSUSE releases. The reproducer-script is called as root like # bash ./grub-bug-57652-reproduce-suse.sh /tmp/grub-test.img /mnt /tmp needs 1GB of free storage to store the image.
maybe this would be good enough as a minimal-intrusive fix: diff --git a/Makefile.am b/Makefile.am index 1f4bb9b8c..0bef226d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,8 +42,11 @@ libgrub.pp: grub_script.tab.h grub_script.yy.h $(libgrubmods_a_SOURCES) $(libgru -D'GRUB_MOD_INIT(x)=@MARKER@x@' $^ > $@ || (rm -f $@; exit 1) CLEANFILES += libgrub.pp +# the grep/sed ensures that ext2 gets initialized before minix* +# see https://savannah.gnu.org/bugs/?57652 libgrub_a_init.lst: libgrub.pp cat $< | grep '@MARKER@' | sed 's/@MARKER@\(.*\)@/\1/g' | sort -u > $@ || (rm -f $@; exit 1) + if grep ^ext2 $@ >/dev/null; then sed '/ext2/d;/newc/iext2' < $@ > $@.tmp && mv $@.tmp $@; fi CLEANFILES += libgrub_a_init.lst libgrub_a_init.c: libgrub_a_init.lst $(top_srcdir)/geninit.sh It does not fix the minix detection code, but instead makes sure that ext[234] is tried before minix
I think using sed '/ext2/d;$aext2' to put ext2 to last of the list in case newc were renamed or removed could be a better way, but the patch is good to go for me as well. Would you please send your patch upstream ? At least it helps to draw attention of the developer of minix who may be able to come up with better solution ?
As the order of FS detection might cause regressions (at least theoretically), I just wanted to change as little as possible, but putting ext2 last will probably work as well. I filed upstream bug https://savannah.gnu.org/bugs/index.php?57652 but it has not drawn any attention yet.
(In reply to Stefan Seyfried from comment #4) > As the order of FS detection might cause regressions (at least > theoretically), I just wanted to change as little as possible, Indeed this is something to think about. > I filed upstream bug https://savannah.gnu.org/bugs/index.php?57652 but it > has not drawn any attention yet. I am going to including your patch in comment#2 to openSUSE. We could resort to upstream mailing list to draw attention if no update in a few days. Thanks for the report & fix.
(In reply to Michael Chang from comment #5) > (In reply to Stefan Seyfried from comment #4) [snip] > I am going to including your patch in comment#2 to openSUSE. We could resort > to upstream mailing list to draw attention if no update in a few days. The patch is submitted to openSUSE Factory. Feel free to reopen if anything missing. Thanks.
Now that there is obviously another private bug for the SLES updates, can we please reopen this bug? I deliberately filed it against openSUSE so that everyone can see it. Thanks.
with "reopen" I meant "make it visible to the public", sorry.
Stefan, I've moved the bug back to openSUSE again. Please let me know if something is missing. Sorry for the inconvenience!
SUSE-RU-2020:0749-1: An update that has two recommended fixes can now be installed. Category: recommended (moderate) Bug References: 1161641,1162403 CVE References: Sources used: SUSE Linux Enterprise Module for Server Applications 15-SP1 (src): grub2-2.02-26.12.1 SUSE Linux Enterprise Module for Open Buildservice Development Tools 15-SP1 (src): grub2-2.02-26.12.1 SUSE Linux Enterprise Module for Basesystem 15-SP1 (src): grub2-2.02-26.12.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
SUSE-RU-2020:0748-1: An update that has two recommended fixes can now be installed. Category: recommended (moderate) Bug References: 1161641,1162403 CVE References: Sources used: SUSE Linux Enterprise Server for SAP 15 (src): grub2-2.02-19.36.1 SUSE Linux Enterprise Server 15-LTSS (src): grub2-2.02-19.36.1 SUSE Linux Enterprise High Performance Computing 15-LTSS (src): grub2-2.02-19.36.1 SUSE Linux Enterprise High Performance Computing 15-ESPOS (src): grub2-2.02-19.36.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
SUSE-RU-2020:0804-1: An update that has two recommended fixes can now be installed. Category: recommended (moderate) Bug References: 1161641,1162403 CVE References: Sources used: SUSE Linux Enterprise Server 12-SP5 (src): grub2-2.02-12.21.1 SUSE Linux Enterprise Server 12-SP4 (src): grub2-2.02-12.21.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
openSUSE-RU-2020:0401-1: An update that has two recommended fixes can now be installed. Category: recommended (moderate) Bug References: 1161641,1162403 CVE References: Sources used: openSUSE Leap 15.1 (src): grub2-2.02-lp151.21.12.1
SUSE-RU-2021:3478-1: An update that has two recommended fixes can now be installed. Category: recommended (moderate) Bug References: 1161641,1162403 CVE References: JIRA References: Sources used: SUSE OpenStack Cloud Crowbar 9 (src): grub2-2.02-121.12.1 SUSE OpenStack Cloud 9 (src): grub2-2.02-121.12.1 SUSE Linux Enterprise Server for SAP 12-SP4 (src): grub2-2.02-121.12.1 SUSE Linux Enterprise Server 12-SP5 (src): grub2-2.02-121.12.1 SUSE Linux Enterprise Server 12-SP4-LTSS (src): grub2-2.02-121.12.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.