From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Daz80-0001G0-TL for mharc-grub-devel@gnu.org; Wed, 25 May 2005 12:53:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Daz7x-0001Dh-CY for grub-devel@gnu.org; Wed, 25 May 2005 12:53:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Daz7u-0001BV-2m for grub-devel@gnu.org; Wed, 25 May 2005 12:53:02 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Daz7t-0001Aq-Sc for grub-devel@gnu.org; Wed, 25 May 2005 12:53:01 -0400 Received: from [62.108.224.101] (helo=elisya) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Daz4R-0006ZP-Ly for grub-devel@gnu.org; Wed, 25 May 2005 12:49:28 -0400 Received: from localhost.member.fsf.org (localhost [127.0.0.1]) by elisya (Postfix) with ESMTP id 193A51AE8D for ; Wed, 25 May 2005 18:49:47 +0200 (CEST) From: Maurizio Boriani To: "Grub Devel" Date: Wed, 25 May 2005 18:49:46 +0200 Message-ID: <87ll63l07p.fsf@yahoo.it> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: grub on ppc -- a CHRP script X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2005 16:53:06 -0000 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 MacRISC MacRISC3 MacRISC4 : 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 -- 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/ E429 A37C 5259 763C 9DEE FC8B 5D61 C796 CC0F BF8F <=