On 22.04.2012 20:24, Samuel Thibault wrote: > Hello, > > GNU/Hurd is moving to userland partition support, i.e. /dev/hd0s* slices > are actually served by userland translators which use libparted. The > grub probe code needs to be fixed for that, here is a proposed patch. > > The principle is that it gets the store translator behind the file being > probed for, and compares the storage area there with what grub detects > itself. That is why it makes use of the map array, which I preferred > to rename to hostdisk_map (thus big but trivial changes in hostdisk.c): > even if it was already an external symbol, it's preferrable to prefix > it. 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. Additional problems include:
+ if (disk->dev->id != GRUB_DISK_DEVICE_BIOSDISK_ID && disk->dev->id !=
GRUB_DISK_DEVICE_HOSTDISK_ID)
+ {
No need to check for BIOSDISK. It's not used for hostdisk.
+ store_offset_t start = partition->start * GRUB_DISK_SECTOR_SIZE,
+ length = partition->len * GRUB_DISK_SECTOR_SIZE,
This is both stylistically incorrect and wrong.
Stylistically at declaration we repeat type on every line.
Additionally partition->start is only relative to container, not whole disk.
You have to use grub_disk_partition_get_start for this.
>
> Samuel
>
>
> _______________________________________________
> Grub-devel mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
