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

Bug#422370: should switch to grub2 when using GPT



On Fri, May 11, 2007 at 08:48:43AM +0200, Robert Millan wrote:
> 
> $ time sudo grub-probe -t partmap /boot/grub
> pc
> 
> real    0m0.469s
> user    0m0.000s
> sys     0m0.088s
> 
> Not sure why /dev/hda is so slow though.  Maybe it's a bug, but not an
> important one.

Actually I think we can do much better with our own simple program that uses
libparted.  See attachment.

On my amd64 sid, compiled with -Os and stripped it just takes 5224 bytes.

-- 
Robert Millan

My spam trap is honeypot@aybabtu.com.  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
#include <parted/parted.h>
#include <stdio.h>

main (int argc, char **argv)
{
  PedDevice *device;
  PedDisk *disk;

  if (argc != 2)
    {
      fprintf (stderr, "Usage: %s DEVICE\n", argv[0]);
      exit (1);
    }

  device = ped_device_get (argv[1]);
  if (!device)
    exit (1);

  disk = ped_disk_new (device);
  if (!disk)
    exit (1);

  printf ("%s\n", disk->type->name);
}

Reply to: