\ olpc.fth
setup-smbios
unfreeze
dcon-unfreeze
visible
.( -- Tiny Core Linux boot script for OpenFirmware    ) cr
.(    by quozl@laptop.org, 2011-01-06              -- ) cr cr

: is-xo1?
   " model" " /" find-package
   drop get-package-property
   2drop c@ [char] D 
   <
;

: is-xo1.5?
   " model" " /" find-package
   drop get-package-property
   2drop c@ [char] D 
   =
;

: olpc-fth-boot-me
   " fbcon=font:SUN12x22 superuser quiet" to boot-file
   is-xo1? if
      button-o game-key? if
         " u:\boot\vmlin1.old"         expand$ to boot-device
         " u:\boot\initrd1.old"      expand$ to ramdisk
      else
         " u:\boot\vmlin1" to boot-device
         " u:\boot\initrd1" to ramdisk
      then
   else
      is-xo1.5? if
         button-o game-key? if
            " u:\boot\vmlin15.old"    expand$ to boot-device
            " u:\boot\initrd15.old" expand$ to ramdisk
         else
            " u:\boot\vmlin15"        expand$ to boot-device
            " u:\boot\initrd15"     expand$ to ramdisk
         then
      else
         ." Unrecognized / unsupport machine"
         halt
      then
   then
   \ disable pretty boot
   dcon-unfreeze
   boot
;

olpc-fth-boot-me
