All of lore.kernel.org
 help / color / mirror / Atom feed
* grub on ppc -- a CHRP script
@ 2005-05-25 16:49 Maurizio Boriani
  2005-05-26  1:30 ` Hollis Blanchard
  2005-05-26  6:47 ` Marco Gerards
  0 siblings, 2 replies; 8+ messages in thread
From: Maurizio Boriani @ 2005-05-25 16:49 UTC (permalink / raw)
  To: Grub Devel


Hi,
        I'm back after a period of hard work :)

I tried grub2 on my ppc (apple iBook g3) but I don't
like to change openfw boot-device var every time (I use
the same laptop for my daily stuff) as suggested in
grub wiki. 

So written a CHRP script which permit to choose 
yaboot or GRUB2, here it is:

-- cut

<CHRP-BOOT>
<COMPATIBLE>
MacRISC MacRISC3 MacRISC4
</COMPATIBLE>
<BOOT-SCRIPT>
: bx-boot-opts 2 ;
: bx-boot-wait d# 100 ; \ unit = 100 ms
: bx-boot-defopt 1 ;
: bx-display-menu ( -- )
  ." Boot Loaders menu"		cr
  ." 1: yaboot"			cr
  ." 2: GRUB2"			cr
;
: bx-boot-choose ( num -- )
  case
    1 of " /pci@f2000000/mac-io@17/ata-4@1f000/disk@0:2,\\yaboot"		endof
    2 of " /pci@f2000000/mac-io@17/ata-4@1f000/disk@0:2,\\grubof.modules"	endof
  endcase
  ['] $boot catch drop
  user-abort
;
: bx-read-num ( wait-period max-boot-num def-opt -- boot-num )
  1 \ loop-inc = 1
  3 pick 0 do
    0d emit
    ." press 1-"
    ( wait-period max-boot-num def-opt loop-inc )
    2 pick ascii 0 + emit
    dup 1 = if
      ."  within "
      3 pick i - d# 10 / .d
      ."  seconds"
    then
    ."  (default: "
    over ascii 0 + emit
    ." ) :                   "
    d# 100 ms
    key? if
       key
       ( wait-period max-boot-num def-opt loop-inc key )
       dup 0d = if \ return pressed
         drop leave
       then

       ascii 0 -
       ( wait-period max-boot-num def-opt loop-inc num )
       dup 0 5 pick
       ( wait-period max-boot-num def-opt loop-inc num num 0 max-boot-num )
       between if
         rot drop swap leave
       then

       ( wait-period max-boot-num def-opt loop-inc num )
       2drop 0  \ loop-inc = 0
    then
  dup +loop
  drop
  ( wait-period max-boot-num boot-num )
  nip nip
;

load-base release-load-area
stdout @ 0 = if
  false to _normal-boot install-console
then
true to use-console? false to ignore-output?
dev /multiboot
  flash-dev-icon-off
device-end
erase-screen

bx-display-menu
bx-boot-wait bx-boot-opts bx-boot-defopt bx-read-num
bx-boot-choose
</BOOT-SCRIPT>
</CHRP-BOOT>

-- cut

using hfs tools, overwrite this (after fix it with
your disk real path) on ofboot.b installed by
yaboot (use 'hcopy -r' and 'hattrib' to fix attributes),
reboot and a boot loader chooser will be displayed.

An example :

hmount /dev/<hfs partition"
hrcopy -r myofboot.b :ofboot.b
hrcopy -r grubof.modules :grubof.modules
hrcopy -r grub.cfg :grub.cfg

hattrib -t tbxi -c UNIX :ofboot.b
hattrib -t boot -c UNIX :grubof.modules
hattrib -t conf -c UNIX :grub.cfg

hattrib -b :
humount

This works for me, let me know if something wrong on your
hosts.

If someone isn't already doing, I'm going to write a reiserfs
module (let me know). 

Also what about multiboot specification support in grub2? 
Is available (on ppc and ia32)? If not why ? :)

thanks,


-- 
Maurizio Boriani 
GPG key: 0xCC0FBF8F
 => E429 A37C 5259 763C 9DEE  FC8B 5D61 C796 CC0F BF8F <=




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

end of thread, other threads:[~2005-06-21 12:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-25 16:49 grub on ppc -- a CHRP script Maurizio Boriani
2005-05-26  1:30 ` Hollis Blanchard
2005-05-26  6:50   ` Marco Gerards
2005-05-26  6:47 ` Marco Gerards
2005-05-26  7:26   ` Maurizio Boriani
2005-06-20  9:34     ` Maurizio Boriani
2005-06-21  2:58     ` PPC multiboot Hollis Blanchard
2005-06-21 11:46       ` Marco Gerards

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.