grub-devel
[Top][All Lists]
Advanced

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

Re: grub2 sci-fi, the usb problem and the solution


From: zunda
Subject: Re: grub2 sci-fi, the usb problem and the solution
Date: Wed, 24 Jan 2007 04:37:46 +0900 (JST)

Hi adrian15,

Thanks for the nice Sci-fi :-)

This is regarding the shift of BIOS drive numbers
when we have a USB pendrive on the PC.

--- adrian15 <address@hidden> wrote:

> My solution for grub legacy is more or less (I need some advice if you
> do not mind) this one:
> 
> 1) Add a "preprocessor if" somewhere to see if we're going to build a
> normal grub or a usb rescue grub.
> 
> # if defined(USB_RESCUE)
> static const char *preset_menu = "usbshift\n";
> # endif
> 
> I think that activates the preset menu or kind of.

I actually have the following option in grub.conf (for
grub-legacy) on my USB pendrive so I can revert to the
boot loader installed to the regular location:

title Normal Harddisk
  map (hd0) (hd1)
  map (hd1) (hd0)
  root (hd0)
  chainloader +1

No, as you imagine, this only works when the boot loader on 
hd0 only depends upon the primary drive (hd0). Once it
tries to see hd1, there the pen drive is.

> Then usbshift command checks if grub is running from hd0,
> if it is true it should do the following thing with map commands.
> 
> Before:
> usb1 disk1 disk2 disk3 disk4 disk5
> hd0  hd1   hd2   hd3   hd4   hd5
> After:
> disk1 disk2 disk3 disk4 disk5 usb1
> hd0   hd1   hd2   hd3   hd4   hd5

Yes, this is good idea. It would be nice if we have a command like
  shiftdrives
to do the above so that I can rewrite the grub.conf like:

title Normal Harddisk
  shiftdrives
  root (hd0)
  chainloader +1

and we no longer have to worry about hd1 seen from the boot loader
on hd0.

What do you think?

my two cents,
zunda

--------------------------------------
Start Yahoo! Auction now! Check out the cool campaign
http://pr.mail.yahoo.co.jp/auction/





reply via email to

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