Adding Vladimir... On Thu, Oct 19, 2023 at 04:50:10AM -0700, Oliver Steffen wrote: > Quoting Daniel Axtens (2023-10-05 08:07:47) > > (Unless anything has changed dramatically in the last year:) Dependencies > > are calculated automatically on the basis of symbols that you use in your > > module. If you look at genmoddep.awk and work out from there you can get a > > handle on the process. If you only use symbols provided by the ‘kernel’, > > then you won’t have any dependencies. > > > Thanks for the info, that makes sense. > > > If you are writing a new module, make sure it’s specified in > > Makefile.core.def and you’ve regenerated the necessary files. (From memory > > I used to need a full bootstrap to get changes to percolate through.) > > > > Kind regards, > > Daniel > > There is the problem with the new bli module, that it requires the > part_gpt module to be loaded beforehand, but the module dependency list > for bli is emplty (see moddep.lst). > > The part_gpt module only exports one function, > grub_gpt_partition_map_iterate(). This is not used in the bli module. > However, if part_gpt is not loaded grub does not know how to work with > gpt formatted disks and these are not visible. > The bli module then can't use grub_device_open(), grub_disk_open(), etc. > to get the partition UUID of the ESP. > > Adding this dummy call to bli.c causes part_gpt to appear as a > dependency: > (void) grub_gpt_partition_map_iterate (NULL, NULL, NULL); > > Thanks, I understand the problem now.
I chatted with Vladimir and he suggested this: diff --git a/grub-core/genmoddep.awk b/grub-core/genmoddep.awk index 247436392..716732a91 100644 --- a/grub-core/genmoddep.awk +++ b/grub-core/genmoddep.awk @@ -51,6 +51,9 @@ END { for (depmod in uniqmods) { delete uniqmods[depmod]; } + if (mod == "bli") { + uniqmods["part_gpt"] = 1; + } for (i in depmods) { depmod = depmods[i]; # Ignore kernel, as always loaded. I think it makes sense. Though I would go a bit further and create a hash of arrays which would contain extra dependencies for modules. If you are OK with this idea please create a patch for bli module and post it on the grub-devel. Daniel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel