]> spindle.queued.net Git - xodist/blobdiff - functions.sh
Add --distribution option to choose which distribution of Debian to use.
[xodist] / functions.sh
index 00a23a4370d11dfd293b2a70274ad9934cd7e01b..a16686767aab714ee13852018794477301f85a7e 100644 (file)
@@ -47,8 +47,8 @@ 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
 sysfs /sys sysfs defaults 0 0
-tmpfs /var/cache/apt/cache tmpfs defaults 0 0
 none /ofw promfs defaults 0 0
+tmpfs /var/cache/apt/cache tmpfs defaults 0 0
 EOF
 }
 
@@ -62,9 +62,11 @@ create_ofwboot()
        if [ "${fstype}" = "jffs2" ]; then
                r=mtd0
                rfs="rootfstype=jffs2"
+               dev=nand
        else
                r=/dev/sda1
                rfs=""
+               dev=disk
        fi
 
        cat >${mntpt}/boot/olpc.fth<<EOF
@@ -73,11 +75,27 @@ create_ofwboot()
 " ro root=${r} ${rfs} fbcon=font:SUN12x22" to boot-file
 game-key-mask h# 80 and if
        \\ boot from backup kernel
-       " nand:\\vmlinuz.old" to boot-device
+       " ${dev}:\\vmlinuz.old" to boot-device
 else
        \\ boot from regular kernel
-       " nand:\\vmlinuz" to boot-device
+       " ${dev}:\\vmlinuz" to boot-device
 then
 boot
 EOF
 }
+
+chroot_internal_mounts()
+{
+    root_dir="$1"
+    mount -t proc proc ${root_dir}/proc
+    mount -t devpts devpts ${root_dir}/dev/pts
+    mount -t tmpfs tmpfs ${root_dir}/var/cache/apt/cache
+}
+
+chroot_internal_umounts()
+{
+    root_dir="$1"
+    umount ${root_dir}/proc
+    umount ${root_dir}/dev/pts
+    umount ${root_dir}/var/cache/apt/cache
+}