# create chroot
debootstrap --arch i386 lenny ${ROOT_DIR} http://http.us.debian.org/debian
+mkdir ${ROOT_DIR}/ofw
+mkdir ${ROOT_DIR}/var/cache/apt/cache
mount -t proc proc ${ROOT_DIR}/proc
mount -t devpts devpts ${ROOT_DIR}/dev/pts
-mkdir ${ROOT_DIR}/ofw
+mount -t tmpfs tmpfs ${ROOT_DIR}/var/cache/apt/cache
# allow daemons to be installed without breaking
mv ${ROOT_DIR}/sbin/start-stop-daemon ${ROOT_DIR}/sbin/start-stop-daemon.REAL
EOF
chmod 755 ${ROOT_DIR}/sbin/start-stop-daemon
-# set up apt
+# set up apt (working around #314334)
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_PRIORITY=critical
cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
Acquire::Pdiffs "false";
APT::Install-Recommends "false";
+Dir {
+ Cache "var/cache/apt/" {
+ srcpkgcache "cache/srcpkgcache.bin";
+ pkgcache "cache/pkgcache.bin";
+ };
+};
EOF
cat >${ROOT_DIR}/etc/apt/sources.list<<EOF
deb http://http.us.debian.org/debian ${DIST} main contrib non-free
EndSection
EOF
+# configure gdm, gnome
+sed -i 's_\[daemon\]_\[daemon\]\n\nGreeter=/usr/lib/gdm/gdmlogin\n\nAutomaticLoginEnable=true\n\nAutomaticLogin=olpc_' ${ROOT_DIR}/etc/gdm/gdm.conf
+cat >${ROOT_DIR}/etc/gconf/2/local-defaults.path<<EOF
+# DebXO defaults (customized for the XO-1's display
+xml:readonly:/etc/gconf/debxo.xml.defaults
+EOF
+mkdir -p ${ROOT_DIR}/etc/gconf/debxo.xml.defaults
+cp %gconf-tree.xml ${ROOT_DIR}/etc/gconf/debxo.xml.defaults/
+
# add default user
-rm -rf ${ROOT_DIR}/home/*; # i have no idea what's adding this crap...
(chroot ${ROOT_DIR} passwd -l root)
+rm -rf ${ROOT_DIR}/home/*; # i have no idea what's adding this crap...
(chroot ${ROOT_DIR} useradd -s /bin/bash --create-home ${DEFUSER})
(chroot ${ROOT_DIR} passwd -d ${DEFUSER})
(chroot ${ROOT_DIR} adduser ${DEFUSER} cdrom)
(chroot ${ROOT_DIR} aptitude clean)
umount ${ROOT_DIR}/proc
umount ${ROOT_DIR}/dev/pts
+umount ${ROOT_DIR}/var/cache/apt/cache