3 finddebs_style from-indices
8 if [ "$ARCH" = "alpha" -o "$ARCH" = "ia64" ]; then LIBC6="libc6.1"; fi
10 required="$(get_debs Priority: required)"
12 if doing_variant -; then
13 #required="$required $(get_debs Priority: important)"
14 # ^^ should be getting debconf here somehow maybe
15 base="$(get_debs Priority: important)"
16 elif doing_variant buildd; then
17 # TODO: add Build-Essential: yes extraoverrides
18 #base="$(get_debs Build-Essential: yes)"
20 add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; }
22 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"
24 add ia64 base "libunwind7-dev"
25 add sparc base "lib64gcc1"
26 add sparc base "libc6-dev-sparc64"
27 add sparc base "libc6-sparc64"
31 first_stage_install () {
34 mkdir -p "$TARGET/var/lib/dpkg"
35 : >"$TARGET/var/lib/dpkg/status"
36 : >"$TARGET/var/lib/dpkg/available"
39 if [ ! -e "$TARGET/etc/fstab" ]; then
40 echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
41 chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
48 local deb="$(debfor $pkg)"
50 ar -p "$TARGET/$deb" control.tar.gz | zcat |
51 tar -O -xf - control ./control 2>/dev/null |
52 sed -ne 's/^Version: *//Ip' | head -n 1
55 mkdir -p "$TARGET/var/lib/dpkg/info"
60 Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
62 touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
68 second_stage_install () {
70 smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
74 baseprog="$(($baseprog + ${1:-1}))"
78 in_target /sbin/ldconfig
80 DEBIAN_FRONTEND=noninteractive
81 DEBCONF_NONINTERACTIVE_SEEN=true
82 export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
87 p; progress $baseprog $bases INSTCORE "Installing core packages" #1
88 info INSTCORE "Installing core packages..."
90 p; progress $baseprog $bases INSTCORE "Installing core packages" #2
91 ln -sf mawk $TARGET/usr/bin/awk
92 x_core_install base-files base-passwd
93 p; progress $baseprog $bases INSTCORE "Installing core packages" #3
96 if [ ! -e "$TARGET/etc/localtime" ]; then
97 ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
100 p; progress $baseprog $bases INSTCORE "Installing core packages" #4
101 x_core_install $LIBC6
103 p; progress $baseprog $bases INSTCORE "Installing core packages" #5
104 x_core_install perl-base
106 p; progress $baseprog $bases INSTCORE "Installing core packages" #6
107 rm $TARGET/usr/bin/awk
110 p; progress $baseprog $bases INSTCORE "Installing core packages" #7
111 if doing_variant -; then
112 x_core_install debconf
116 bases=$(set -- $required; echo $#)
118 info UNPACKREQ "Unpacking required packages..."
121 (repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
122 dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
123 dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
125 info CONFREQ "Configuring required packages..."
127 mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
131 echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
132 chmod 755 "$TARGET/sbin/start-stop-daemon"
134 setup_dselect_method apt
137 (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
138 dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
139 dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
142 bases="$(set -- $base; echo $#)"
144 info UNPACKBASE "Unpacking the base system..."
147 (repeat 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
148 dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
149 dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
151 info CONFBASE "Configuring the base system..."
154 (repeat 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \
155 dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
156 dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
158 mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
160 progress $bases $bases CONFBASE "Configuring base system"
161 info BASESUCCESS "Base system installed successfully."