File: olpc.fth

package info (click to toggle)
flash-kernel 3.109
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 736 kB
  • sloc: sh: 534; makefile: 36
file content (41 lines) | stat: -rw-r--r-- 1,137 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
\ OLPC XO boot script

: check-ofw-version ( -- )
   " /" find-device " compatible" get-property
   abort" No compatible property on /" ( -- compatible$ )

   \ Good compatible strings
   " mrvl,mmp2"    2over sindex -1 <>  if  2drop exit  then
   " marvell,mmp3" 2over sindex -1 <>  if  2drop exit  then

   \ Try to be helpful
   cr
   " olpc,xo-1.75" 2swap sindex -1 <>  if
     ." Firmware Q4E00 or newer is needed to boot a Devicetree enabled kernel." cr
     cr
     ." One way to update is to copy http://dev.laptop.org/~quozl/q4e00ja.rom" cr
     ." to a FAT partition on a USB flash stick and run ""flash u:\q4e00ja.rom""" cr
     " show-sad" eval
   else
     ." This hardware or firmware revision is not supported. Sorry." cr
   then
   cr
   ." Aborting boot." cr
   abort
;

: set-model
   \ Make sure the model is sensible -- flash-kernel relies on this.
   " model" delete-property
   " OLPC XO-1.75" " model" string-property
;

visible unfreeze
check-ofw-version
set-model

" last:\@@KERNEL@@" to boot-device
" last:\@@INITRD@@" to ramdisk
" @@LINUX_KERNEL_CMDLINE_DEFAULTS@@ @@LINUX_KERNEL_CMDLINE@@" to boot-file

boot