olpc.fth 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. \ OLPC XO boot script
  2. : (visible) " unfreeze visible" evaluate ;
  3. ' (visible) catch drop forget (visible)
  4. " /aliases" find-device " last" get-property
  5. abort" No last alias"
  6. " /pci/sd@c" 2over substring? if " root=/dev/mmcblk0p1 " to boot-file then
  7. " /sd/sdhci@d4280000" 2over substring? if " root=/dev/mmcblk1p1 " to boot-file then
  8. " /pci/usb@" 2over substring? if " root=/dev/sda1 " to boot-file then
  9. " /usb@" 2over substring? if " root=/dev/sda1 " to boot-file then
  10. 2drop
  11. root-device " compatible" get-property dend if 0 0 then ( compatible$ )
  12. " olpc,xo-1.75" 2over sindex -1 > if ( compatible$ )
  13. \ Version check on XO-1.75
  14. " mrvl,mmp2" 2over sindex -1 = if ( compatible$ )
  15. 2drop ( )
  16. cr
  17. ." Firmware Q4E00 or newer is needed to boot a Devicetree enabled kernel." cr
  18. cr
  19. ." One way to update is to copy http://dev.laptop.org/~quozl/q4e00ja.rom" cr
  20. ." to a FAT partition on a USB flash stick and run ""flash u:\q4e00ja.rom""" cr
  21. cr
  22. ." Aborting boot." cr
  23. " show-sad" evaluate
  24. abort
  25. then
  26. then ( compatible$ )
  27. " mmp" 2swap sindex -1 > if
  28. \ A Marvell MMP-based machine
  29. " last:\boot\zImage" to boot-device
  30. boot-file " console=ttyS2,115200 " $cat2 to boot-file
  31. else
  32. \ Assume XO-1
  33. " last:\boot\bzImage" to boot-device
  34. boot-file " console=ttyS0,115200 reboot=pci " $cat2 to boot-file
  35. then
  36. \ Pick a terminal that looks better on the XO screen
  37. root-device " architecture" get-property dend if 0 0 else 1- then
  38. " OLPC" $= if boot-file " fbcon=font:TER16x32 vt.color=0xf0 " $cat2 to boot-file then
  39. boot-file " console=tty0 rootwait" $cat2 to boot-file
  40. boot