]> spindle.queued.net Git - xodist/blobdiff - functions.sh
add xterm for erikg
[xodist] / functions.sh
index cdf2b2825f1a114a600b3a03245ae0425fcc7f6c..ab7dbe58bfd5005234f41c7a7314d034e1a90250 100644 (file)
@@ -36,13 +36,17 @@ create_fstab()
        fstype="$2"
 
        if [ "${fstype}" = "jffs2" ]; then
-               r=mtd0
+               r=mtd:root
        else
-               r="LABEL=OLPCRoot"
+               r="LABEL=${IMG_LABEL}"
        fi
 
-       cat >${mntpt}/etc/fstab<<EOF
-${r} / ${fstype} defaults,noatime 1 1
+       echo "${r} / ${fstype} defaults,noatime 1 1" >${mntpt}/etc/fstab
+       if [ "${fstype}" = "jffs2" ]; then
+               echo "mtd:boot /boot jffs2 defaults,noatime 1 1" >>${mntpt}/etc/fstab
+       fi
+
+       cat >>${mntpt}/etc/fstab<<EOF
 devpts /dev/pts devpts gid=5,mode=620 0 0
 tmpfs /dev/shm tmpfs defaults,size=15% 0 0
 proc /proc proc defaults 0 0
@@ -60,25 +64,36 @@ create_ofwboot()
        fstype="$2"
 
        if [ "${fstype}" = "jffs2" ]; then
-               r=mtd0
+               r="mtd:root"
                rfs="rootfstype=jffs2"
-               dev=nand
        else
-               r=/dev/sda1
+               r="LABEL=${IMG_LABEL}"
                rfs=""
-               dev=disk
        fi
 
        cat >${mntpt}/boot/olpc.fth<<EOF
 \\ OLPC boot script
 
+\\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval\$ )
+    get-encoded-string                            ( bootpath\$ )
+    [char] \ left-parse-string  2nip              ( dn\$ )
+
+    \ store the first part of bootpath (up to the '\\') in \$DN
+    dn-buf place                                  ( )
+  then
+then
+
 " ro root=${r} ${rfs} video=lxfb fbcon=font:SUN12x22" to boot-file
 game-key-mask h# 80 and if
        \\ boot from backup kernel
-       " ${dev}:\\vmlinuz.old" to boot-device
+       " \${DN}\\vmlinuz.old" expand\$ to boot-device
+       " \${DN}\\initrd.img.old" expand\$ to ramdisk
 else
        \\ boot from regular kernel
-       " ${dev}:\\vmlinuz" to boot-device
+       " \${DN}\\vmlinuz" expand\$ to boot-device
+       " \${DN}\\initrd.img" expand\$ to ramdisk
 then
 boot
 EOF