grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Design: partitions in partitions


From: phcoder
Subject: Design: partitions in partitions
Date: Sat, 14 Feb 2009 19:00:59 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Hello I would like to implement partition in partitions support (it's on the TODO list) and necessary as a pre-requisite to access solaris' zfs partitions. I would also like to integrate current bsd partition support to it. I propose the following design:
Unified naming scheme: purely numerical. It means that
(hd0,1,a) becomes (hd0,1,1)

get_name is removed from grub_partition_map

Unlimited depth support. It means that partitions like
fdisk in sun in apple in gpt will be detected (silly but is theoretically possible) Partitions describing whole parent partition or laying outside of parent partition will be filtered
An arbitrary limit may be put to avoid endless loop

Add pointer to struct grub_disk * in struct grub_partition.
Then the prototypes in grub_partition_map are:
  /* Call HOOK with each partition, until HOOK returns non-zero.  */
  grub_err_t (*iterate) (grub_partition_t parent,
                         int (*hook) (struct grub_disk *disk,
                                      const grub_partition_t partition));

  /* Return the partition NUM on the partition PARENT.  */
  grub_partition_t (*probe) (grub_partition_t parent,
                             int num);

For the first level a fake grub_partition_t describing the whole disk will be created

What do you think about such a design?
Regards
Vladimir 'phcoder' Serbinenko




reply via email to

[Prev in Thread] Current Thread [Next in Thread]