- mntpt="$1"
- fstype="$2"
-
- if [ "${fstype}" = "jffs2" ]; then
- r=mtd0
- else
- r="LABEL=OLPCRoot"
- fi
-
- cat >${mntpt}/etc/fstab<<EOF
-${r} / ${fstype} defaults,noatime 1 1
-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
-none /ofw promfs defaults 0 0
-tmpfs /var/cache/apt/cache tmpfs defaults 0 0
-EOF
-}
-
-# @mntpt - path to mounted root directory
-# @fstype - the root filesystem type (in a form that 'mount' understands)
-create_ofwboot()
-{
- mntpt="$1"
- fstype="$2"
-
- 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
-\\ OLPC boot script
-
-" ro root=${r} ${rfs} fbcon=font:SUN12x22" to boot-file
-game-key-mask h# 80 and if
- \\ boot from backup kernel
- " ${dev}:\\vmlinuz.old" to boot-device
-else
- \\ boot from regular kernel
- " ${dev}:\\vmlinuz" to boot-device
-then
-boot
-EOF
+ 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