Package liveusb :: Module olpc
[hide private]
[frames] | no frames]

Source Code for Module liveusb.olpc

 1  # Open Firmware Configuration for the OLPC 
 2  ofw_config = """\ 
 3  \ Boot script for USB boot 
 4  \ Authors: Mitch Bradley <wmb AT laptop DOT org> 
 5  patch 2drop erase claim-params 
 6  : high-ramdisk  ( -- ) 
 7  cv-load-ramdisk 
 8  h# 22c +lp l@ 1+   memory-limit  umin  /ramdisk -  ( new-ramdisk-adr ) 
 9  ramdisk-adr over  /ramdisk move                    ( new-ramdisk-adr ) 
10  to ramdisk-adr 
11  ; 
12  ' high-ramdisk to load-ramdisk 
13   
14  : set-bootpath-dev  ( -- ) 
15  " /chosen" find-package  if                       ( phandle ) 
16    " bootpath" rot  get-package-property  0=  if  ( propval$ ) 
17       get-encoded-string                          ( bootpath$ ) 
18       [char] \ left-parse-string  2nip            ( dn$ ) 
19       dn-buf place                                ( ) 
20    then 
21  then 
22   
23  " /sd"  dn-buf  count  sindex  0>=   if 
24        " sd:" 
25  else 
26        " u:" 
27  then 
28  " BOOTPATHDEV" $set-macro 
29  ; 
30   
31  set-bootpath-dev 
32  " %s" to boot-file 
33  " ${BOOTPATHDEV}\syslinux\initrd0.img" expand$ to ramdisk 
34  " ${BOOTPATHDEV}\syslinux\\vmlinuz0" expand$ to boot-device 
35  unfreeze 
36  boot 
37  """ 
38