]> spindle.queued.net Git - xodist/blobdiff - functions.sh
mkchroot.sh: break out non-olpc stuff
[xodist] / functions.sh
index ab7dbe58bfd5005234f41c7a7314d034e1a90250..89f2ff80151febb39aa1fa740f87870485ef993a 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
 #
 # Copyright © 2008  Andres Salomon <dilinger@queued.net>
 #
@@ -95,18 +95,11 @@ else
        " \${DN}\\vmlinuz" expand\$ to boot-device
        " \${DN}\\initrd.img" expand\$ to ramdisk
 then
+dcon-unfreeze
 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"
@@ -114,3 +107,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
+}