]> spindle.queued.net Git - xodist/commitdiff
mkchroot.sh: break out non-olpc stuff
authorAndres Salomon <dilinger@collabora.co.uk>
Thu, 28 May 2009 23:22:04 +0000 (19:22 -0400)
committerAndres Salomon <dilinger@collabora.co.uk>
Thu, 28 May 2009 23:22:04 +0000 (19:22 -0400)
This changes the way image flavors are done; it adds a configs/ directory
that allows overriding of misc hooks.  This allows a lot more flexibility.
The package lists are now in configs/ as well (ie, gnome.packages ->
configs/debxo-gnome/packages).

Signed-off-by: Andres Salomon <dilinger@collabora.co.uk>
31 files changed:
README
awesome.packages [deleted file]
base.packages [deleted file]
configs/debxo-awesom/hooks [new file with mode: 0644]
configs/debxo-awesom/packages [new file with mode: 0644]
configs/debxo-awesom/variables [new file with mode: 0644]
configs/debxo-gnome/hooks [new file with mode: 0644]
configs/debxo-gnome/packages [new file with mode: 0644]
configs/debxo-gnome/variables [new file with mode: 0644]
configs/debxo-kde/hooks [new file with mode: 0644]
configs/debxo-kde/packages [new file with mode: 0644]
configs/debxo-kde/variables [new file with mode: 0644]
configs/debxo-lxde/hooks [new file with mode: 0644]
configs/debxo-lxde/packages [new file with mode: 0644]
configs/debxo-lxde/variables [new file with mode: 0644]
configs/debxo-sugar/hooks [new file with mode: 0644]
configs/debxo-sugar/packages [new file with mode: 0644]
configs/debxo-sugar/variables [new file with mode: 0644]
configs/debxo-xfce/hooks [new file with mode: 0644]
configs/debxo-xfce/packages [new file with mode: 0644]
configs/debxo-xfce/variables [new file with mode: 0644]
configs/generic/hooks [new file with mode: 0644]
configs/generic/packages [new file with mode: 0644]
configs/generic/variables [new file with mode: 0644]
gnome.packages [deleted file]
kde.packages [deleted file]
lxde.packages [deleted file]
mkchroot.sh
release.sh
sugar.packages [deleted file]
xfce.packages [deleted file]

diff --git a/README b/README
index 427a67aad68eab29bfb477963c133f7036616610..21add02f060b4e09423115c551b4e82a264325e4 100644 (file)
--- a/README
+++ b/README
@@ -5,7 +5,7 @@ firmware support unlike an ordinary PC.  The usual Debian boot CDs do
 not work, yet.  xodist builds a Debian system image in the format
 required by the firmware.
 
 not work, yet.  xodist builds a Debian system image in the format
 required by the firmware.
 
-See *.packages for other image flavours, and change "kde" below to the
+See configs/* for other image flavours, and change "kde" below to the
 flavour.  See README.approx before starting if you would like to cache
 the packages downloaded.
 
 flavour.  See README.approx before starting if you would like to cache
 the packages downloaded.
 
@@ -13,7 +13,7 @@ How to use xodist to generate a Debian KDE image for an OLPC XO:
 
 1.  build the root filesystem,
 
 
 1.  build the root filesystem,
 
-       sudo ./mkchroot.sh --package-list kde.packages kde.root
+       sudo ./mkchroot.sh --package-list debxo-kde kde.root
 
 2.  make the JFFS2 filesystem,
 
 
 2.  make the JFFS2 filesystem,
 
diff --git a/awesome.packages b/awesome.packages
deleted file mode 100644 (file)
index 35d8983..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-xserver-xorg-core
-xserver-xorg-input-kbd
-xserver-xorg-input-mouse
-xserver-xorg-input-evdev
-xserver-xorg-video-geode
-xfonts-100dpi
-xfonts-scalable
-xfonts-base
-x11-xserver-utils
-openssh-client
-openntpd
-diff
-bzip2
-menu
-aspell-en
-info
-manpages-dev
-rsync
-awesome
-stalonetray
-network-manager-gnome
-claws-mail
-epiphany-browser
-file-roller
-links2
-netsurf
-pidgin
-evince
-xpdf
-totem
-gstreamer0.10-ffmpeg
-gstreamer0.10-plugins-bad
-gstreamer0.10-plugins-ugly
-xchat
-irssi
-gnash
-mozilla-plugin-gnash
-# requested by erikg on #olpc-devel on 2008-11-07
-xterm
diff --git a/base.packages b/base.packages
deleted file mode 100644 (file)
index 01fb859..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-locales
-libertas-firmware
-initramfs-tools
-wireless-tools
-sudo
-less
-alsa-utils
-ttf-liberation
-xserver-xorg-video-geode
-xinit
-psmisc
-console-tools
diff --git a/configs/debxo-awesom/hooks b/configs/debxo-awesom/hooks
new file mode 100644 (file)
index 0000000..0af18b5
--- /dev/null
@@ -0,0 +1,113 @@
+#
+# Copyright © 2008-2009  Andres Salomon <dilinger@collabora.co.uk>
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+customize_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made to the chroot after the base system
+       # has been installed (but prior to custom package installation) should be
+       # put here.  $ROOT_DIR should be prefixed to any paths.
+       
+       mkdir ${ROOT_DIR}/ofw
+       
+       # Apt can't deal w/ jffs2's lack of mmap, so we keep apt's cache on tmpfs
+       # (see <http://bugs.debian.org/314334>).
+       mkdir ${ROOT_DIR}/var/cache/apt/cache
+       mount -t tmpfs tmpfs ${ROOT_DIR}/var/cache/apt/cache
+       # XOs are slow and small; don't use pdiffs, don't install recommends, and
+       # work around lack of mmap.
+cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
+Acquire::Pdiffs "false";
+APT::Install-Recommends "false";
+Dir {
+       Cache "var/cache/apt/" {
+               srcpkgcache "cache/srcpkgcache.bin";
+               pkgcache "cache/pkgcache.bin";
+       };
+};
+EOF
+
+       
+}
+
+package_configure_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after all packages have been
+       # installed should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+
+       # Ensure certain modules get loaded during boot
+       cat >>${ROOT_DIR}/etc/modules<<EOF
+lxfb
+fbcon
+olpc_dcon
+scx200_acb
+i8042
+olpc_battery
+msr
+EOF
+
+       # install some custom packages that aren't on mirrors.  ugly hack!
+       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.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})
+               wget --continue -O cache/${pkg} ${i}
+               cp cache/${pkg} ${ROOT_DIR}/${pkg}
+               (chroot ${ROOT_DIR} dpkg -i /${pkg})
+               pkgbase=$(echo $pkg | cut -d_ -f1)
+               echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
+               rm -f ${ROOT_DIR}/${pkg}
+       done
+
+       # take some packages that are okay to upgrade off hold
+       echo xserver-xorg-video-geode install | (chroot ${ROOT_DIR} dpkg --set-selections)
+       echo autox install | (chroot ${ROOT_DIR} dpkg --set-selections)
+
+       # No longer a need for xorg.conf
+       rm -f ${ROOT_DIR}/etc/X11/xorg.conf
+
+       # 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 autox
+       if [ -f ${ROOT_DIR}/etc/default/autox ]; then
+               sed --in-place "s/USER=$/USER=${DEFUSER}/" ${ROOT_DIR}/etc/default/autox
+       fi
+
+}
+
+cleanup_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after the chroot creation is
+       # complete should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+       umount ${ROOT_DIR}/var/cache/apt/cache
+}
diff --git a/configs/debxo-awesom/packages b/configs/debxo-awesom/packages
new file mode 100644 (file)
index 0000000..674ade2
--- /dev/null
@@ -0,0 +1,61 @@
+# The list of packages to install onto the image should be listed here
+# (one per line).  Aptitude is used to install these, so there are is no
+# need to explicitly list dependencies.  Packages installed by debootstrap
+# plus a few others (sudo, locales) do not need to be listed here, as they
+# are always installed.
+
+# the backend stuff
+libertas-firmware
+initramfs-tools
+wireless-tools
+alsa-utils
+console-tools
+openntpd
+
+# the silly i-always-use-this-shit stuff
+less
+psmisc
+openssh-client
+diff
+bzip2
+info
+manpages-dev
+rsync
+links2
+
+# X
+xserver-xorg-core
+xserver-xorg-input-kbd
+xserver-xorg-input-mouse
+xserver-xorg-input-evdev
+xserver-xorg-video-geode
+xfonts-100dpi
+xfonts-scalable
+xfonts-base
+x11-xserver-utils
+xinit
+xauth
+
+# the desktop stuff
+menu
+aspell-en
+ttf-liberation
+awesome
+stalonetray
+network-manager-gnome
+claws-mail
+epiphany-browser
+file-roller
+netsurf
+pidgin
+evince
+xpdf
+totem
+gstreamer0.10-ffmpeg
+gstreamer0.10-plugins-bad
+gstreamer0.10-plugins-ugly
+xchat
+irssi
+gnash
+mozilla-plugin-gnash
+xterm
diff --git a/configs/debxo-awesom/variables b/configs/debxo-awesom/variables
new file mode 100644 (file)
index 0000000..40e1313
--- /dev/null
@@ -0,0 +1,22 @@
+# DebXO variables
+
+
+# By default, a non-root user is created (with root provided by sudo).  Set
+# the desired username here.
+DEFUSER=olpc
+
+# The hostname that the image uses
+IMG_HOSTNAME=debxo
+
+# Build architecture (passed to debootstrap)
+IMG_ARCH=i386
+
+# The contents of /etc/apt/sources.list file in the _final_ image.  Note that
+# during the image creation process, a different mirror (ie, a local cache)
+# can be used by supplying --local-apt-mirror.
+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"
+
+# The default locale
+IMG_LOCALE="en_US.UTF-8 UTF-8"
+
diff --git a/configs/debxo-gnome/hooks b/configs/debxo-gnome/hooks
new file mode 100644 (file)
index 0000000..7921733
--- /dev/null
@@ -0,0 +1,124 @@
+# Default hooks - copy & customize this for a new image build
+#
+# Copyright © 2008-2009  Andres Salomon <dilinger@collabora.co.uk>
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+customize_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made to the chroot after the base system
+       # has been installed (but prior to custom package installation) should be
+       # put here.  $ROOT_DIR should be prefixed to any paths.
+       
+       mkdir ${ROOT_DIR}/ofw
+       
+       # Apt can't deal w/ jffs2's lack of mmap, so we keep apt's cache on tmpfs
+       # (see <http://bugs.debian.org/314334>).
+       mkdir ${ROOT_DIR}/var/cache/apt/cache
+       mount -t tmpfs tmpfs ${ROOT_DIR}/var/cache/apt/cache
+       # XOs are slow and small; don't use pdiffs, don't install recommends, and
+       # work around lack of mmap.
+cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
+Acquire::Pdiffs "false";
+APT::Install-Recommends "false";
+Dir {
+       Cache "var/cache/apt/" {
+               srcpkgcache "cache/srcpkgcache.bin";
+               pkgcache "cache/pkgcache.bin";
+       };
+};
+EOF
+
+       
+}
+
+package_configure_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after all packages have been
+       # installed should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+
+       # Ensure certain modules get loaded during boot
+       cat >>${ROOT_DIR}/etc/modules<<EOF
+lxfb
+fbcon
+olpc_dcon
+scx200_acb
+i8042
+olpc_battery
+msr
+EOF
+
+       # install some custom packages that aren't on mirrors.  ugly hack!
+       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.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})
+               wget --continue -O cache/${pkg} ${i}
+               cp cache/${pkg} ${ROOT_DIR}/${pkg}
+               (chroot ${ROOT_DIR} dpkg -i /${pkg})
+               pkgbase=$(echo $pkg | cut -d_ -f1)
+               echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
+               rm -f ${ROOT_DIR}/${pkg}
+       done
+
+       # take some packages that are okay to upgrade off hold
+       echo xserver-xorg-video-geode install | (chroot ${ROOT_DIR} dpkg --set-selections)
+       echo autox install | (chroot ${ROOT_DIR} dpkg --set-selections)
+
+       # No longer a need for xorg.conf
+       rm -f ${ROOT_DIR}/etc/X11/xorg.conf
+
+       # 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 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
+xml:readonly:/etc/gconf/debxo.xml.defaults
+EOF
+               mkdir -p ${ROOT_DIR}/etc/gconf/debxo.xml.defaults
+               cp %gconf-tree.xml ${ROOT_DIR}/etc/gconf/debxo.xml.defaults/
+       fi
+
+}
+
+cleanup_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after the chroot creation is
+       # complete should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+       umount ${ROOT_DIR}/var/cache/apt/cache
+}
diff --git a/configs/debxo-gnome/packages b/configs/debxo-gnome/packages
new file mode 100644 (file)
index 0000000..3c0c1f4
--- /dev/null
@@ -0,0 +1,65 @@
+# The list of packages to install onto the image should be listed here
+# (one per line).  Aptitude is used to install these, so there are is no
+# need to explicitly list dependencies.  Packages installed by debootstrap
+# plus a few others (sudo, locales) do not need to be listed here, as they
+# are always installed.
+
+# the backend stuff
+libertas-firmware
+initramfs-tools
+wireless-tools
+alsa-utils
+console-tools
+openntpd
+
+# the silly i-always-use-this-shit stuff
+less
+psmisc
+openssh-client
+diff
+bzip2
+info
+manpages-dev
+rsync
+links2
+
+# X
+xserver-xorg-core
+xserver-xorg-input-kbd
+xserver-xorg-input-mouse
+xserver-xorg-input-evdev
+xserver-xorg-video-geode
+xfonts-100dpi
+xfonts-scalable
+xfonts-base
+x11-xserver-utils
+xinit
+xauth
+
+# the gnome and desktop stuff
+menu
+aspell-en
+ttf-liberation
+#gdm
+gnome-core
+gnome-backgrounds
+gnome-power-manager
+gnome-media
+gnome-mount
+gnome-system-tools
+gnome-volume-manager
+gnome-themes
+gnome-utils
+gconf-editor
+network-manager-gnome
+claws-mail
+epiphany-browser
+file-roller
+netsurf
+pidgin
+evince
+xpdf
+totem
+gstreamer0.10-ffmpeg
+gstreamer0.10-plugins-bad
+gstreamer0.10-plugins-ugly
diff --git a/configs/debxo-gnome/variables b/configs/debxo-gnome/variables
new file mode 100644 (file)
index 0000000..40e1313
--- /dev/null
@@ -0,0 +1,22 @@
+# DebXO variables
+
+
+# By default, a non-root user is created (with root provided by sudo).  Set
+# the desired username here.
+DEFUSER=olpc
+
+# The hostname that the image uses
+IMG_HOSTNAME=debxo
+
+# Build architecture (passed to debootstrap)
+IMG_ARCH=i386
+
+# The contents of /etc/apt/sources.list file in the _final_ image.  Note that
+# during the image creation process, a different mirror (ie, a local cache)
+# can be used by supplying --local-apt-mirror.
+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"
+
+# The default locale
+IMG_LOCALE="en_US.UTF-8 UTF-8"
+
diff --git a/configs/debxo-kde/hooks b/configs/debxo-kde/hooks
new file mode 100644 (file)
index 0000000..0af18b5
--- /dev/null
@@ -0,0 +1,113 @@
+#
+# Copyright © 2008-2009  Andres Salomon <dilinger@collabora.co.uk>
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+customize_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made to the chroot after the base system
+       # has been installed (but prior to custom package installation) should be
+       # put here.  $ROOT_DIR should be prefixed to any paths.
+       
+       mkdir ${ROOT_DIR}/ofw
+       
+       # Apt can't deal w/ jffs2's lack of mmap, so we keep apt's cache on tmpfs
+       # (see <http://bugs.debian.org/314334>).
+       mkdir ${ROOT_DIR}/var/cache/apt/cache
+       mount -t tmpfs tmpfs ${ROOT_DIR}/var/cache/apt/cache
+       # XOs are slow and small; don't use pdiffs, don't install recommends, and
+       # work around lack of mmap.
+cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
+Acquire::Pdiffs "false";
+APT::Install-Recommends "false";
+Dir {
+       Cache "var/cache/apt/" {
+               srcpkgcache "cache/srcpkgcache.bin";
+               pkgcache "cache/pkgcache.bin";
+       };
+};
+EOF
+
+       
+}
+
+package_configure_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after all packages have been
+       # installed should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+
+       # Ensure certain modules get loaded during boot
+       cat >>${ROOT_DIR}/etc/modules<<EOF
+lxfb
+fbcon
+olpc_dcon
+scx200_acb
+i8042
+olpc_battery
+msr
+EOF
+
+       # install some custom packages that aren't on mirrors.  ugly hack!
+       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.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})
+               wget --continue -O cache/${pkg} ${i}
+               cp cache/${pkg} ${ROOT_DIR}/${pkg}
+               (chroot ${ROOT_DIR} dpkg -i /${pkg})
+               pkgbase=$(echo $pkg | cut -d_ -f1)
+               echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
+               rm -f ${ROOT_DIR}/${pkg}
+       done
+
+       # take some packages that are okay to upgrade off hold
+       echo xserver-xorg-video-geode install | (chroot ${ROOT_DIR} dpkg --set-selections)
+       echo autox install | (chroot ${ROOT_DIR} dpkg --set-selections)
+
+       # No longer a need for xorg.conf
+       rm -f ${ROOT_DIR}/etc/X11/xorg.conf
+
+       # 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 autox
+       if [ -f ${ROOT_DIR}/etc/default/autox ]; then
+               sed --in-place "s/USER=$/USER=${DEFUSER}/" ${ROOT_DIR}/etc/default/autox
+       fi
+
+}
+
+cleanup_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after the chroot creation is
+       # complete should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+       umount ${ROOT_DIR}/var/cache/apt/cache
+}
diff --git a/configs/debxo-kde/packages b/configs/debxo-kde/packages
new file mode 100644 (file)
index 0000000..a630fc7
--- /dev/null
@@ -0,0 +1,44 @@
+# The list of packages to install onto the image should be listed here
+# (one per line).  Aptitude is used to install these, so there are is no
+# need to explicitly list dependencies.  Packages installed by debootstrap
+# plus a few others (sudo, locales) do not need to be listed here, as they
+# are always installed.
+
+# the backend stuff
+libertas-firmware
+initramfs-tools
+wireless-tools
+alsa-utils
+console-tools
+openntpd
+
+# the silly i-always-use-this-shit stuff
+less
+psmisc
+openssh-client
+diff
+bzip2
+info
+manpages-dev
+rsync
+links2
+
+# X
+xserver-xorg-core
+xserver-xorg-input-kbd
+xserver-xorg-input-mouse
+xserver-xorg-input-evdev
+xserver-xorg-video-geode
+xfonts-100dpi
+xfonts-scalable
+xfonts-base
+x11-xserver-utils
+
+# the desktop stuff
+menu
+aspell-en
+ttf-liberation
+big-cursor
+kdm
+kde
+network-manager-kde
diff --git a/configs/debxo-kde/variables b/configs/debxo-kde/variables
new file mode 100644 (file)
index 0000000..40e1313
--- /dev/null
@@ -0,0 +1,22 @@
+# DebXO variables
+
+
+# By default, a non-root user is created (with root provided by sudo).  Set
+# the desired username here.
+DEFUSER=olpc
+
+# The hostname that the image uses
+IMG_HOSTNAME=debxo
+
+# Build architecture (passed to debootstrap)
+IMG_ARCH=i386
+
+# The contents of /etc/apt/sources.list file in the _final_ image.  Note that
+# during the image creation process, a different mirror (ie, a local cache)
+# can be used by supplying --local-apt-mirror.
+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"
+
+# The default locale
+IMG_LOCALE="en_US.UTF-8 UTF-8"
+
diff --git a/configs/debxo-lxde/hooks b/configs/debxo-lxde/hooks
new file mode 100644 (file)
index 0000000..0af18b5
--- /dev/null
@@ -0,0 +1,113 @@
+#
+# Copyright © 2008-2009  Andres Salomon <dilinger@collabora.co.uk>
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+customize_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made to the chroot after the base system
+       # has been installed (but prior to custom package installation) should be
+       # put here.  $ROOT_DIR should be prefixed to any paths.
+       
+       mkdir ${ROOT_DIR}/ofw
+       
+       # Apt can't deal w/ jffs2's lack of mmap, so we keep apt's cache on tmpfs
+       # (see <http://bugs.debian.org/314334>).
+       mkdir ${ROOT_DIR}/var/cache/apt/cache
+       mount -t tmpfs tmpfs ${ROOT_DIR}/var/cache/apt/cache
+       # XOs are slow and small; don't use pdiffs, don't install recommends, and
+       # work around lack of mmap.
+cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
+Acquire::Pdiffs "false";
+APT::Install-Recommends "false";
+Dir {
+       Cache "var/cache/apt/" {
+               srcpkgcache "cache/srcpkgcache.bin";
+               pkgcache "cache/pkgcache.bin";
+       };
+};
+EOF
+
+       
+}
+
+package_configure_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after all packages have been
+       # installed should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+
+       # Ensure certain modules get loaded during boot
+       cat >>${ROOT_DIR}/etc/modules<<EOF
+lxfb
+fbcon
+olpc_dcon
+scx200_acb
+i8042
+olpc_battery
+msr
+EOF
+
+       # install some custom packages that aren't on mirrors.  ugly hack!
+       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.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})
+               wget --continue -O cache/${pkg} ${i}
+               cp cache/${pkg} ${ROOT_DIR}/${pkg}
+               (chroot ${ROOT_DIR} dpkg -i /${pkg})
+               pkgbase=$(echo $pkg | cut -d_ -f1)
+               echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
+               rm -f ${ROOT_DIR}/${pkg}
+       done
+
+       # take some packages that are okay to upgrade off hold
+       echo xserver-xorg-video-geode install | (chroot ${ROOT_DIR} dpkg --set-selections)
+       echo autox install | (chroot ${ROOT_DIR} dpkg --set-selections)
+
+       # No longer a need for xorg.conf
+       rm -f ${ROOT_DIR}/etc/X11/xorg.conf
+
+       # 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 autox
+       if [ -f ${ROOT_DIR}/etc/default/autox ]; then
+               sed --in-place "s/USER=$/USER=${DEFUSER}/" ${ROOT_DIR}/etc/default/autox
+       fi
+
+}
+
+cleanup_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after the chroot creation is
+       # complete should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+       umount ${ROOT_DIR}/var/cache/apt/cache
+}
diff --git a/configs/debxo-lxde/packages b/configs/debxo-lxde/packages
new file mode 100644 (file)
index 0000000..d22850b
--- /dev/null
@@ -0,0 +1,48 @@
+# The list of packages to install onto the image should be listed here
+# (one per line).  Aptitude is used to install these, so there are is no
+# need to explicitly list dependencies.  Packages installed by debootstrap
+# plus a few others (sudo, locales) do not need to be listed here, as they
+# are always installed.
+
+# the backend stuff
+libertas-firmware
+initramfs-tools
+wireless-tools
+alsa-utils
+console-tools
+openntpd
+
+# the silly i-always-use-this-shit stuff
+less
+psmisc
+openssh-client
+diff
+bzip2
+info
+manpages-dev
+rsync
+links2
+
+# X
+xserver-xorg-core
+xserver-xorg-input-kbd
+xserver-xorg-input-mouse
+xserver-xorg-input-evdev
+xserver-xorg-video-geode
+xfonts-100dpi
+xfonts-scalable
+xfonts-base
+x11-xserver-utils
+xinit
+xauth
+
+# the desktop stuff
+menu
+aspell-en
+ttf-liberation
+big-cursor
+lxde
+lxnm
+lxsession-lite
+lxterminal
+netsurf
diff --git a/configs/debxo-lxde/variables b/configs/debxo-lxde/variables
new file mode 100644 (file)
index 0000000..40e1313
--- /dev/null
@@ -0,0 +1,22 @@
+# DebXO variables
+
+
+# By default, a non-root user is created (with root provided by sudo).  Set
+# the desired username here.
+DEFUSER=olpc
+
+# The hostname that the image uses
+IMG_HOSTNAME=debxo
+
+# Build architecture (passed to debootstrap)
+IMG_ARCH=i386
+
+# The contents of /etc/apt/sources.list file in the _final_ image.  Note that
+# during the image creation process, a different mirror (ie, a local cache)
+# can be used by supplying --local-apt-mirror.
+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"
+
+# The default locale
+IMG_LOCALE="en_US.UTF-8 UTF-8"
+
diff --git a/configs/debxo-sugar/hooks b/configs/debxo-sugar/hooks
new file mode 100644 (file)
index 0000000..00015a0
--- /dev/null
@@ -0,0 +1,121 @@
+#
+# Copyright © 2008-2009  Andres Salomon <dilinger@collabora.co.uk>
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+customize_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made to the chroot after the base system
+       # has been installed (but prior to custom package installation) should be
+       # put here.  $ROOT_DIR should be prefixed to any paths.
+       
+       mkdir ${ROOT_DIR}/ofw
+       
+       # Apt can't deal w/ jffs2's lack of mmap, so we keep apt's cache on tmpfs
+       # (see <http://bugs.debian.org/314334>).
+       mkdir ${ROOT_DIR}/var/cache/apt/cache
+       mount -t tmpfs tmpfs ${ROOT_DIR}/var/cache/apt/cache
+       # XOs are slow and small; don't use pdiffs, don't install recommends, and
+       # work around lack of mmap.
+cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
+Acquire::Pdiffs "false";
+APT::Install-Recommends "false";
+Dir {
+       Cache "var/cache/apt/" {
+               srcpkgcache "cache/srcpkgcache.bin";
+               pkgcache "cache/pkgcache.bin";
+       };
+};
+EOF
+
+       
+}
+
+package_configure_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after all packages have been
+       # installed should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+
+       # Ensure certain modules get loaded during boot
+       cat >>${ROOT_DIR}/etc/modules<<EOF
+lxfb
+fbcon
+olpc_dcon
+scx200_acb
+i8042
+olpc_battery
+msr
+EOF
+
+       # install some custom packages that aren't on mirrors.  ugly hack!
+       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.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})
+               wget --continue -O cache/${pkg} ${i}
+               cp cache/${pkg} ${ROOT_DIR}/${pkg}
+               (chroot ${ROOT_DIR} dpkg -i /${pkg})
+               pkgbase=$(echo $pkg | cut -d_ -f1)
+               echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
+               rm -f ${ROOT_DIR}/${pkg}
+       done
+
+       # take some packages that are okay to upgrade off hold
+       echo xserver-xorg-video-geode install | (chroot ${ROOT_DIR} dpkg --set-selections)
+       echo autox install | (chroot ${ROOT_DIR} dpkg --set-selections)
+
+       # No longer a need for xorg.conf
+       rm -f ${ROOT_DIR}/etc/X11/xorg.conf
+
+       # 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 autox
+       if [ -f ${ROOT_DIR}/etc/default/autox ]; then
+               sed --in-place "s/USER=$/USER=${DEFUSER}/" ${ROOT_DIR}/etc/default/autox
+       fi
+
+       # configure sugar
+       if [ -d ${ROOT_DIR}/usr/share/sugar ]; then
+               cat >> ${ROOT_DIR}/etc/skel/.Xsession <<- EOF
+matchbox-window-manager -use_titlebar no &
+sugar
+EOF
+       fi
+
+}
+
+cleanup_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after the chroot creation is
+       # complete should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+       umount ${ROOT_DIR}/var/cache/apt/cache
+}
diff --git a/configs/debxo-sugar/packages b/configs/debxo-sugar/packages
new file mode 100644 (file)
index 0000000..7d70521
--- /dev/null
@@ -0,0 +1,61 @@
+# The list of packages to install onto the image should be listed here
+# (one per line).  Aptitude is used to install these, so there are is no
+# need to explicitly list dependencies.  Packages installed by debootstrap
+# plus a few others (sudo, locales) do not need to be listed here, as they
+# are always installed.
+
+# the backend stuff
+libertas-firmware
+initramfs-tools
+wireless-tools
+alsa-utils
+console-tools
+openntpd
+
+# the silly i-always-use-this-shit stuff
+less
+psmisc
+openssh-client
+diff
+bzip2
+info
+manpages-dev
+rsync
+links2
+
+# X
+xserver-xephyr
+xserver-xorg-core
+xserver-xorg-input-kbd
+xserver-xorg-input-mouse
+xserver-xorg-input-evdev
+xserver-xorg-video-geode
+xfonts-100dpi
+xfonts-scalable
+xfonts-base
+x11-xserver-utils
+xinit
+
+# the desktop stuff
+menu
+aspell-en
+big-cursor
+ttf-liberation
+network-manager-gnome
+sugar
+sugar-artwork
+sugar-calculate-activity
+sugar-chat-activity
+sugar-journal-activity
+sugar-pippy-activity
+sugar-presence-service
+sugar-sharedstate-classes
+sugar-sharingtest-activity
+sugar-web-activity
+matchbox
+network-manager
+sugar-doc
+etoys
+etoys-doc
+squeak-vm
+unzip
diff --git a/configs/debxo-sugar/variables b/configs/debxo-sugar/variables
new file mode 100644 (file)
index 0000000..40e1313
--- /dev/null
@@ -0,0 +1,22 @@
+# DebXO variables
+
+
+# By default, a non-root user is created (with root provided by sudo).  Set
+# the desired username here.
+DEFUSER=olpc
+
+# The hostname that the image uses
+IMG_HOSTNAME=debxo
+
+# Build architecture (passed to debootstrap)
+IMG_ARCH=i386
+
+# The contents of /etc/apt/sources.list file in the _final_ image.  Note that
+# during the image creation process, a different mirror (ie, a local cache)
+# can be used by supplying --local-apt-mirror.
+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"
+
+# The default locale
+IMG_LOCALE="en_US.UTF-8 UTF-8"
+
diff --git a/configs/debxo-xfce/hooks b/configs/debxo-xfce/hooks
new file mode 100644 (file)
index 0000000..0af18b5
--- /dev/null
@@ -0,0 +1,113 @@
+#
+# Copyright © 2008-2009  Andres Salomon <dilinger@collabora.co.uk>
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+customize_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made to the chroot after the base system
+       # has been installed (but prior to custom package installation) should be
+       # put here.  $ROOT_DIR should be prefixed to any paths.
+       
+       mkdir ${ROOT_DIR}/ofw
+       
+       # Apt can't deal w/ jffs2's lack of mmap, so we keep apt's cache on tmpfs
+       # (see <http://bugs.debian.org/314334>).
+       mkdir ${ROOT_DIR}/var/cache/apt/cache
+       mount -t tmpfs tmpfs ${ROOT_DIR}/var/cache/apt/cache
+       # XOs are slow and small; don't use pdiffs, don't install recommends, and
+       # work around lack of mmap.
+cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
+Acquire::Pdiffs "false";
+APT::Install-Recommends "false";
+Dir {
+       Cache "var/cache/apt/" {
+               srcpkgcache "cache/srcpkgcache.bin";
+               pkgcache "cache/pkgcache.bin";
+       };
+};
+EOF
+
+       
+}
+
+package_configure_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after all packages have been
+       # installed should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+
+       # Ensure certain modules get loaded during boot
+       cat >>${ROOT_DIR}/etc/modules<<EOF
+lxfb
+fbcon
+olpc_dcon
+scx200_acb
+i8042
+olpc_battery
+msr
+EOF
+
+       # install some custom packages that aren't on mirrors.  ugly hack!
+       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.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})
+               wget --continue -O cache/${pkg} ${i}
+               cp cache/${pkg} ${ROOT_DIR}/${pkg}
+               (chroot ${ROOT_DIR} dpkg -i /${pkg})
+               pkgbase=$(echo $pkg | cut -d_ -f1)
+               echo $pkgbase hold | (chroot ${ROOT_DIR} dpkg --set-selections)
+               rm -f ${ROOT_DIR}/${pkg}
+       done
+
+       # take some packages that are okay to upgrade off hold
+       echo xserver-xorg-video-geode install | (chroot ${ROOT_DIR} dpkg --set-selections)
+       echo autox install | (chroot ${ROOT_DIR} dpkg --set-selections)
+
+       # No longer a need for xorg.conf
+       rm -f ${ROOT_DIR}/etc/X11/xorg.conf
+
+       # 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 autox
+       if [ -f ${ROOT_DIR}/etc/default/autox ]; then
+               sed --in-place "s/USER=$/USER=${DEFUSER}/" ${ROOT_DIR}/etc/default/autox
+       fi
+
+}
+
+cleanup_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after the chroot creation is
+       # complete should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+
+       umount ${ROOT_DIR}/var/cache/apt/cache
+}
diff --git a/configs/debxo-xfce/packages b/configs/debxo-xfce/packages
new file mode 100644 (file)
index 0000000..d887c27
--- /dev/null
@@ -0,0 +1,60 @@
+# The list of packages to install onto the image should be listed here
+# (one per line).  Aptitude is used to install these, so there are is no
+# need to explicitly list dependencies.  Packages installed by debootstrap
+# plus a few others (sudo, locales) do not need to be listed here, as they
+# are always installed.
+
+# the backend stuff
+libertas-firmware
+initramfs-tools
+wireless-tools
+alsa-utils
+console-tools
+openntpd
+
+# the silly i-always-use-this-shit stuff
+less
+psmisc
+openssh-client
+diff
+bzip2
+info
+manpages-dev
+rsync
+links2
+
+# X
+xserver-xorg-core
+xserver-xorg-input-kbd
+xserver-xorg-input-mouse
+xserver-xorg-input-evdev
+xserver-xorg-video-geode
+xfonts-100dpi
+xfonts-scalable
+xfonts-base
+x11-xserver-utils
+xinit
+xauth
+
+# the desktop stuff
+menu
+aspell-en
+ttf-liberation
+network-manager-gnome
+firefox
+pidgin
+evince
+xpdf
+totem
+gstreamer0.10-ffmpeg
+gstreamer0.10-plugins-bad
+gstreamer0.10-plugins-ugly
+xfce4
+xfce4-terminal
+abiword
+eog
+gksu
+synaptic
+sugar-artwork
+file-roller
+epiphany-browser
diff --git a/configs/debxo-xfce/variables b/configs/debxo-xfce/variables
new file mode 100644 (file)
index 0000000..40e1313
--- /dev/null
@@ -0,0 +1,22 @@
+# DebXO variables
+
+
+# By default, a non-root user is created (with root provided by sudo).  Set
+# the desired username here.
+DEFUSER=olpc
+
+# The hostname that the image uses
+IMG_HOSTNAME=debxo
+
+# Build architecture (passed to debootstrap)
+IMG_ARCH=i386
+
+# The contents of /etc/apt/sources.list file in the _final_ image.  Note that
+# during the image creation process, a different mirror (ie, a local cache)
+# can be used by supplying --local-apt-mirror.
+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"
+
+# The default locale
+IMG_LOCALE="en_US.UTF-8 UTF-8"
+
diff --git a/configs/generic/hooks b/configs/generic/hooks
new file mode 100644 (file)
index 0000000..2f9a3f4
--- /dev/null
@@ -0,0 +1,29 @@
+# Default hooks - copy & customize this for a new image build
+
+
+customize_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made to the chroot after the base system
+       # has been installed (but prior to further package installation) should be
+       # put here.  $ROOT_DIR should be prefixed to any paths.
+}
+
+package_configure_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after all packages have been
+       # installed should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+}
+
+cleanup_chroot_hook()
+{
+       ROOT_DIR="$1"
+
+       # Any customizations that need to be made after the chroot creation is
+       # complete should be put here.  $ROOT_DIR should be prefixed to any
+       # paths.
+}
diff --git a/configs/generic/packages b/configs/generic/packages
new file mode 100644 (file)
index 0000000..1dbc18d
--- /dev/null
@@ -0,0 +1,10 @@
+# Default packages - copy & customize this for a new image build
+
+
+# The list of packages to install onto the image should be listed here
+# (one per line).  Aptitude is used to install these, so there are is no
+# need to explicitly list dependencies.  Packages installed by debootstrap
+# do not need to be listed here, as they are always installed.
+
+locales
+sudo
diff --git a/configs/generic/variables b/configs/generic/variables
new file mode 100644 (file)
index 0000000..25d8ea5
--- /dev/null
@@ -0,0 +1,22 @@
+# Default variables - copy & customize this for a new image build
+
+
+# By default, a non-root user is created (with root provided by sudo).  Set
+# the desired username here.
+DEFUSER=debian
+
+# The hostname that the image uses
+IMG_HOSTNAME=debian
+
+# Build architecture (passed to debootstrap)
+IMG_ARCH=i386
+
+# The contents of /etc/apt/sources.list file in the _final_ image.  Note that
+# during the image creation process, a different mirror (ie, a local cache)
+# can be used by supplying --local-apt-mirror.
+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"
+
+# The default locale
+IMG_LOCALE="en_US.UTF-8 UTF-8"
+
diff --git a/gnome.packages b/gnome.packages
deleted file mode 100644 (file)
index f488dfc..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-xserver-xorg-core
-xserver-xorg-input-kbd
-xserver-xorg-input-mouse
-xserver-xorg-input-evdev
-xserver-xorg-video-geode
-xfonts-100dpi
-xfonts-scalable
-xfonts-base
-x11-xserver-utils
-openssh-client
-openntpd
-diff
-bzip2
-menu
-aspell-en
-info
-manpages-dev
-rsync
-gnome-core
-gnome-backgrounds
-gnome-power-manager
-gnome-media
-gnome-mount
-gnome-system-tools
-gnome-volume-manager
-gnome-themes
-gnome-utils
-gconf-editor
-network-manager-gnome
-claws-mail
-epiphany-browser
-file-roller
-links2
-netsurf
-pidgin
-evince
-xpdf
-totem
-gstreamer0.10-ffmpeg
-gstreamer0.10-plugins-bad
-gstreamer0.10-plugins-ugly
diff --git a/kde.packages b/kde.packages
deleted file mode 100644 (file)
index 7c4fcdf..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-xserver-xorg-core
-xserver-xorg-input-kbd
-xserver-xorg-input-mouse
-xserver-xorg-input-evdev
-xserver-xorg-video-geode
-xfonts-100dpi
-xfonts-scalable
-xfonts-base
-x11-xserver-utils
-openssh-client
-openntpd
-menu
-aspell-en
-big-cursor
-kde
-network-manager-kde
diff --git a/lxde.packages b/lxde.packages
deleted file mode 100644 (file)
index 5ecc6a2..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-xserver-xorg-core
-xserver-xorg-input-kbd
-xserver-xorg-input-mouse
-xserver-xorg-input-evdev
-xserver-xorg-video-geode
-xfonts-100dpi
-xfonts-scalable
-xfonts-base
-x11-xserver-utils
-openssh-client
-openntpd
-menu
-aspell-en
-big-cursor
-xinit
-xauth
-lxde
-lxnm
-lxsession-lite
-lxterminal
-netsurf
index 3a5a9f7e7c7706c841bbeaebe6266d2dc7fa821a..7867a8ac582adca82b7bc9ec7024fce9d6f24b13 100755 (executable)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-DEFUSER=olpc
-PLIST=gnome.packages
-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
 
+# load & set default values
+CONFIG_TYPE=generic
+. ./configs/${CONFIG_TYPE}/variables
+. ./configs/${CONFIG_TYPE}/hooks
+BASE_PLIST="./configs/${CONFIG_TYPE}/packages"
+LOCAL_APT_MIRROR=
+
 usage()
 {
        echo "" 1>&2
        echo "Usage: $0 [<options>] <root directory>" 1>&2
        echo "" 1>&2
        echo "Options:" 1>&2
 usage()
 {
        echo "" 1>&2
        echo "Usage: $0 [<options>] <root directory>" 1>&2
        echo "" 1>&2
        echo "Options:" 1>&2
-       echo "  --user <user>             Username for default user" 1>&2
-       echo "  --package-list <list>     File containing package list" 1>&2
-       echo "  --apt-sources <srcs>      Contents of /etc/apt/sources.list" 1>&2
+       echo "  --config-type <config>    directory name in configs/ to use" 1>&2
        echo "  --local-apt-mirror <srcs> sources.list for local mirror" 1>&2
        echo "" 1>&2
        exit 1
        echo "  --local-apt-mirror <srcs> sources.list for local mirror" 1>&2
        echo "" 1>&2
        exit 1
@@ -41,22 +40,14 @@ usage()
 while test $# != 0
 do
        case $1 in
 while test $# != 0
 do
        case $1 in
-       --user)
-               DEFUSER=$2
-               shift
-               ;;
-       --package-list)
-               PLIST=$2
-               [ -f ${PLIST} ] || {
-                       echo "Error: can't find file '${PLIST}'!" 1>&2
+       --config-type)
+               CONFIG_TYPE=$2
+               [ -d ./configs/${CONFIG_TYPE} ] || {
+                       echo "Error: can't find directory './configs/${CONFIG_TYPE}/'!" 1>&2
                        exit 2
                }
                shift
                ;;
                        exit 2
                }
                shift
                ;;
-       --apt-sources)
-               APT_SOURCES="$2"
-               shift
-               ;;
        --local-apt-mirror)
                LOCAL_APT_MIRROR="$2"
                shift
        --local-apt-mirror)
                LOCAL_APT_MIRROR="$2"
                shift
@@ -85,9 +76,18 @@ if [ -d "${ROOT_DIR}" ]; then
        usage
 fi
 
        usage
 fi
 
+if [ "$UID" != "0" ]; then
+       echo "" 1>&2
+       echo "*** $0 must be run with root privs!" 1>&2
+       exit 1
+fi
+
 start_logging $ROOT_DIR
 
 start_logging $ROOT_DIR
 
-check_for_cmds debootstrap || exit 1
+# load config-specific values
+. ./configs/${CONFIG_TYPE}/variables
+. ./configs/${CONFIG_TYPE}/hooks
+PLIST="./configs/${CONFIG_TYPE}/packages"
 
 if [ -z "${LOCAL_APT_MIRROR}" ]; then
     LOCAL_APT_MIRROR="${APT_SOURCES}"
 
 if [ -z "${LOCAL_APT_MIRROR}" ]; then
     LOCAL_APT_MIRROR="${APT_SOURCES}"
@@ -98,12 +98,9 @@ MIRROR=$(printf "${LOCAL_APT_MIRROR}\n" | awk '/deb /{print $2}' | head -n1)
 DIST=$(printf "${LOCAL_APT_MIRROR}\n" | awk '/deb /{print $3}' | head -n1)
 
 # create chroot
 DIST=$(printf "${LOCAL_APT_MIRROR}\n" | awk '/deb /{print $3}' | head -n1)
 
 # create chroot
-debootstrap --arch i386 ${DIST} ${ROOT_DIR} ${MIRROR}
-mkdir ${ROOT_DIR}/ofw
-mkdir ${ROOT_DIR}/var/cache/apt/cache
+debootstrap --arch ${IMG_ARCH} ${DIST} ${ROOT_DIR} ${MIRROR}
 mount -t proc proc ${ROOT_DIR}/proc
 mount -t devpts devpts ${ROOT_DIR}/dev/pts
 mount -t proc proc ${ROOT_DIR}/proc
 mount -t devpts devpts ${ROOT_DIR}/dev/pts
-mount -t tmpfs tmpfs ${ROOT_DIR}/var/cache/apt/cache
 
 # allow daemons to be installed without breaking
 mv ${ROOT_DIR}/sbin/start-stop-daemon ${ROOT_DIR}/sbin/start-stop-daemon.REAL
 
 # allow daemons to be installed without breaking
 mv ${ROOT_DIR}/sbin/start-stop-daemon ${ROOT_DIR}/sbin/start-stop-daemon.REAL
@@ -115,10 +112,10 @@ EOF
 chmod 755 ${ROOT_DIR}/sbin/start-stop-daemon
 
 # set up hostname stuff
 chmod 755 ${ROOT_DIR}/sbin/start-stop-daemon
 
 # set up hostname stuff
-echo "debxo" > ${ROOT_DIR}/etc/hostname
+echo "${IMG_HOSTNAME}" > ${ROOT_DIR}/etc/hostname
 cat >${ROOT_DIR}/etc/hosts<<EOF
 127.0.0.1 localhost.localdomain localhost
 cat >${ROOT_DIR}/etc/hosts<<EOF
 127.0.0.1 localhost.localdomain localhost
-127.0.0.1 debxo
+127.0.0.1 ${IMG_HOSTNAME}
 
 # The following lines are desirable for IPv6 capable hosts
 ::1     ip6-localhost ip6-loopback
 
 # The following lines are desirable for IPv6 capable hosts
 ::1     ip6-localhost ip6-loopback
@@ -129,82 +126,33 @@ ff02::2 ip6-allrouters
 ff02::3 ip6-allhosts
 EOF
 
 ff02::3 ip6-allhosts
 EOF
 
-# set up apt (working around #314334)
+# add local network interface
+cat >>${ROOT_DIR}/etc/network/interfaces<<EOF
+
+auto lo
+iface lo inet loopback
+EOF
+
+# set the default locale
+echo "${IMG_LOCALE}" >${ROOT_DIR}/etc/locale.gen
+
+# run any customizations necessary pre-package install
+customize_chroot_hook "$ROOT_DIR"
+
+# initialize apt
 export DEBIAN_FRONTEND=noninteractive
 export DEBCONF_PRIORITY=critical
 export DEBIAN_FRONTEND=noninteractive
 export DEBCONF_PRIORITY=critical
-cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
-Acquire::Pdiffs "false";
-APT::Install-Recommends "false";
-Dir {
-       Cache "var/cache/apt/" {
-               srcpkgcache "cache/srcpkgcache.bin";
-               pkgcache "cache/pkgcache.bin";
-       };
-};
-EOF
 printf "${LOCAL_APT_MIRROR}\n" >${ROOT_DIR}/etc/apt/sources.list
 (chroot ${ROOT_DIR} aptitude update)
 
 printf "${LOCAL_APT_MIRROR}\n" >${ROOT_DIR}/etc/apt/sources.list
 (chroot ${ROOT_DIR} aptitude update)
 
-# set up base system and base packages
-echo "en_US.UTF-8 UTF-8" >${ROOT_DIR}/etc/locale.gen
-(chroot ${ROOT_DIR} aptitude install -y `cat base.packages`)
-
-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.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})
-       wget --continue -O cache/${pkg} ${i}
-       cp cache/${pkg} ${ROOT_DIR}/${pkg} 
-       (chroot ${ROOT_DIR} dpkg -i /${pkg})
-       pkgbase=$(echo $pkg | cut -d_ -f1)
-       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
-lxfb
-fbcon
-olpc_dcon
-scx200_acb
-i8042
-olpc_battery
-msr
-EOF
+# generic packages are always installed
+(chroot ${ROOT_DIR} aptitude install -y `grep --invert-match '^#' ${BASE_PLIST}`)
 
 
-# install packages
+# install the rest of the packages
 (chroot ${ROOT_DIR} aptitude install -y `grep --invert-match '^#' ${PLIST}`)
 
 (chroot ${ROOT_DIR} aptitude install -y `grep --invert-match '^#' ${PLIST}`)
 
-# no longer a need for xorg.conf
-rm -f ${ROOT_DIR}/etc/X11/xorg.conf
-
-# 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 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
-xml:readonly:/etc/gconf/debxo.xml.defaults
-EOF
-    mkdir -p ${ROOT_DIR}/etc/gconf/debxo.xml.defaults
-    cp %gconf-tree.xml ${ROOT_DIR}/etc/gconf/debxo.xml.defaults/
-fi
+# post-install customization hook
+package_configure_hook "${ROOT_DIR}"
 
 # add default user
 (chroot ${ROOT_DIR} passwd -l root)
 
 # add default user
 (chroot ${ROOT_DIR} passwd -l root)
@@ -220,33 +168,6 @@ rm -rf ${ROOT_DIR}/home/*;         # i have no idea what's adding this crap...
 (chroot ${ROOT_DIR} adduser ${DEFUSER} floppy)
 echo "${DEFUSER} ALL=(ALL) NOPASSWD: ALL" >> ${ROOT_DIR}/etc/sudoers
 
 (chroot ${ROOT_DIR} adduser ${DEFUSER} floppy)
 echo "${DEFUSER} ALL=(ALL) NOPASSWD: ALL" >> ${ROOT_DIR}/etc/sudoers
 
-# add local network interface
-cat >>${ROOT_DIR}/etc/network/interfaces<<EOF
-
-auto lo
-iface lo inet loopback
-EOF
-
-# configure sugar
-if [ -d ${ROOT_DIR}/usr/share/sugar ]; then
-    # #?
-    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)
 # override sources.list with shipping version
 printf "${APT_SOURCES}\n" >${ROOT_DIR}/etc/apt/sources.list
 (chroot ${ROOT_DIR} aptitude update)
@@ -256,4 +177,6 @@ mv ${ROOT_DIR}/sbin/start-stop-daemon.REAL ${ROOT_DIR}/sbin/start-stop-daemon
 (chroot ${ROOT_DIR} aptitude clean)
 umount ${ROOT_DIR}/proc
 umount ${ROOT_DIR}/dev/pts
 (chroot ${ROOT_DIR} aptitude clean)
 umount ${ROOT_DIR}/proc
 umount ${ROOT_DIR}/dev/pts
-umount ${ROOT_DIR}/var/cache/apt/cache
+
+# custom cleanup stuff
+cleanup_chroot_hook "${ROOT_DIR}"
index e45329224ba2c59a8573ab5ed5596a13fb766544..6f17989a74cfb350099ce54080bd37b4e70f35a0 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/bash -e
 
 # prepare a release
 #!/bin/bash -e
 
 # prepare a release
-for f in *.packages; do
-       desktop=$(echo $f | sed 's/\.packages//')
-       ./mkchroot.sh --package-list ${f} \
+for f in configs/debxo-*; do
+       desktop=$(basename $f | sed 's/debxo-//')
+       ./mkchroot.sh --config-type debxo-${desktop} \
                        --local-apt-mirror "deb http://localhost:9999/debian lenny main contrib non-free
 deb http://localhost:9999/security lenny/updates main contrib non-free" \
                        debxo-${desktop}
                        --local-apt-mirror "deb http://localhost:9999/debian lenny main contrib non-free
 deb http://localhost:9999/security lenny/updates main contrib non-free" \
                        debxo-${desktop}
diff --git a/sugar.packages b/sugar.packages
deleted file mode 100644 (file)
index 3e96df8..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-xserver-xephyr
-xserver-xorg-core
-xserver-xorg-input-kbd
-xserver-xorg-input-mouse
-xserver-xorg-input-evdev
-xserver-xorg-video-geode
-xfonts-100dpi
-xfonts-scalable
-xfonts-base
-x11-xserver-utils
-openssh-client
-openntpd
-menu
-aspell-en
-big-cursor
-network-manager-gnome
-sugar
-sugar-artwork
-sugar-calculate-activity
-sugar-chat-activity
-sugar-journal-activity
-sugar-pippy-activity
-sugar-presence-service
-sugar-sharedstate-classes
-sugar-sharingtest-activity
-sugar-web-activity
-matchbox
-network-manager
-sugar-doc
-etoys
-etoys-doc
-squeak-vm
-unzip
diff --git a/xfce.packages b/xfce.packages
deleted file mode 100644 (file)
index c20e798..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-xserver-xorg-core
-xserver-xorg-input-kbd
-xserver-xorg-input-mouse
-xserver-xorg-input-evdev
-xserver-xorg-video-geode
-xfonts-100dpi
-xfonts-scalable
-xfonts-base
-x11-xserver-utils
-openssh-client
-openntpd
-diff
-bzip2
-menu
-aspell-en
-info
-manpages-dev
-rsync
-network-manager-gnome
-firefox
-pidgin
-evince
-xpdf
-totem
-gstreamer0.10-ffmpeg
-gstreamer0.10-plugins-bad
-gstreamer0.10-plugins-ugly
-xfce4
-xfce4-terminal
-xinit
-xauth
-firefox
-abiword
-eog
-gksu
-synaptic
-sugar-artwork
-file-roller
-epiphany-browser