]> spindle.queued.net Git - xodist/blobdiff - initchroot.sh
release: don't bail if ext3/jffs2 directories already exist
[xodist] / initchroot.sh
index c7de2d41c5943684fa83cc3f997c173771bee09f..081801596eba66d53c2632c120989fb294688c1a 100755 (executable)
@@ -55,6 +55,10 @@ do
                ;;
        --package-list)
                PLIST=$2
+               [ -f ${PLIST} ] || {
+                       echo "Error: can't find file '${PLIST}'!" 1>&2
+                       exit 2
+               }
                shift
                ;;
        --mirror)
@@ -129,19 +133,22 @@ ${OTHERMIRROR}
 EOF
 (chroot ${ROOT_DIR} aptitude update)
 
-# set up base system
+# set up base system and base packages
 echo "en_US.UTF-8 UTF-8" >${ROOT_DIR}/etc/locale.gen
-(chroot ${ROOT_DIR} aptitude install -y locales)
+(chroot ${ROOT_DIR} aptitude install -y `cat base.packages`)
 
-k="http://lunge.mit.edu/~dilinger/debxo-0.2/initramfs-tools_0.92l.1_all.deb 
- http://lunge.mit.edu/~dilinger/debxo-0.2/linux-2.6.25.15_2.6.25.15-68_i386.deb"
+k="http://lunge.mit.edu/~dilinger/debxo-0.2/initramfs-tools_0.92l.2_all.deb 
+ http://lunge.mit.edu/~dilinger/debxo-0.2/ofw-config_0.1_all.deb 
+ http://lunge.mit.edu/~dilinger/debxo-0.3/linux-2.6.25.15_2.6.25.15-147_i386.deb"
 mkdir -p cache
 for i in $k; do
        pkg=$(basename ${i})
        wget --continue -O cache/${pkg} ${i}
        cp cache/${pkg} ${ROOT_DIR}/${pkg} 
        (chroot ${ROOT_DIR} dpkg -i /${pkg})
-       rm -f ${ROOT_DIR}/${k}
+       pkgbase=$(echo $pkg | cut -d_ -f1)
+       echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
+       rm -f ${ROOT_DIR}/${pkg}
 done
 
 # ensure certain modules get loaded during boot
@@ -227,6 +234,23 @@ rm -rf ${ROOT_DIR}/home/*;         # i have no idea what's adding this crap...
 (chroot ${ROOT_DIR} adduser ${DEFUSER} floppy)
 echo "${DEFUSER} ALL=(ALL) NOPASSWD: ALL" >> ${ROOT_DIR}/etc/sudoers
 
+# add local network interface
+cat >>${ROOT_DIR}/etc/network/interfaces<<EOF
+
+auto lo
+iface lo inet loopback
+EOF
+
+# configure sugar
+if [ -d ${ROOT_DIR}/usr/share/sugar ]; then
+    # #?
+    ln -sf /usr/share/activities/ ${ROOT_DIR}/usr/share/sugar
+    cat >> ${ROOT_DIR}/home/${DEFUSER}/.Xsession <<- EOF
+matchbox-window-manager -use_titlebar no &
+sugar
+EOF
+fi
+
 # done, clean up
 mv ${ROOT_DIR}/sbin/start-stop-daemon.REAL ${ROOT_DIR}/sbin/start-stop-daemon
 (chroot ${ROOT_DIR} aptitude clean)