On 23.04.2012 13:06, Samuel Thibault wrote: > Vladimir 'φ-coder/phcoder' Serbinenko, le Mon 23 Apr 2012 12:45:09 +0200, a > écrit : >> On 23.04.2012 11:40, Samuel Thibault wrote: >>> Vladimir 'φ-coder/phcoder' Serbinenko, le Mon 23 Apr 2012 10:52:09 +0200, a >>> écrit : >>>> map was never intended to be globally visible. At most perhaps >>>> "semi-local" due to difficulties of split between getroot.c and hostdisk.c >>>> Moreover the behaviour of find_root_device must be independent of what >>>> is already in map since we don't rely anymore at map being populated at >>>> all and at entries only on as-needed basis. >>> How can I get the same information, then? (the unix path corresponding >>> to a disk opened with grub_disk_open()) >> The problem is bigger than just getting the device from a disk. The >> problem is that you assume that grub_disk_dev_iterate will go through >> the disk in question which isn't necessarily true. > And so? > > Our need is to iterate over all disks that GRUB sees, to match that with > where the file resides. It looks like you have missed some of 2.00 developement. We auto-add the device to map if necessary right after find_root_devices so at find_root_devices the disk won't be seen yet but find_root_devices has to work nevertheless. This function has nothing to do with the rest of GRUB. It could be a standalone program with syntax like find_root_devices DIR Output: /dev/sda1 /dev/sdb2 Any of GRUB context is irrelevant. (and actually so is the GRUB partition view, but you can use partition functions as they are stateless but beware that their view is likely to be different from GRUB's one). > Samuel > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel
-- Regards Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel