]> spindle.queued.net Git - xodist/blobdiff - functions.sh
initchroot: sugar workaround can go away now
[xodist] / functions.sh
index 29d4ae99eaf954c1cce6bc394ba7bbb719375ec0..4e1e0c98ee12fa41f5057dfef61a31dfe840b70d 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
 #
 # Copyright © 2008  Andres Salomon <dilinger@queued.net>
 #
@@ -36,13 +36,17 @@ create_fstab()
        fstype="$2"
 
        if [ "${fstype}" = "jffs2" ]; then
-               r=mtd0
+               r=mtd:root
        else
                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,7 +64,7 @@ create_ofwboot()
        fstype="$2"
 
        if [ "${fstype}" = "jffs2" ]; then
-               r=mtd0
+               r="mtd:root"
                rfs="rootfstype=jffs2"
        else
                r="LABEL=${IMG_LABEL}"
@@ -91,6 +95,7 @@ else
        " \${DN}\\vmlinuz" expand\$ to boot-device
        " \${DN}\\initrd.img" expand\$ to ramdisk
 then
+dcon-unfreeze
 boot
 EOF
 }
@@ -110,3 +115,13 @@ chroot_internal_umounts()
     umount ${root_dir}/dev/pts
     umount ${root_dir}/var/cache/apt/cache
 }
+
+start_logging()
+{
+    logpipe="$1".pipe
+    trap "rm -f $logpipe" 0
+    mknod $logpipe p
+    tee "$1".log <$logpipe &
+    trap "kill $!; rm -f $logpipe" 0
+    exec >$logpipe 2>&1
+}