2 # Copyright © 2008-2009 Andres Salomon <dilinger@collabora.co.uk>
4 # This file is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 customize_chroot_hook()
22 # Any customizations that need to be made to the chroot after the base system
23 # has been installed (but prior to custom package installation) should be
24 # put here. $ROOT_DIR should be prefixed to any paths.
28 # OFW needs this to boot w/ partitions
29 ln -s . ${ROOT_DIR}/boot/boot
31 # Apt can't deal w/ jffs2's lack of mmap, so we keep apt's cache on tmpfs
32 # (see <http://bugs.debian.org/314334>).
33 mkdir ${ROOT_DIR}/var/cache/apt/cache
34 mount -t tmpfs tmpfs ${ROOT_DIR}/var/cache/apt/cache
35 # XOs are slow and small; don't use pdiffs, don't install recommends, and
36 # work around lack of mmap.
37 cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
38 Acquire::Pdiffs "false";
39 APT::Install-Recommends "false";
41 Cache "var/cache/apt/" {
42 srcpkgcache "cache/srcpkgcache.bin";
43 pkgcache "cache/pkgcache.bin";
51 package_configure_hook()
55 # Any customizations that need to be made after all packages have been
56 # installed should be put here. $ROOT_DIR should be prefixed to any
60 # Ensure certain modules get loaded during boot
61 cat >>${ROOT_DIR}/etc/modules<<EOF
71 # install some custom packages that aren't on mirrors. ugly hack!
72 k="http://lunge.mit.edu/~dilinger/debxo-0.2/initramfs-tools_0.92l.2_all.deb
73 http://lunge.mit.edu/~dilinger/debxo-0.2/ofw-config_0.1_all.deb
74 http://lunge.mit.edu/~dilinger/debxo-0.4/linux-2.6.25.15_2.6.25.15-165_i386.deb
75 http://lunge.mit.edu/~dilinger/debxo-0.5/xserver-xorg-video-geode_2.11.0-0.3_i386.deb"
79 wget --continue -O cache/${pkg} ${i}
80 cp cache/${pkg} ${ROOT_DIR}/${pkg}
81 (chroot ${ROOT_DIR} dpkg -i /${pkg})
82 pkgbase=$(echo $pkg | cut -d_ -f1)
83 echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
84 rm -f ${ROOT_DIR}/${pkg}
87 # take some packages that are okay to upgrade off hold
88 echo xserver-xorg-video-geode install | (chroot ${ROOT_DIR} dpkg --set-selections)
90 # No longer a need for xorg.conf
91 rm -f ${ROOT_DIR}/etc/X11/xorg.conf
93 # key bindings/mappings
94 if [ -d ${ROOT_DIR}/usr/share/hal/fdi/information/10freedesktop/ ]; then
95 cp 30-keymap-olpc.fdi ${ROOT_DIR}/usr/share/hal/fdi/information/10freedesktop/
99 if [ -d ${ROOT_DIR}/etc/kde3/kdm ]; then
100 sed --in-place "s/AllowNullPasswd=false/AllowNullPasswd=true/;s/#AutoLoginEnable=true/AutoLoginEnable=true/;s/#AutoLoginUser=fred/AutoLoginUser=${DEFUSER}/" ${ROOT_DIR}/etc/kde3/kdm/kdmrc
105 cleanup_chroot_hook()
109 # Any customizations that need to be made after the chroot creation is
110 # complete should be put here. $ROOT_DIR should be prefixed to any
113 umount ${ROOT_DIR}/var/cache/apt/cache