olpc.fth 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. " /pci/nandflash@c" 2over substring? if " root=/dev/mtdblock0 rootfstype=jffs2 " to boot-file then
  11. 2drop
  12. root-device " compatible" get-property dend if 0 0 then ( compatible$ )
  13. " olpc,xo-1.75" 2over sindex -1 > if ( compatible$ )
  14. \ Version check on XO-1.75
  15. " mrvl,mmp2" 2over sindex -1 = if ( compatible$ )
  16. 2drop ( )
  17. cr
  18. ." Firmware Q4E00 or newer is needed to boot a Devicetree enabled kernel." cr
  19. cr
  20. ." One way to update is to copy http://dev.laptop.org/~quozl/q4e00ja.rom" cr
  21. ." to a FAT partition on a USB flash stick and run ""flash u:\q4e00ja.rom""" cr
  22. cr
  23. ." Aborting boot." cr
  24. " show-sad" evaluate
  25. abort
  26. then
  27. then ( compatible$ )
  28. " mmp" 2swap sindex -1 > if
  29. \ A Marvell MMP-based machine
  30. " last:\boot\zImage" to boot-device
  31. boot-file " console=ttyS2,115200 " $cat2 to boot-file
  32. else
  33. \ Assume XO-1
  34. " last:\boot\bzImage" to boot-device
  35. boot-file " console=ttyS0,115200 reboot=pci " $cat2 to boot-file
  36. then
  37. \ Pick a terminal that looks better on the XO screen
  38. root-device " architecture" get-property dend if 0 0 else 1- then
  39. " OLPC" $= if boot-file " fbcon=font:TER16x32 vt.color=0xf0 " $cat2 to boot-file then
  40. boot-file " console=tty0 rootwait" $cat2 to boot-file
  41. boot