3 # Copyright © 2008 Andres Salomon <dilinger@queued.net>
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.
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.
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.
27 echo "Usage: $0 <root directory>" 1>&2
32 if [ "$#" != "1" ]; then
38 if [ -d "${ROOT_DIR}" ]; then
40 echo "*** ${ROOT_DIR} already exists!" 1>&2
44 check_for_cmds debootstrap || exit 1
47 debootstrap --arch i386 lenny ${ROOT_DIR} http://http.us.debian.org/debian
48 mount -t proc proc ${ROOT_DIR}/proc
49 mount -t devpts devpts ${ROOT_DIR}/dev/pts
51 # allow daemons to be installed without breaking
52 mv ${ROOT_DIR}/sbin/start-stop-daemon ${ROOT_DIR}/sbin/start-stop-daemon.REAL
53 cat >${ROOT_DIR}/sbin/start-stop-daemon<<EOF
56 echo "Warning: Fake start-stop-daemon called, doing nothing"
58 chmod 755 ${ROOT_DIR}/sbin/start-stop-daemon
61 export DEBIAN_FRONTEND=noninteractive
62 export DEBCONF_PRIORITY=critical
63 cat >${ROOT_DIR}/etc/apt/apt.conf<<EOF
64 Acquire::Pdiffs "false";
65 APT::Install-Recommends "false";
67 cat >${ROOT_DIR}/etc/apt/sources.list<<EOF
68 deb http://http.us.debian.org/debian ${DIST} main contrib non-free
69 deb http://security.debian.org/ ${DIST}/updates main contrib non-free
71 (chroot ${ROOT_DIR} aptitude update)
74 echo "en_US.UTF-8 UTF-8" >${ROOT_DIR}/etc/locale.gen
75 (chroot ${ROOT_DIR} aptitude install -y locales)
76 k=$(wget -O- http://queued.mit.edu/~dilinger/builds-master/ | sed -ne 's/.*href="\(.\+\)_i386.deb".*/\1_i386.deb/p' | tail -n1)
77 wget -O ${ROOT_DIR}/${k} http://queued.mit.edu/~dilinger/builds-master/${k}
78 (chroot ${ROOT_DIR} dpkg -i /${k})
79 rm -f ${ROOT_DIR}/${k}
82 (chroot ${ROOT_DIR} aptitude install -y `cat package_list`)
85 cat >${ROOT_DIR}/etc/X11/xorg.conf<<EOF
86 # xorg.conf (X.Org X Window System server configuration file)
89 Identifier "Configured Monitor"
95 HTimings 1200 1208 1216 1240
96 VTimings 900 905 908 912
97 Flags "-HSync" "-VSync"
102 Identifier "Default Screen"
103 Monitor "Configured Monitor"
108 (chroot ${ROOT_DIR} passwd -l root)
109 (chroot ${ROOT_DIR} useradd -s /bin/bash ${DEFUSER})
110 (chroot ${ROOT_DIR} passwd -d ${DEFUSER})
111 (chroot ${ROOT_DIR} adduser ${DEFUSER} cdrom)
112 (chroot ${ROOT_DIR} adduser ${DEFUSER} audio)
113 (chroot ${ROOT_DIR} adduser ${DEFUSER} video)
114 (chroot ${ROOT_DIR} adduser ${DEFUSER} plugdev)
115 (chroot ${ROOT_DIR} adduser ${DEFUSER} netdev)
116 (chroot ${ROOT_DIR} adduser ${DEFUSER} powerdev)
117 echo "${DEFUSER} ALL=(ALL) ALL" >> ${ROOT_DIR}/etc/sudoers
120 mv ${ROOT_DIR}/sbin/start-stop-daemon.REAL ${ROOT_DIR}/sbin/start-stop-daemon
121 (chroot ${ROOT_DIR} aptitude clean)
122 umount ${ROOT_DIR}/proc
123 umount ${ROOT_DIR}/dev/pts