2 amd64|i386|powerpc|sparc)
3 default_mirror http://archive.ubuntu.com/ubuntu
6 default_mirror http://ports.ubuntu.com/ubuntu-ports
11 finddebs_style from-indices
16 if [ "$ARCH" = "alpha" -o "$ARCH" = "ia64" ]; then LIBC6="libc6.1"; fi
18 required="$(get_debs Priority: required)"
20 if doing_variant -; then
21 #required="$required $(get_debs Priority: important)"
22 # ^^ should be getting debconf here somehow maybe
23 base="$(get_debs Priority: important)"
24 elif doing_variant buildd; then
25 # TODO: add Build-Essential: yes extraoverrides
26 #base="$(get_debs Build-Essential: yes)"
28 add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; }
30 base="apt binutils cpio cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 ${LIBC6}-dev libdb4.4 libgdbm3 libstdc++6 libstdc++6-4.1-dev linux-libc-dev make patch perl perl-modules"
32 add ia64 base "libunwind7-dev"
33 add sparc base "lib64gcc1"
34 add sparc base "libc6-dev-sparc64"
35 add sparc base "libc6-sparc64"
39 first_stage_install () {
42 mkdir -p "$TARGET/var/lib/dpkg"
43 : >"$TARGET/var/lib/dpkg/status"
44 : >"$TARGET/var/lib/dpkg/available"
47 if [ ! -e "$TARGET/etc/fstab" ]; then
48 echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
49 chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
56 local deb="$(debfor $pkg)"
58 ar -p "$TARGET/$deb" control.tar.gz | zcat |
59 tar -O -xf - control ./control 2>/dev/null |
60 sed -ne 's/^Version: *//Ip' | head -n 1
63 mkdir -p "$TARGET/var/lib/dpkg/info"
68 Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
70 touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
76 second_stage_install () {
78 smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
82 baseprog="$(($baseprog + ${1:-1}))"
86 in_target /sbin/ldconfig
88 DEBIAN_FRONTEND=noninteractive
89 DEBCONF_NONINTERACTIVE_SEEN=true
90 export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
95 p; progress $baseprog $bases INSTCORE "Installing core packages" #1
96 info INSTCORE "Installing core packages..."
98 p; progress $baseprog $bases INSTCORE "Installing core packages" #2
99 ln -sf mawk $TARGET/usr/bin/awk
100 x_core_install base-files base-passwd
101 p; progress $baseprog $bases INSTCORE "Installing core packages" #3
104 if [ ! -e "$TARGET/etc/localtime" ]; then
105 ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
108 p; progress $baseprog $bases INSTCORE "Installing core packages" #4
109 x_core_install $LIBC6
111 p; progress $baseprog $bases INSTCORE "Installing core packages" #5
112 x_core_install perl-base
114 p; progress $baseprog $bases INSTCORE "Installing core packages" #6
115 rm $TARGET/usr/bin/awk
118 p; progress $baseprog $bases INSTCORE "Installing core packages" #7
119 if doing_variant -; then
120 x_core_install debconf
124 bases=$(set -- $required; echo $#)
126 info UNPACKREQ "Unpacking required packages..."
129 (repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
130 dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
131 dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
133 info CONFREQ "Configuring required packages..."
135 mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
139 echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
140 chmod 755 "$TARGET/sbin/start-stop-daemon"
142 setup_dselect_method apt
145 (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
146 dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
147 dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
150 bases="$(set -- $base; echo $#)"
152 info UNPACKBASE "Unpacking the base system..."
155 (repeat 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
156 dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
157 dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
159 info CONFBASE "Configuring the base system..."
162 (repeat 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \
163 dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
164 dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
166 mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
168 progress $bases $bases CONFBASE "Configuring base system"
169 info BASESUCCESS "Base system installed successfully."