6
if [ "$SUITE" = stable ]
8
required="base-files base-passwd bash bsdutils debconf debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname libcap1 libc6 libdb2 libdb3 libgdbmg1 libncurses5 libpam-modules libpam-runtime libpam0g libperl5.6 libreadline4 libstdc++2.10-glibc2.2 login mawk mount ncurses-base ncurses-bin passwd perl-base sed shellutils slang1 sysvinit tar textutils util-linux"
9
elif [ "$SUITE" = testing ]; then
10
required="base-files base-passwd bash bsdutils coreutils debconf debianutils diff dpkg dselect e2fsprogs fileutils findutils grep gzip hostname libcap1 libc6 libdb1-compat libdb2 libdb3 libdb4.0 libgdbmg1 libncurses5 libpam-modules libpam-runtime libpam0g libperl5.6 libreadline4 libstdc++2.10-glibc2.2 login mawk mount ncurses-base ncurses-bin passwd perl-base sed slang1 sysvinit tar util-linux"
12
required="base-files base-passwd bash bsdutils coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login makedev mawk mbr modutils mount ncurses-base ncurses-bin passwd perl-base procps sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g"
15
base="apt binutils cpio cpp dpkg-dev gcc g++ make patch perl perl-modules ssmtp sudo"
18
echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
23
if [ "$SUITE" = unstable ]; then
26
required="$(without_package "libc6" "$required") libc6.1"
27
base="$base gcc-3.2-base gcc-3.3-base gcc-3.2 gcc-3.3 g++-3.2 g++-3.3 cpp-3.2 cpp-3.3 libgcc1 libc6.1-dev libstdc++5-dev libstdc++5-3.3-dev fakeroot"
32
base="$base gcc-3.2-base gcc-3.3-base gcc-3.2 gcc-3.3 g++-3.2 g++-3.3 cpp-3.2 cpp-3.3 libgcc1 libc6-dev libstdc++5-dev libstdc++5-3.3-dev fakeroot"
38
required="$(without_package "libc6" "$required") libc6.1"
39
base="$base gcc-2.95 g++-2.95 cpp-2.95 libc6.1-dev libstdc++2.10-dev fakeroot"
43
base="$base gcc-2.95 g++-2.95 cpp-2.95 libc6-dev libstdc++2.10-dev fakeroot"
46
required="$(without_package "libperl5.6" "$required")"
47
base="$base gcc-2.95 g++-2.95 cpp-2.95 libc6-dev libstdc++2.10-dev fakeroot"
50
required="$(without_package "libc6" "$required") libc6.1"
51
base="$base gcc-2.96 gcc-2.96-base g++-2.96 cpp-2.96 libc6.1-dev libstdc++2.10-dev fakeroot"
55
base="$base gcc-2.95 g++-2.95 cpp-2.95 libc6-dev libstdc++2.10-dev fakeroot"
58
base="$base gcc-2.95 g++-2.95 cpp-2.95 libc6-dev libstdc++2.10-dev fakeroot"
61
base="$base gcc-2.95 g++-2.95 cpp-2.95 libc6-dev libstdc++2.10-dev fakeroot sparc-utils makedev"
64
base="$base gcc-2.95 g++-2.95 cpp-2.95 libc6-dev libstdc++2.10-dev"
67
base="$base gcc-2.95 g++-2.95 cpp-2.95 libc6-dev libstdc++2.10-dev"
70
base="$base libstdc++3 gcc-3.0-base gcc-3.0 g++-3.0 cpp-3.0 libc6-dev libstdc++3-dev fakeroot libgcc1"
71
required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
79
all_debs="$required $base"
85
mkdir -p $TARGET/var/lib/dpkg
86
echo -n >$TARGET/var/lib/dpkg/status
87
echo -n >$TARGET/var/lib/dpkg/available
90
if [ ! -e $TARGET/etc/fstab ]; then
91
echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' >$TARGET/etc/fstab
92
chown 0.0 $TARGET/etc/fstab; chmod 644 $TARGET/etc/fstab
98
if [ ! -e $TARGET/etc/ld.so.conf ]; then
99
#warning "Creating empty ld.so.conf"
100
info "(WARNING) Creating empty ld.so.conf"
101
touch $TARGET/etc/ld.so.conf
102
chown 0.0 $TARGET/etc/ld.so.conf
104
in_target /sbin/ldconfig
108
local deb=$(debfor $pkg)
110
ar -p $TARGET/$deb control.tar.gz | zcat |
111
tar -O -xf - control ./control 2>/dev/null |
112
sed -ne 's/^Version: *//Ip' | head -n 1
115
mkdir -p $TARGET/var/lib/dpkg/info
117
cat >>$TARGET/var/lib/dpkg/status << EOF
120
Status: install ok installed
123
touch $TARGET/var/lib/dpkg/info/${pkg}.list
127
in_target dpkg --force-depends --install $(debfor "$@")
132
export DEBIAN_FRONTEND=noninteractive
134
info "Installing essential packages"
136
x_core_install base-files base-passwd ldso
139
if [ ! -e $TARGET/etc/localtime ]; then
140
ln -s /usr/share/zoneinfo/UTC $TARGET/etc/localtime
143
if [ ! -e $TARGET/etc/hosts ]; then
144
cp /etc/hosts $TARGET/etc
147
x_core_install $LIBC6
149
x_core_install perl-base
151
x_core_install debconf
153
repeat 5 in_target dpkg --force-depends --unpack $(debfor $required)
154
# for p in $required; do
155
# repeat 20 in_target dpkg --force-depends --unpack $(debfor $p)
158
mv $TARGET/sbin/start-stop-daemon $TARGET/sbin/start-stop-daemon.REAL
159
cp $TARGET/bin/true $TARGET/sbin/start-stop-daemon
161
setup_dselect_method apt
162
on_exit "in_target_nofail umount /dev/pts"
164
in_target dpkg --configure --pending --force-configure-any --force-depends
166
info "Installing base packages"
168
repeat 5 in_target dpkg --force-auto-select --force-overwrite \
169
--force-confold --skip-same-version --install $(debfor $base)
171
mv $TARGET/sbin/start-stop-daemon.REAL $TARGET/sbin/start-stop-daemon
173
cp /etc/resolv.conf $TARGET/etc
175
echo "# $SUITE" > $TARGET/etc/apt/sources.list
176
echo "deb http://http.us.debian.org/debian/ $SUITE main non-free contrib" >> $TARGET/etc/apt/sources.list
177
echo "deb-src http://http.us.debian.org/debian/ $SUITE main non-free contrib" >> $TARGET/etc/apt/sources.list
178
echo "" >> $TARGET/etc/apt/sources.list
179
echo "# $SUITE non-us" >> $TARGET/etc/apt/sources.list
180
echo "deb http://non-us.debian.org/debian-non-US $SUITE/non-US main contrib non-free" >> $TARGET/etc/apt/sources.list
181
echo "deb-src http://non-us.debian.org/debian-non-US $SUITE/non-US main contrib non-free" >> $TARGET/etc/apt/sources.list
183
USER=root; GROUP=sbuild
184
mkdir -p $TARGET/var/lib/sbuild/srcdep-lock $TARGET/build
185
chown -R $USER:$GROUP $TARGET/var/lib/sbuild $TARGET/build
186
chmod -R 02775 $TARGET/var/lib/sbuild
188
info "Successfully set up chroot: $SUITE"
192
-------------------------------------------------------------------------
193
Please add this line to /etc/fstab:
195
none $TARGET/proc proc defaults 0 0
199
sudo mount $TARGET/proc
201
The add_sbuild_user script sets up the new chroot for a user:
203
sudo /usr/lib/sbuild/add_sbuild_user $TARGET $SUITE <user>
205
-------------------------------------------------------------------------