]> spindle.queued.net Git - xodist/blobdiff - initchroot.sh
fix bashism w/ inclusion of functions.sh
[xodist] / initchroot.sh
index d6571705bceb783159b332b824dd8c3a5c6fe4c2..7edff438896ef27132e7a378de668c747510d47d 100755 (executable)
@@ -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()
 {
@@ -110,6 +110,21 @@ echo "Warning: Fake start-stop-daemon called, doing nothing"
 EOF
 chmod 755 ${ROOT_DIR}/sbin/start-stop-daemon
 
+# set up hostname stuff
+echo "debxo" > ${ROOT_DIR}/etc/hostname
+cat >${ROOT_DIR}/etc/hosts<<EOF
+127.0.0.1 localhost.localdomain localhost
+127.0.0.1 debxo
+
+# The following lines are desirable for IPv6 capable hosts
+::1     ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+ff02::3 ip6-allhosts
+EOF
+
 # set up apt (working around #314334)
 export DEBIAN_FRONTEND=noninteractive
 export DEBCONF_PRIORITY=critical
@@ -151,24 +166,12 @@ fbcon
 olpc_dcon
 scx200_acb
 i8042
-EOF
-
-echo "debxo" > ${ROOT_DIR}/etc/hostname
-cat >${ROOT_DIR}/etc/hosts<<EOF
-127.0.0.1 localhost.localdomain localhost
-127.0.0.1 debxo
-
-# The following lines are desirable for IPv6 capable hosts
-::1     ip6-localhost ip6-loopback
-fe00::0 ip6-localnet
-ff00::0 ip6-mcastprefix
-ff02::1 ip6-allnodes
-ff02::2 ip6-allrouters
-ff02::3 ip6-allhosts
+olpc_battery
+msr
 EOF
 
 # install packages
-(chroot ${ROOT_DIR} aptitude install -y `cat ${PLIST}`)
+(chroot ${ROOT_DIR} aptitude install -y `grep --invert-match '^#' ${PLIST}`)
 
 # configure X
 if [ -d ${ROOT_DIR}/etc/X11 ]; then
@@ -195,6 +198,11 @@ EndSection
 EOF
 fi
 
+# 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 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
@@ -244,6 +252,17 @@ 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)