]> spindle.queued.net Git - xodist/blob - configs/debxo-xfce/hooks
debxo: drop vestigial custom kernel packages
[xodist] / configs / debxo-xfce / hooks
1 #
2 # Copyright © 2008-2009  Andres Salomon <dilinger@collabora.co.uk>
3 #
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.
8 #
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.
13 #
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.
17
18 customize_chroot_hook()
19 {
20         ROOT_DIR="$1"
21
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.
25         
26         # OFW needs this to boot w/ partitions
27         ln -s . ${ROOT_DIR}/boot/boot
28
29         # XOs are slow and small; don't use pdiffs and don't install recommends
30 cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
31 Acquire::Pdiffs "false";
32 APT::Install-Recommends "false";
33 EOF
34 }
35
36 package_configure_hook()
37 {
38         ROOT_DIR="$1"
39
40         # Any customizations that need to be made after all packages have been
41         # installed should be put here.  $ROOT_DIR should be prefixed to any
42         # paths.
43
44
45         # Ensure certain modules get loaded during boot
46         cat >>${ROOT_DIR}/etc/modules<<EOF
47 lxfb
48 fbcon
49 olpc_dcon
50 scx200_acb
51 i8042
52 olpc_battery
53 msr
54 EOF
55
56         # UBIFS needs this
57         cat >>${ROOT_DIR}/etc/initramfs-tools/modules<<EOF
58 ubi mtd=root
59 EOF
60
61         # install some custom packages that aren't on mirrors.  ugly hack!
62         k="http://lunge.queued.net/~dilinger/debxo-0.2/ofw-config_0.1_all.deb"
63         mkdir -p cache
64         for i in $k; do
65                 pkg=$(basename ${i})
66                 wget --continue -O cache/${pkg} ${i}
67                 cp cache/${pkg} ${ROOT_DIR}/${pkg}
68                 (chroot ${ROOT_DIR} dpkg -i /${pkg})
69                 pkgbase=$(echo $pkg | cut -d_ -f1)
70                 echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
71                 rm -f ${ROOT_DIR}/${pkg}
72         done
73
74         # Create an Xorg.conf that overrides the default DPI (x bug workaround).
75         cat >${ROOT_DIR}/etc/X11/xorg.conf<<EOF
76 Section "Monitor"
77         Identifier "Monitor0"
78         DisplaySize 200 150
79 EndSection
80
81 Section "Screen"
82         Identifier "Default Screen"
83         Monitor "Monitor0"
84 EndSection
85 EOF
86
87         # configure nodm
88         F=${ROOT_DIR}/etc/default/nodm
89         if [ -f ${F} ]; then
90                 sed --in-place "s/NODM_USER=.*$/NODM_USER=${DEFUSER}/" ${F}
91                 sed --in-place "s/NODM_ENABLED=.*$/NODM_ENABLED=true/" ${F}
92         fi
93
94         # configure wicd
95         F=${ROOT_DIR}/etc/wicd/manager-settings.conf
96         # there's no actual config file in the package; it's autocreated or something.  ugh.
97         cp wicd-manager-settings.conf ${F}
98 #       if [ -f ${F} ]; then
99 #               sed --in-place "s/wireless_interface =.*$/wireless_interface = wlan0/" ${F}
100 #               sed --in-place "s/wired_inferface =.*$/wired_interface = eth0/" ${F}
101 #               # auto-connect to wired
102 #               sed --in-place "s/prefer_wired =.*$/prefer_wired = True/" ${F}
103 #               sed --in-place "s/wired_connect_mode =.*$/wired_connect_mode = 0/" ${F}
104 #       fi
105
106 }
107
108 cleanup_chroot_hook()
109 {
110         ROOT_DIR="$1"
111
112         # Any customizations that need to be made after the chroot creation is
113         # complete should be put here.  $ROOT_DIR should be prefixed to any
114         # paths.
115 }