]> spindle.queued.net Git - xodist/blob - configs/debxo-gnome/hooks
debxo: drop vestigial custom kernel packages
[xodist] / configs / debxo-gnome / hooks
1 # Default hooks - copy & customize this for a new image build
2 #
3 # Copyright © 2008-2009  Andres Salomon <dilinger@collabora.co.uk>
4 #
5 # This file is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 customize_chroot_hook()
20 {
21         ROOT_DIR="$1"
22
23         # Any customizations that need to be made to the chroot after the base system
24         # has been installed (but prior to custom package installation) should be
25         # put here.  $ROOT_DIR should be prefixed to any paths.
26         
27         # OFW needs this to boot w/ partitions
28         ln -s . ${ROOT_DIR}/boot/boot
29         
30         # XOs are slow and small; don't use pdiffs and don't install recommends
31 cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
32 Acquire::Pdiffs "false";
33 APT::Install-Recommends "false";
34 EOF
35 }
36
37 package_configure_hook()
38 {
39         ROOT_DIR="$1"
40
41         # Any customizations that need to be made after all packages have been
42         # installed should be put here.  $ROOT_DIR should be prefixed to any
43         # paths.
44
45
46         # Ensure certain modules get loaded during boot
47         cat >>${ROOT_DIR}/etc/modules<<EOF
48 lxfb
49 fbcon
50 olpc_dcon
51 scx200_acb
52 i8042
53 olpc_battery
54 msr
55 EOF
56
57         # UBIFS needs this
58         cat >>${ROOT_DIR}/etc/initramfs-tools/modules<<EOF
59 ubi mtd=root
60 EOF
61
62         # install some custom packages that aren't on mirrors.  ugly hack!
63         k="http://lunge.queued.net/~dilinger/debxo-0.2/ofw-config_0.1_all.deb"
64         mkdir -p cache
65         for i in $k; do
66                 pkg=$(basename ${i})
67                 wget --continue -O cache/${pkg} ${i}
68                 cp cache/${pkg} ${ROOT_DIR}/${pkg}
69                 (chroot ${ROOT_DIR} dpkg -i /${pkg})
70                 pkgbase=$(echo $pkg | cut -d_ -f1)
71                 echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
72                 rm -f ${ROOT_DIR}/${pkg}
73         done
74
75         # Create an Xorg.conf that overrides the default DPI (x bug workaround).
76         cat >${ROOT_DIR}/etc/X11/xorg.conf<<EOF
77 Section "Monitor"
78         Identifier "Monitor0"
79         DisplaySize 200 150
80 EndSection
81
82 Section "Screen"
83         Identifier "Default Screen"
84         Monitor "Monitor0"
85 EndSection
86 EOF
87
88         # configure gnome
89         if [ -d ${ROOT_DIR}/etc/gconf/2 ]; then
90                 cat >${ROOT_DIR}/etc/gconf/2/local-defaults.path<<EOF
91 # DebXO defaults (customized for the XO-1's display
92 xml:readonly:/etc/gconf/debxo.xml.defaults
93 EOF
94                 mkdir -p ${ROOT_DIR}/etc/gconf/debxo.xml.defaults
95                 cp %gconf-tree.xml ${ROOT_DIR}/etc/gconf/debxo.xml.defaults/
96         fi
97
98         # configure gdm
99         if [ -d ${ROOT_DIR}/etc/gdm ]; then
100                 sed -i "s_\[daemon\]_\[daemon\]\n\nGreeter=/usr/lib/gdm/gdmlogin\n\nAutomaticLoginEnable=true\n\nAutomaticLogin=${DEFUSER}_" ${ROOT_DIR}/etc/gdm/gdm.conf
101         fi
102
103 }
104
105 cleanup_chroot_hook()
106 {
107         ROOT_DIR="$1"
108
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
111         # paths.
112 }