All of lore.kernel.org
 help / color / mirror / Atom feed
* grub2 on power6 box.
@ 2010-07-22 21:23 Lennart Sorensen
  2010-07-23  5:56 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Sorensen @ 2010-07-22 21:23 UTC (permalink / raw)
  To: grub-devel

I am trying to use grub2 to boot an IBM p520 power6 box.  I know yaboot
can do the job, but it doesn't deal with software raid, ext4, LVM or
anything else useful.

I have managed to get as far as booting to a grub prompt from disk.
Unfortunately it doesn't appear to be seeing any disks at that point.

The way I got it this far was to create an 8MB (smallest cfdisk would
make) PReP boot partition, and then run grub-mkimage -n -o /tmp/grub -O
powerpc-ieee1275 *.mod in the ieee1275 grub directory.  I then dd'd
/tmp/grub to /dev/sda1 (the PReP boot partition).

At boot, the firmware loads the partition and runs it and after a few
seconds I get a grub prompt.

I know I don't need all the modules, but starting with all of them
seemed simpler.

So is this supposed to work, or is there still some ofpath handling
or other things that have to be fixed before grub2 can detect disks on
this machine?  If so, I will try to do it, but some hints would be handy.
It certainly looks very close to working.

Thanks.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-22 21:23 grub2 on power6 box Lennart Sorensen
@ 2010-07-23  5:56 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-07-23 13:57   ` Lennart Sorensen
  0 siblings, 1 reply; 18+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-07-23  5:56 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]

On 07/22/2010 11:23 PM, Lennart Sorensen wrote:
> I am trying to use grub2 to boot an IBM p520 power6 box.  I know yaboot
> can do the job, but it doesn't deal with software raid, ext4, LVM or
> anything else useful.
>
> I have managed to get as far as booting to a grub prompt from disk.
> Unfortunately it doesn't appear to be seeing any disks at that point.
>
> The way I got it this far was to create an 8MB (smallest cfdisk would
> make) PReP boot partition, and then run grub-mkimage -n -o /tmp/grub -O
> powerpc-ieee1275 *.mod in the ieee1275 grub directory.  I then dd'd
> /tmp/grub to /dev/sda1 (the PReP boot partition).
>
>   
You need to add -p "<your /boot/grub in grub notation>". Also avoid the
raid and lvm-related modules you don't need. OFW exposes ghost devices
so assembling raids which involves looking at all devices is slow
> At boot, the firmware loads the partition and runs it and after a few
> seconds I get a grub prompt.
>
> I know I don't need all the modules, but starting with all of them
> seemed simpler.
>
> So is this supposed to work, or is there still some ofpath handling
> or other things that have to be fixed before grub2 can detect disks on
> this machine?  If so, I will try to do it, but some hints would be handy.
> It certainly looks very close to working.
>
> Thanks.
>
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-23  5:56 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-23 13:57   ` Lennart Sorensen
  2010-07-23 15:39     ` Lennart Sorensen
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Sorensen @ 2010-07-23 13:57 UTC (permalink / raw)
  To: The development of GNU GRUB

On Fri, Jul 23, 2010 at 07:56:27AM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 07/22/2010 11:23 PM, Lennart Sorensen wrote:
> > I am trying to use grub2 to boot an IBM p520 power6 box.  I know yaboot
> > can do the job, but it doesn't deal with software raid, ext4, LVM or
> > anything else useful.
> >
> > I have managed to get as far as booting to a grub prompt from disk.
> > Unfortunately it doesn't appear to be seeing any disks at that point.
> >
> > The way I got it this far was to create an 8MB (smallest cfdisk would
> > make) PReP boot partition, and then run grub-mkimage -n -o /tmp/grub -O
> > powerpc-ieee1275 *.mod in the ieee1275 grub directory.  I then dd'd
> > /tmp/grub to /dev/sda1 (the PReP boot partition).
> >
> >   
> You need to add -p "<your /boot/grub in grub notation>". Also avoid the
> raid and lvm-related modules you don't need. OFW exposes ghost devices
> so assembling raids which involves looking at all devices is slow

I will try that (although I think I did).

I can't even get it to do ls on any disk or anything.  It really seems
to be behaving as if it doesn't detect any disks.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-23 13:57   ` Lennart Sorensen
@ 2010-07-23 15:39     ` Lennart Sorensen
  2010-07-23 17:02       ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-07-23 17:28       ` Manoel Rebelo Abraches
  0 siblings, 2 replies; 18+ messages in thread
From: Lennart Sorensen @ 2010-07-23 15:39 UTC (permalink / raw)
  To: The development of GNU GRUB

On Fri, Jul 23, 2010 at 09:57:37AM -0400, Lennart Sorensen wrote:
> On Fri, Jul 23, 2010 at 07:56:27AM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > On 07/22/2010 11:23 PM, Lennart Sorensen wrote:
> > > I am trying to use grub2 to boot an IBM p520 power6 box.  I know yaboot
> > > can do the job, but it doesn't deal with software raid, ext4, LVM or
> > > anything else useful.
> > >
> > > I have managed to get as far as booting to a grub prompt from disk.
> > > Unfortunately it doesn't appear to be seeing any disks at that point.
> > >
> > > The way I got it this far was to create an 8MB (smallest cfdisk would
> > > make) PReP boot partition, and then run grub-mkimage -n -o /tmp/grub -O
> > > powerpc-ieee1275 *.mod in the ieee1275 grub directory.  I then dd'd
> > > /tmp/grub to /dev/sda1 (the PReP boot partition).
> > >
> > >   
> > You need to add -p "<your /boot/grub in grub notation>". Also avoid the
> > raid and lvm-related modules you don't need. OFW exposes ghost devices
> > so assembling raids which involves looking at all devices is slow
> 
> I will try that (although I think I did).
> 
> I can't even get it to do ls on any disk or anything.  It really seems
> to be behaving as if it doesn't detect any disks.

So I fixed ofpathname (it was not working because it did find /sys -name
$device, which mathes multiple things on modern kernels).  I changed the
find to find /sys -type d -name $device and now that works.  So now I
can run grub-install, but of course that just creates a /boot/grub/grub
file with the main grub and a filesystem module attached.  It doesn't
actually boot.

It set the
boot_device=/pci@800000020000200/pci1014,02BD@1/sas/disk@20000:4,\grub

/dev/sda4 is a fat16 partition mounted as /boot/grub.  Unfortunately I
am not convinced the IBM boxes know how to read filesystems or boot
files.  It seems it only wants to read raw from a PReP boot partition.
So when I dd /boot/grub/grub to /dev/sda1 (an 8MB PReP boot partition)
the system does start grub, but of course since grub was only the core
plus the fat module, it just says:

Welcome to GRUB!                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                               
error: no device is set.
Entering rescue mode...                                                                                                                                                                                                                                                        
grub rescue>

So what do I do then to get it to know what device to use?

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-23 15:39     ` Lennart Sorensen
@ 2010-07-23 17:02       ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-07-23 17:36         ` Lennart Sorensen
  2010-07-23 17:28       ` Manoel Rebelo Abraches
  1 sibling, 1 reply; 18+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-07-23 17:02 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 3543 bytes --]

On 07/23/2010 05:39 PM, Lennart Sorensen wrote:
> On Fri, Jul 23, 2010 at 09:57:37AM -0400, Lennart Sorensen wrote:
>   
>> On Fri, Jul 23, 2010 at 07:56:27AM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>>     
>>> On 07/22/2010 11:23 PM, Lennart Sorensen wrote:
>>>       
>>>> I am trying to use grub2 to boot an IBM p520 power6 box.  I know yaboot
>>>> can do the job, but it doesn't deal with software raid, ext4, LVM or
>>>> anything else useful.
>>>>
>>>> I have managed to get as far as booting to a grub prompt from disk.
>>>> Unfortunately it doesn't appear to be seeing any disks at that point.
>>>>
>>>> The way I got it this far was to create an 8MB (smallest cfdisk would
>>>> make) PReP boot partition, and then run grub-mkimage -n -o /tmp/grub -O
>>>> powerpc-ieee1275 *.mod in the ieee1275 grub directory.  I then dd'd
>>>> /tmp/grub to /dev/sda1 (the PReP boot partition).
>>>>
>>>>   
>>>>         
>>> You need to add -p "<your /boot/grub in grub notation>". Also avoid the
>>> raid and lvm-related modules you don't need. OFW exposes ghost devices
>>> so assembling raids which involves looking at all devices is slow
>>>       
>> I will try that (although I think I did).
>>
>> I can't even get it to do ls on any disk or anything.  It really seems
>> to be behaving as if it doesn't detect any disks.
>>     
> So I fixed ofpathname (it was not working because it did find /sys -name
> $device, which mathes multiple things on modern kernels).  I changed the
> find to find /sys -type d -name $device and now that works.  So now I
> can run grub-install, but of course that just creates a /boot/grub/grub
> file with the main grub and a filesystem module attached.  It doesn't
> actually boot.
>
> It set the
> boot_device=/pci@800000020000200/pci1014,02BD@1/sas/disk@20000:4,\grub
>
> /dev/sda4 is a fat16 partition mounted as /boot/grub.  Unfortunately I
> am not convinced the IBM boxes know how to read filesystems or boot
> files.  It seems it only wants to read raw from a PReP boot partition.
> So when I dd /boot/grub/grub to /dev/sda1 (an 8MB PReP boot partition)
> the system does start grub, but of course since grub was only the core
> plus the fat module, it just says:
>
> Welcome to GRUB!                                                                                                                                                                                                                                                               
>                                                                                                                                                                                                                                                                                
> error: no device is set.
> Entering rescue mode...                                                                                                                                                                                                                                                        
> grub rescue>
>
> So what do I do then to get it to know what device to use?
>
>   
Right now grub2 lists only aliased devices. You can either alias your
disk or directly use:

prefix=(/pci@800000020000200/pci1014\,02BD@1/sas/disk@20000,4)/
I have some code on ls issue but the problem is to reliably determine if 2 nodes are really the same device




-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-23 15:39     ` Lennart Sorensen
  2010-07-23 17:02       ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-23 17:28       ` Manoel Rebelo Abraches
  2010-07-23 17:46         ` Lennart Sorensen
  1 sibling, 1 reply; 18+ messages in thread
From: Manoel Rebelo Abraches @ 2010-07-23 17:28 UTC (permalink / raw)
  To: The development of GNU GRUB

On Fri, 2010-07-23 at 11:39 -0400, Lennart Sorensen wrote:
> On Fri, Jul 23, 2010 at 09:57:37AM -0400, Lennart Sorensen wrote:
> > On Fri, Jul 23, 2010 at 07:56:27AM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > > On 07/22/2010 11:23 PM, Lennart Sorensen wrote:
> > > > I am trying to use grub2 to boot an IBM p520 power6 box.  I know yaboot
> > > > can do the job, but it doesn't deal with software raid, ext4, LVM or
> > > > anything else useful.
> > > >
> > > > I have managed to get as far as booting to a grub prompt from disk.
> > > > Unfortunately it doesn't appear to be seeing any disks at that point.
> > > >
> > > > The way I got it this far was to create an 8MB (smallest cfdisk would
> > > > make) PReP boot partition, and then run grub-mkimage -n -o /tmp/grub -O
> > > > powerpc-ieee1275 *.mod in the ieee1275 grub directory.  I then dd'd
> > > > /tmp/grub to /dev/sda1 (the PReP boot partition).
> > > >
> > > >   
> > > You need to add -p "<your /boot/grub in grub notation>". Also avoid the
> > > raid and lvm-related modules you don't need. OFW exposes ghost devices
> > > so assembling raids which involves looking at all devices is slow
> > 
> > I will try that (although I think I did).
> > 
> > I can't even get it to do ls on any disk or anything.  It really seems
> > to be behaving as if it doesn't detect any disks.
> 
> So I fixed ofpathname (it was not working because it did find /sys -name
> $device, which mathes multiple things on modern kernels).  I changed the
> find to find /sys -type d -name $device and now that works.  So now I
> can run grub-install, but of course that just creates a /boot/grub/grub
> file with the main grub and a filesystem module attached.  It doesn't
> actually boot.
> 
> It set the
> boot_device=/pci@800000020000200/pci1014,02BD@1/sas/disk@20000:4,\grub
> 
> /dev/sda4 is a fat16 partition mounted as /boot/grub.  Unfortunately I
> am not convinced the IBM boxes know how to read filesystems or boot
> files.  It seems it only wants to read raw from a PReP boot partition.
OF can read FAT12 filesystem.
you could format it with fat 12 and then mount it at /boot/grub.
then you can use grub-install and grub-mkconfig to create a grub.cfg
 I think the easiest way  is to set a devalias in OF to point to you
device:
devalias hd /pci@800000020000200/pci1014,02BD@1/sas/disk@20000 
then it should appear when you use the 'ls' command.
you could also set boot-device to
hd:<parnumber>,grub 
since OF can read FAT12 filesystem it will be able to find grub there.


> So when I dd /boot/grub/grub to /dev/sda1 (an 8MB PReP boot partition)
> the system does start grub, but of course since grub was only the core
> plus the fat module, it just says:
> 
> Welcome to GRUB!                                                                                                                                                                                                                                                               
>                                                                                                                                                                                                                                                                                
> error: no device is set.
> Entering rescue mode...                                                                                                                                                                                                                                                        
> grub rescue>
> 
> So what do I do then to get it to know what device to use?
> 

-- 
Best Regards,

Manoel Rebelo Abranches
Software engineer
IBM - Linux Technology Center - Brazil



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-23 17:02       ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-23 17:36         ` Lennart Sorensen
  2010-07-23 17:56           ` Lennart Sorensen
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Sorensen @ 2010-07-23 17:36 UTC (permalink / raw)
  To: The development of GNU GRUB

On Fri, Jul 23, 2010 at 07:02:15PM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Right now grub2 lists only aliased devices. You can either alias your
> disk or directly use:

Unfortunately I think IBM doesn't generate aliases at all.  I have no
idea how to set one (I can't find any documentation on what commands
are available on IBM's openfirmware).

> prefix=(/pci@800000020000200/pci1014\,02BD@1/sas/disk@20000,4)/
> I have some code on ls issue but the problem is to reliably determine if 2 nodes are really the same device

So that syntax should work?

I tried doing something like:
ls (/pci@800000020000200/pci1014\,02BD@1/sas/disk@20000,4)/

It didn't like it.

ls (/pci@800000020000200/pci1014\,02BD@1/sas/disk@20000:4)/

didn't work either as far as I recall.

I will keep trying though.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-23 17:28       ` Manoel Rebelo Abraches
@ 2010-07-23 17:46         ` Lennart Sorensen
  2010-07-23 18:08           ` Lennart Sorensen
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Sorensen @ 2010-07-23 17:46 UTC (permalink / raw)
  To: The development of GNU GRUB

On Fri, Jul 23, 2010 at 02:28:55PM -0300, Manoel Rebelo Abraches wrote:
> OF can read FAT12 filesystem.

FAT12, but not FAT16?  How convinient.  Must try that.

> you could format it with fat 12 and then mount it at /boot/grub.
> then you can use grub-install and grub-mkconfig to create a grub.cfg
>  I think the easiest way  is to set a devalias in OF to point to you
> device:
> devalias hd /pci@800000020000200/pci1014,02BD@1/sas/disk@20000 
> then it should appear when you use the 'ls' command.
> you could also set boot-device to
> hd:<parnumber>,grub 
> since OF can read FAT12 filesystem it will be able to find grub there.

Hmm.  Neat.  I will give that a try.

So with /dev/sda4 a fat partition, I still didn't have any luck with:

boot hd:4,\grub

I just get:

0 > boot hd:4,\grub  ok                                                                                                                                                                                                                                                        
0 >

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-23 17:36         ` Lennart Sorensen
@ 2010-07-23 17:56           ` Lennart Sorensen
  2010-07-23 18:35             ` Lennart Sorensen
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Sorensen @ 2010-07-23 17:56 UTC (permalink / raw)
  To: The development of GNU GRUB

On Fri, Jul 23, 2010 at 01:36:08PM -0400, Lennart Sorensen wrote:
> On Fri, Jul 23, 2010 at 07:02:15PM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > Right now grub2 lists only aliased devices. You can either alias your
> > disk or directly use:
> 
> Unfortunately I think IBM doesn't generate aliases at all.  I have no
> idea how to set one (I can't find any documentation on what commands
> are available on IBM's openfirmware).
> 
> > prefix=(/pci@800000020000200/pci1014\,02BD@1/sas/disk@20000,4)/
> > I have some code on ls issue but the problem is to reliably determine if 2 nodes are really the same device
> 
> So that syntax should work?
> 
> I tried doing something like:
> ls (/pci@800000020000200/pci1014\,02BD@1/sas/disk@20000,4)/
> 
> It didn't like it.
> 
> ls (/pci@800000020000200/pci1014\,02BD@1/sas/disk@20000:4)/
> 
> didn't work either as far as I recall.
> 
> I will keep trying though.

OK, so after setting the devalias I tried booting grub from the PReP boot partition I dd'd it to.  Now I get:

grub> ls (                                                                                                                                                                                                                                                                     
Possible devices are:                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                               
 md0 md1 hd                                                                                                                                                                                                                                                                    
grub> ls (                                                                                                                                                                                                                                                                     
Possible devices are:                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                               
 md0 md1 hd                                                                                                                                                                                                                                                                    
grub> ls (hd,                                                                                                                                                                                                                                                                  
Possible partitions are:                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                               
        Partition hd,msdos1: Unknown filesystem                                                                                                                                                                                                                                
        Partition hd,msdos2: Filesystem type ext2 - Label "ROOT" - Last modification time                                                                                                                                                                                      
2010-07-23 16:19:51 Friday, UUID 43073e86-01fb-4371-8598-863fbd0beddf                                                                                                                                                                                                          
        Partition hd,msdos3: Unknown filesystem                                                                                                                                                                                                                                
        Partition hd,msdos4: Filesystem type fat, UUID 4183-cb50                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                               
grub> ls (hd,msdos                                                                                                                                                                                                                                                             
Possible partitions are:                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                               
        Partition hd,msdos1: Unknown filesystem                                                                                                                                                                                                                                
        Partition hd,msdos2: Filesystem type ext2 - Label "ROOT" - Last modification time                                                                                                                                                                                      
2010-07-23 16:19:51 Friday, UUID 43073e86-01fb-4371-8598-863fbd0beddf                                                                                                                                                                                                          
        Partition hd,msdos3: Unknown filesystem                                                                                                                                                                                                                                
        Partition hd,msdos4: Filesystem type fat, UUID 4183-cb50                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                               
grub> ls (hd,msdos

Now we are getting somewhere.  So it seems even with a fat12 partition,
the open firmware on the IBM box still won't boot from a file.

Unfortunately on reboot, my devalias is gone.  How do I make it remember it?

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-23 17:46         ` Lennart Sorensen
@ 2010-07-23 18:08           ` Lennart Sorensen
  0 siblings, 0 replies; 18+ messages in thread
From: Lennart Sorensen @ 2010-07-23 18:08 UTC (permalink / raw)
  To: The development of GNU GRUB

On Fri, Jul 23, 2010 at 01:46:57PM -0400, Lennart Sorensen wrote:
> Hmm.  Neat.  I will give that a try.
> 
> So with /dev/sda4 a fat partition, I still didn't have any luck with:
> 
> boot hd:4,\grub
> 
> I just get:
> 
> 0 > boot hd:4,\grub  ok                                                                                                                                                                                                                                                        
> 0 >

So right now I have this state:

If I go to the open firmware prompt and do:

devalias hd /pci@800000020000200/pci1014,02BD@1/sas/disk@20000
boot hd

Then I can boot the grub image I dd'd to the /dev/sda1 PReP boot
partition.  I can then boot linux after loading the configfile manually
(grub doesn't seem to know /dev/sda4 is where to look for it since it
booted from /dev/sda1 I guess).

The devalias won't stay across reboots (Rather annoying).

So I can now boot from disk with some manual intervention.  That's getting
really close then.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-23 17:56           ` Lennart Sorensen
@ 2010-07-23 18:35             ` Lennart Sorensen
  2010-07-23 20:02               ` Lennart Sorensen
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Sorensen @ 2010-07-23 18:35 UTC (permalink / raw)
  To: The development of GNU GRUB

On Fri, Jul 23, 2010 at 01:56:34PM -0400, Lennart Sorensen wrote:
> Now we are getting somewhere.  So it seems even with a fat12 partition,
> the open firmware on the IBM box still won't boot from a file.
> 
> Unfortunately on reboot, my devalias is gone.  How do I make it remember it?

Turns out using nvalias instead of devalias makes it permanent.

So I now boot to grub directly with an nvalias hd /pci.... set and
boot-device set to hd (which means boot the PReP boot partition).

I now have to set root manually to (md0) and then load /boot/grub/grub.cfg
as a configfile.  Then I can boot.  The fat partition is now needed
at all.  The grub image has mdraid, raid and ext modules included in it
and then dd'd to the PReP partition.

So how do I convince grub where to look for the config, or should I
create a small config file that sets the root and loads a config file
and embed that in the image perhaps?

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-23 18:35             ` Lennart Sorensen
@ 2010-07-23 20:02               ` Lennart Sorensen
  2010-07-28 14:27                 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 18+ messages in thread
From: Lennart Sorensen @ 2010-07-23 20:02 UTC (permalink / raw)
  To: The development of GNU GRUB

On Fri, Jul 23, 2010 at 02:35:48PM -0400, Lennart Sorensen wrote:
> Turns out using nvalias instead of devalias makes it permanent.
> 
> So I now boot to grub directly with an nvalias hd /pci.... set and
> boot-device set to hd (which means boot the PReP boot partition).
> 
> I now have to set root manually to (md0) and then load /boot/grub/grub.cfg
> as a configfile.  Then I can boot.  The fat partition is now needed
> at all.  The grub image has mdraid, raid and ext modules included in it
> and then dd'd to the PReP partition.
> 
> So how do I convince grub where to look for the config, or should I
> create a small config file that sets the root and loads a config file
> and embed that in the image perhaps?

OK, I am now booting from the disk directly.  Here are the steps I took.
Perhaps someone can help make grub-install actually work out of the box
on the IBM pSeries based on this.

I created a permanent devalias called hd using:
nvalias hd

I set boot-device to hd

The resulting nvram --print-config stuff is:
devalias  valias hd /pci@800000020000200/pci1014,02BD@1/sas/disk@20000                                                                                                                                                                                                         
use-nvramrc?=true                                                                                                                                                                                                                                                              
boot-device=hd

I have an msdos partition table on my two disks with:
8MB partition1 type 0x41 (PReP boot partition)
140GB partition2 type 0xfd (linux raid autodetect)
6GB partition3 type 0xfd (linux raid autodetect)

This is then turned into md0 (for the 140GB partitions) and md1 (for
the 6GB partitions).  md1 is swap, md0 is root filesystem.

Fixing ofpathname in powerpc-ibm-utils (debian package name) to use find
/sys -type d -name $device makes it able to find the right OF pathnames,
but grub is unable to use those at this time, hence the manual devalias
above.  If grub ever did support the actual path, then the devalias
won't be needed and the ofpathname fix would be required.

I ran grub-install /dev/sda1 after hacking the script to not complain
about /boot/grub not being a seperate partition (that applies to Macs
and such, not the IBM).  I noted what modules it generated /boot/grub/grub
with.  It got the list right (ext2, mdraid, raid in my case) except it
missed that the partition table format is part_msdos.  I added part_msdos
and ram grub-mkimage again manually with the same arguments.  I also
added -p '(md0)/boot/grub' to embed the correct path to /boot/grub into
the image.  This was very important.  I then dd'd /boot/grub/grub to
/dev/sda1 and /dev/sdb1 (the PReP partitions) and set the partitions
bootable (not that I think it matters if they are bootable).

After all that, the IBM pSeries p520 power6 now boots directly from disk.

So how would one explain to grub-install that it needs part_msdos when
the partition tables that the md devices are running on are of type msdos?
How would one make it automatically add the correct prefix (since it
needs either (hd,msdos#)/boot/grub or (md0)/boot/grub or similar added
instead of the default)?  And of course finally it would have to dd to
the target device, rather than just create a file and try to make the
firmware boot that file.  The boot device also has to be the full disk
on the IBM, not a disk,partition,file combination.

But hey, at least it can work with a bit of manual work.

Thanks for the hints everyone.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-23 20:02               ` Lennart Sorensen
@ 2010-07-28 14:27                 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-07-28 14:45                   ` Lennart Sorensen
  0 siblings, 1 reply; 18+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-07-28 14:27 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]

On 07/23/2010 11:02 PM, Lennart Sorensen wrote:
> So how would one explain to grub-install that it needs part_msdos when
> the partition tables that the md devices are running on are of type msdos?
> How would one make it automatically add the correct prefix (since it
> needs either (hd,msdos#)/boot/grub or (md0)/boot/grub or similar added
> instead of the default)?  And of course finally it would have to dd to
> the target device, rather than just create a file and try to make the
> firmware boot that file.  The boot device also has to be the full disk
> on the IBM, not a disk,partition,file combination.
>   
Normally it should be all autodetected. Could you file a bug report for
this? Could you tell the commands to reproduce it? I have a PPC box but
it has only one disk but a mdraid on partitions should do it.
> But hey, at least it can work with a bit of manual work.
>
> Thanks for the hints everyone.
>
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-28 14:27                 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-28 14:45                   ` Lennart Sorensen
  2010-07-28 15:26                     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-07-30 21:04                     ` Manoel Rebelo Abraches
  0 siblings, 2 replies; 18+ messages in thread
From: Lennart Sorensen @ 2010-07-28 14:45 UTC (permalink / raw)
  To: The development of GNU GRUB

On Wed, Jul 28, 2010 at 05:27:33PM +0300, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 07/23/2010 11:02 PM, Lennart Sorensen wrote:
> > So how would one explain to grub-install that it needs part_msdos when
> > the partition tables that the md devices are running on are of type msdos?
> > How would one make it automatically add the correct prefix (since it
> > needs either (hd,msdos#)/boot/grub or (md0)/boot/grub or similar added
> > instead of the default)?  And of course finally it would have to dd to
> > the target device, rather than just create a file and try to make the
> > firmware boot that file.  The boot device also has to be the full disk
> > on the IBM, not a disk,partition,file combination.
> >   
> Normally it should be all autodetected. Could you file a bug report for
> this? Could you tell the commands to reproduce it? I have a PPC box but
> it has only one disk but a mdraid on partitions should do it.

Well the problem appears to be that grub-install does this:

# Then the partition map module.  In order to support partition-less media,
# this command is allowed to fail (--target=fs already grants us that the
# filesystem will be accessible).
partmap_module=
for x in `$grub_probe --target=partmap --device ${grub_device} 2> /dev/null`; do
   partmap_module="$partmap_module part_$x";
done

Unfortunately there is nothing that defines ${grub_device} in the script.
If it used the target install device, it would in fact get the right
result.

Now of course another issue is that the script aborts if /boot/grub is
not a seperate mount point.  Well on the IBM powerpc there is no reason
to make it a seperate mount point since you can't boot from a partition
with a filesystem anyhow.

I am not sure how one would go about getting grub-install to figure out
the grub name for the filesystem holding /boot/grub so that it can pass
the prefix, since it could be (md0)/boot/grub or (md/0)/boot/grub

So where is the bug track system?

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-28 14:45                   ` Lennart Sorensen
@ 2010-07-28 15:26                     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-07-28 15:35                       ` Lennart Sorensen
  2010-07-30 21:04                     ` Manoel Rebelo Abraches
  1 sibling, 1 reply; 18+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-07-28 15:26 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 2275 bytes --]

On 07/28/2010 05:45 PM, Lennart Sorensen wrote:
> On Wed, Jul 28, 2010 at 05:27:33PM +0300, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>   
>> On 07/23/2010 11:02 PM, Lennart Sorensen wrote:
>>     
>>> So how would one explain to grub-install that it needs part_msdos when
>>> the partition tables that the md devices are running on are of type msdos?
>>> How would one make it automatically add the correct prefix (since it
>>> needs either (hd,msdos#)/boot/grub or (md0)/boot/grub or similar added
>>> instead of the default)?  And of course finally it would have to dd to
>>> the target device, rather than just create a file and try to make the
>>> firmware boot that file.  The boot device also has to be the full disk
>>> on the IBM, not a disk,partition,file combination.
>>>   
>>>       
>> Normally it should be all autodetected. Could you file a bug report for
>> this? Could you tell the commands to reproduce it? I have a PPC box but
>> it has only one disk but a mdraid on partitions should do it.
>>     
> Well the problem appears to be that grub-install does this:
>
> # Then the partition map module.  In order to support partition-less media,
> # this command is allowed to fail (--target=fs already grants us that the
> # filesystem will be accessible).
> partmap_module=
> for x in `$grub_probe --target=partmap --device ${grub_device} 2> /dev/null`; do
>    partmap_module="$partmap_module part_$x";
> done
>
> Unfortunately there is nothing that defines ${grub_device} in the script.
> If it used the target install device, it would in fact get the right
> result.
>   
Thanks, fixed.
> Now of course another issue is that the script aborts if /boot/grub is
> not a seperate mount point.  Well on the IBM powerpc there is no reason
> to make it a seperate mount point since you can't boot from a partition
> with a filesystem anyhow.
>
> I am not sure how one would go about getting grub-install to figure out
> the grub name for the filesystem holding /boot/grub so that it can pass
> the prefix, since it could be (md0)/boot/grub or (md/0)/boot/grub
>
> So where is the bug track system?
>
>   
https://savannah.gnu.org/bugs/?group=grub


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-28 15:26                     ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-28 15:35                       ` Lennart Sorensen
  0 siblings, 0 replies; 18+ messages in thread
From: Lennart Sorensen @ 2010-07-28 15:35 UTC (permalink / raw)
  To: The development of GNU GRUB

On Wed, Jul 28, 2010 at 06:26:55PM +0300, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > Unfortunately there is nothing that defines ${grub_device} in the script.
> > If it used the target install device, it would in fact get the right
> > result.
> >   
> Thanks, fixed.

Great.

> > Now of course another issue is that the script aborts if /boot/grub is
> > not a seperate mount point.  Well on the IBM powerpc there is no reason
> > to make it a seperate mount point since you can't boot from a partition
> > with a filesystem anyhow.
> >
> > I am not sure how one would go about getting grub-install to figure out
> > the grub name for the filesystem holding /boot/grub so that it can pass
> > the prefix, since it could be (md0)/boot/grub or (md/0)/boot/grub
> >
> > So where is the bug track system?
> >
> >   
> https://savannah.gnu.org/bugs/?group=grub

I guess I can create a bug about grub-install on IBM powerpc machines
along with details of how to make it actually boot.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-28 14:45                   ` Lennart Sorensen
  2010-07-28 15:26                     ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-30 21:04                     ` Manoel Rebelo Abraches
  2010-08-09 15:44                       ` Lennart Sorensen
  1 sibling, 1 reply; 18+ messages in thread
From: Manoel Rebelo Abraches @ 2010-07-30 21:04 UTC (permalink / raw)
  To: The development of GNU GRUB

On Wed, 2010-07-28 at 10:45 -0400, Lennart Sorensen wrote:
> On Wed, Jul 28, 2010 at 05:27:33PM +0300, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > On 07/23/2010 11:02 PM, Lennart Sorensen wrote:
> > > So how would one explain to grub-install that it needs part_msdos when
> > > the partition tables that the md devices are running on are of type msdos?
> > > How would one make it automatically add the correct prefix (since it
> > > needs either (hd,msdos#)/boot/grub or (md0)/boot/grub or similar added
> > > instead of the default)?  And of course finally it would have to dd to
> > > the target device, rather than just create a file and try to make the
> > > firmware boot that file.  The boot device also has to be the full disk
> > > on the IBM, not a disk,partition,file combination.
> > >   
> > Normally it should be all autodetected. Could you file a bug report for
> > this? Could you tell the commands to reproduce it? I have a PPC box but
> > it has only one disk but a mdraid on partitions should do it.
> 
> Well the problem appears to be that grub-install does this:
> 
> # Then the partition map module.  In order to support partition-less media,
> # this command is allowed to fail (--target=fs already grants us that the
> # filesystem will be accessible).
> partmap_module=
> for x in `$grub_probe --target=partmap --device ${grub_device} 2> /dev/null`; do
>    partmap_module="$partmap_module part_$x";
> done
> 
> Unfortunately there is nothing that defines ${grub_device} in the script.
> If it used the target install device, it would in fact get the right
> result.
> 
> Now of course another issue is that the script aborts if /boot/grub is
> not a seperate mount point.  Well on the IBM powerpc there is no reason
> to make it a seperate mount point since you can't boot from a partition
> with a filesystem anyhow.
OF can understand FAT12 filesystem. So the procedure is to mount a FAT12 partition in /boot/grub and then run
grub-install (I have done this before and I boot trough the FAT12
partition). You could do something like:

boot hd:1,grub


> I am not sure how one would go about getting grub-install to figure out
> the grub name for the filesystem holding /boot/grub so that it can pass
> the prefix, since it could be (md0)/boot/grub or (md/0)/boot/grub
> 
> So where is the bug track system?
> 




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: grub2 on power6 box.
  2010-07-30 21:04                     ` Manoel Rebelo Abraches
@ 2010-08-09 15:44                       ` Lennart Sorensen
  0 siblings, 0 replies; 18+ messages in thread
From: Lennart Sorensen @ 2010-08-09 15:44 UTC (permalink / raw)
  To: The development of GNU GRUB

On Fri, Jul 30, 2010 at 06:04:57PM -0300, Manoel Rebelo Abraches wrote:
> OF can understand FAT12 filesystem. So the procedure is to mount a FAT12 partition in /boot/grub and then run
> grub-install (I have done this before and I boot trough the FAT12
> partition). You could do something like:
> 
> boot hd:1,grub

Doesn't work on an IBM pSeries.  So it seems _some_ OF designs support
FAT12.  IBMs does not or at least not with that syntax.

FAT12 didn't help.  It simply won't do it.  Putting grub raw on a PReP
boot partition does work though.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-08-09 15:44 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-22 21:23 grub2 on power6 box Lennart Sorensen
2010-07-23  5:56 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-23 13:57   ` Lennart Sorensen
2010-07-23 15:39     ` Lennart Sorensen
2010-07-23 17:02       ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-23 17:36         ` Lennart Sorensen
2010-07-23 17:56           ` Lennart Sorensen
2010-07-23 18:35             ` Lennart Sorensen
2010-07-23 20:02               ` Lennart Sorensen
2010-07-28 14:27                 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-28 14:45                   ` Lennart Sorensen
2010-07-28 15:26                     ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-28 15:35                       ` Lennart Sorensen
2010-07-30 21:04                     ` Manoel Rebelo Abraches
2010-08-09 15:44                       ` Lennart Sorensen
2010-07-23 17:28       ` Manoel Rebelo Abraches
2010-07-23 17:46         ` Lennart Sorensen
2010-07-23 18:08           ` Lennart Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.