5 # ftp.debian.org only has amd64 and i386
6 default_mirror http://ftp.us.debian.org/debian
11 finddebs_style from-indices
12 variants - buildd fakechroot
14 if doing_variant fakechroot; then
15 test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
20 if [ "$ARCH" = "alpha" -o "$ARCH" = "ia64" ]; then LIBC6="libc6.1"; fi
22 required="$(get_debs Priority: required)"
24 if doing_variant - || doing_variant fakechroot; then
25 #required="$required $(get_debs Priority: important)"
26 # ^^ should be getting debconf here somehow maybe
27 base="$(get_debs Priority: important)"
28 elif doing_variant buildd; then
29 base="$(get_debs Build-Essential: yes)"
32 if doing_variant fakechroot; then
33 # ldd.fake needs binutils
34 required="$required binutils"
38 first_stage_install () {
41 mkdir -p "$TARGET/var/lib/dpkg"
42 : >"$TARGET/var/lib/dpkg/status"
43 echo >"$TARGET/var/lib/dpkg/available"
46 if [ ! -e "$TARGET/etc/fstab" ]; then
47 echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
48 chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
51 if [ -x $TARGET/usr/bin/md5sum.textutils -a \! -e $TARGET/usr/bin/md5sum ]; then
52 cp $TARGET/usr/bin/md5sum.textutils $TARGET/usr/bin/md5sum
55 if doing_variant fakechroot; then
56 setup_devices_fakechroot
63 local deb="$(debfor $pkg)"
65 ar -p "$TARGET/$deb" control.tar.gz | zcat |
66 tar -O -xf - control ./control 2>/dev/null |
67 sed -ne 's/^Version: *//Ip' | head -n 1
70 mkdir -p "$TARGET/var/lib/dpkg/info"
75 Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
77 touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
83 second_stage_install () {
85 smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
89 baseprog="$(($baseprog + ${1:-1}))"
92 if doing_variant fakechroot; then
96 in_target /sbin/ldconfig
99 DEBIAN_FRONTEND=noninteractive
100 DEBCONF_NONINTERACTIVE_SEEN=true
101 export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
106 p; progress $baseprog $bases INSTCORE "Installing core packages" #1
107 info INSTCORE "Installing core packages..."
109 p; progress $baseprog $bases INSTCORE "Installing core packages" #2
110 ln -sf mawk $TARGET/usr/bin/awk
111 x_core_install base-files base-passwd
112 p; progress $baseprog $bases INSTCORE "Installing core packages" #3
115 if [ ! -e "$TARGET/etc/localtime" ]; then
116 ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
119 if doing_variant fakechroot; then
120 install_fakechroot_tools
123 p; progress $baseprog $bases INSTCORE "Installing core packages" #4
124 x_core_install $LIBC6
126 p; progress $baseprog $bases INSTCORE "Installing core packages" #5
127 x_core_install perl-base
129 p; progress $baseprog $bases INSTCORE "Installing core packages" #6
130 rm $TARGET/usr/bin/awk
133 p; progress $baseprog $bases INSTCORE "Installing core packages" #7
134 if doing_variant -; then
135 x_core_install debconf
139 bases=$(set -- $required; echo $#)
141 info UNPACKREQ "Unpacking required packages..."
146 (repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
147 dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) |
148 dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING
150 info CONFREQ "Configuring required packages..."
152 mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
156 echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
157 chmod 755 "$TARGET/sbin/start-stop-daemon"
159 setup_dselect_method apt
162 (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
163 dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) |
164 dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING
167 bases="$(set -- $base; echo $#)"
169 info UNPACKBASE "Unpacking the base system..."
172 (repeat 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
173 dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) |
174 dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING
176 info CONFBASE "Configuring the base system..."
180 in_target_failmsg CONF_BASE_FAIL "Failure while configuring base packages." "" \
181 dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) |
182 dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING
184 mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
186 progress $bases $bases CONFBASE "Configuring base system"
187 info BASESUCCESS "Base system installed successfully."