]> spindle.queued.net Git - xodist/blobdiff - initchroot.sh
sugar: add unzip to the list of packages
[xodist] / initchroot.sh
index 542a1d78eadf04e8f62cb053bd282717607b6f7b..2808620369f970fe5b17fadc323936b7972e7f17 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
 #
 # Copyright © 2008  Andres Salomon <dilinger@queued.net>
 #
@@ -22,7 +22,7 @@ APT_SOURCES="deb http://http.us.debian.org/debian/ lenny main contrib non-free
 deb http://security.debian.org/ lenny/updates main contrib non-free"
 LOCAL_APT_MIRROR=
 
-. functions.sh
+. ./functions.sh
 
 usage()
 {
@@ -85,6 +85,8 @@ if [ -d "${ROOT_DIR}" ]; then
        usage
 fi
 
+start_logging $ROOT_DIR
+
 check_for_cmds debootstrap || exit 1
 
 if [ -z "${LOCAL_APT_MIRROR}" ]; then
@@ -147,7 +149,9 @@ echo "en_US.UTF-8 UTF-8" >${ROOT_DIR}/etc/locale.gen
 
 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"
+ http://lunge.mit.edu/~dilinger/debxo-0.4/linux-2.6.25.15_2.6.25.15-165_i386.deb 
+ http://lunge.mit.edu/~dilinger/debxo-0.5/xserver-xorg-video-geode_2.11.0-0.3_i386.deb 
+ http://lunge.mit.edu/~dilinger/debxo-0.5/autox_0.1_all.deb"
 mkdir -p cache
 for i in $k; do
        pkg=$(basename ${i})
@@ -158,6 +162,10 @@ for i in $k; do
        echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
        rm -f ${ROOT_DIR}/${pkg}
 done
+# take the geode driver off hold
+echo xserver-xorg-video-geode install | (chroot ${ROOT_DIR} dpkg --set-selections)
+# take autox off hold
+echo autox install | (chroot ${ROOT_DIR} dpkg --set-selections)
 
 # ensure certain modules get loaded during boot
 cat >>${ROOT_DIR}/etc/modules<<EOF
@@ -166,45 +174,27 @@ fbcon
 olpc_dcon
 scx200_acb
 i8042
+olpc_battery
+msr
 EOF
 
 # install packages
 (chroot ${ROOT_DIR} aptitude install -y `grep --invert-match '^#' ${PLIST}`)
 
-# configure X
-if [ -d ${ROOT_DIR}/etc/X11 ]; then
-    cat >${ROOT_DIR}/etc/X11/xorg.conf<<EOF
-# xorg.conf (X.Org X Window System server configuration file)
-
-Section "Monitor"
-       Identifier "Configured Monitor"
-       HorizSync 30-67
-       VertRefresh 48-52
-       DisplaySize 152 114
-       Mode "1200x900"
-               DotClock 57.275
-               HTimings 1200 1208 1216 1240
-               VTimings 900 905 908 912
-               Flags "-HSync" "-VSync"
-       EndMode
-EndSection
-
-Section "Screen"
-       Identifier "Default Screen"
-       Monitor "Configured Monitor"
-EndSection
-EOF
-fi
+# no longer a need for xorg.conf
+rm -f ${ROOT_DIR}/etc/X11/xorg.conf
 
-# configure kdm, kde
-if [ -d ${ROOT_DIR}/etc/kde3/kdm ]; then
-    sed --in-place "s/AllowNullPasswd=false/AllowNullPasswd=true/;s/#AutoLoginEnable=true/AutoLoginEnable=true/;s/#AutoLoginUser=fred/AutoLoginUser=${DEFUSER}/" ${ROOT_DIR}/etc/kde3/kdm/kdmrc
+# key bindings/mappings
+if [ -d ${ROOT_DIR}/usr/share/hal/fdi/information/10freedesktop/ ]; then
+    cp 30-keymap-olpc.fdi ${ROOT_DIR}/usr/share/hal/fdi/information/10freedesktop/
 fi
 
-# configure gdm, gnome
-if [ -d ${ROOT_DIR}/etc/gdm ]; then
-    sed -i "s_\[daemon\]_\[daemon\]\n\nGreeter=/usr/lib/gdm/gdmlogin\n\nAutomaticLoginEnable=true\n\nAutomaticLogin=${DEFUSER}_" ${ROOT_DIR}/etc/gdm/gdm.conf
+# configure autox
+if [ -f ${ROOT_DIR}/etc/default/autox ]; then
+    sed --in-place "s/USER=$/USER=${DEFUSER}/" ${ROOT_DIR}/etc/default/autox
 fi
+
+# configure gnome
 if [ -d ${ROOT_DIR}/etc/gconf/2 ]; then
     cat >${ROOT_DIR}/etc/gconf/2/local-defaults.path<<EOF
 # DebXO defaults (customized for the XO-1's display
@@ -238,13 +228,23 @@ 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
 
+# run any local postinstall scripts for the build
+PLIST_DIR=${PLIST/.packages/}
+if [ -d ${PLIST_DIR} ]; then
+    if [ -x ${PLIST_DIR}/postinst.sh ]; then
+       ${PLIST_DIR}/postinst.sh ${ROOT_DIR}
+    fi
+    if [ -x ${PLIST_DIR}/postinst-local.sh ]; then
+       ${PLIST_DIR}/postinst-local.sh ${ROOT_DIR}
+    fi
+fi
+
 # override sources.list with shipping version
 printf "${APT_SOURCES}\n" >${ROOT_DIR}/etc/apt/sources.list
 (chroot ${ROOT_DIR} aptitude update)