]> spindle.queued.net Git - xodist/commitdiff
add initchroot script
authorAndres Salomon <dilinger@debian.org>
Tue, 19 Aug 2008 20:46:17 +0000 (16:46 -0400)
committerAndres Salomon <dilinger@debian.org>
Tue, 19 Aug 2008 20:46:17 +0000 (16:46 -0400)
Signed-off-by: Andres Salomon <dilinger@debian.org>
initchroot.sh [new file with mode: 0755]
package_list [new file with mode: 0644]

diff --git a/initchroot.sh b/initchroot.sh
new file mode 100755 (executable)
index 0000000..9d5f4a8
--- /dev/null
@@ -0,0 +1,89 @@
+#!/bin/sh -e
+#
+# Copyright © 2008  Andres Salomon <dilinger@queued.net>
+#
+# 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.
+
+DIST=lenny
+DEFUSER=olpc
+
+. functions.sh
+
+usage()
+{
+       echo "" 1>&2
+       echo "Usage: $0 <root directory>" 1>&2
+       echo "" 1>&2
+       exit 1
+}
+
+if [ "$#" != "1" ]; then
+       usage
+fi
+
+ROOT_DIR=$1
+
+if [ -d "${ROOT_DIR}" ]; then
+       echo "" 1>&2
+       echo "*** ${ROOT_DIR} already exists!" 1>&2
+       usage
+fi
+
+check_for_cmds debootstrap || exit 1
+
+# create chroot
+debootstrap --arch i386 lenny ${ROOT_DIR} http://http.us.debian.org/debian
+mount -t proc proc ${ROOT_DIR}/proc
+mount -t devpts devpts ${ROOT_DIR}/dev/pts
+
+# set up apt
+export DEBIAN_FRONTEND=noninteractive
+export DEBCONF_PRIORITY=critical
+cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
+Acquire::Pdiffs "false";
+APT::Install-Recommends "false";
+EOF
+cat >${ROOT_DIR}/etc/apt/sources.list<<EOF
+deb http://http.us.debian.org/debian ${DIST} main contrib non-free
+deb http://security.debian.org/ ${DIST}/updates main contrib non-free
+EOF
+(chroot ${ROOT_DIR} aptitude update)
+
+# set up base system
+echo "en_US.UTF-8 UTF-8" >${ROOT_DIR}/etc/locale.gen
+(chroot ${ROOT_DIR} aptitude install -y locales)
+k=$(wget -O- http://queued.mit.edu/~dilinger/builds-master/ | sed -ne 's/.*href="\(.\+\)_i386.deb".*/\1_i386.deb/p' | tail -n1)
+wget -O ${ROOT_DIR}/${k} http://queued.mit.edu/~dilinger/builds-master/${k}
+(chroot ${ROOT_DIR} dpkg -i /${k})
+rm -f ${ROOT_DIR}/${k}
+
+# install packages
+(chroot ${ROOT_DIR} aptitude install -y `cat package_list`)
+
+# add default user
+(chroot ${ROOT_DIR} useradd -s /bin/bash ${DEFUSER})
+(chroot ${ROOT_DIR} passwd -d ${DEFUSER})
+(chroot ${ROOT_DIR} adduser ${DEFUSER} cdrom)
+(chroot ${ROOT_DIR} adduser ${DEFUSER} audio)
+(chroot ${ROOT_DIR} adduser ${DEFUSER} video)
+(chroot ${ROOT_DIR} adduser ${DEFUSER} plugdev)
+(chroot ${ROOT_DIR} adduser ${DEFUSER} netdev)
+(chroot ${ROOT_DIR} adduser ${DEFUSER} powerdev)
+echo "${DEFUSER} ALL=(ALL) ALL" >> ${ROOT_DIR}/etc/sudoers
+
+# done, clean up
+(chroot ${ROOT_DIR} aptitude clean)
+umount ${ROOT_DIR}/proc
+umount ${ROOT_DIR}/dev/pts
diff --git a/package_list b/package_list
new file mode 100644 (file)
index 0000000..fc456c3
--- /dev/null
@@ -0,0 +1,34 @@
+libertas-firmware
+xserver-xorg-core
+xserver-xorg-input-kbd
+xserver-xorg-input-mouse
+xserver-xorg-video-geode
+xfonts-100dpi
+openssh-client
+openntpd
+diff
+bzip2
+aspell-en
+info
+manpages-dev
+rsync
+sudo
+gdm
+gnome-core
+gnome-backgrounds
+gnome-power-manager
+gnome-media
+gnome-mount
+gnome-system-tools
+gnome-themes
+gnome-utils
+network-manager-gnome
+claws-mail
+epiphany-browser
+iceweasel
+links2
+pidgin
+evince
+xpdf
+totem
+vlc