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
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"
19
alpha|ia64) LIBC="libc6.1" ;;
24
required="$(get_debs Priority: required)"
26
if doing_variant -; then
27
#required="$required $(get_debs Priority: important)"
28
# ^^ should be getting debconf here somehow maybe
29
base="$(get_debs Priority: important)"
30
elif doing_variant buildd; then
31
# TODO: add Build-Essential: yes extraoverrides
32
#base="$(get_debs Build-Essential: yes)"
34
add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; }
36
base="apt binutils cpio cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 ${LIBC}-dev libdb4.4 libgdbm3 libstdc++6 libstdc++6-4.1-dev linux-libc-dev make patch perl perl-modules"
38
add ia64 base "libunwind7-dev"
39
add sparc base "lib64gcc1"
40
add sparc base "libc6-dev-sparc64"
41
add sparc base "libc6-sparc64"
42
elif doing_variant fakechroot; then
47
first_stage_install () {
50
mkdir -p "$TARGET/var/lib/dpkg"
51
: >"$TARGET/var/lib/dpkg/status"
52
: >"$TARGET/var/lib/dpkg/available"
55
if [ ! -e "$TARGET/etc/fstab" ]; then
56
echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
57
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
60
if doing_variant fakechroot; then
61
setup_devices_fakechroot
68
local deb="$(debfor $pkg)"
69
local ver="$(extract_deb_field "$TARGET/$deb" Version)"
71
mkdir -p "$TARGET/var/lib/dpkg/info"
76
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
78
touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
84
second_stage_install () {
86
smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
90
baseprog="$(($baseprog + ${1:-1}))"
93
if doing_variant fakechroot; then
97
in_target /sbin/ldconfig
100
DEBIAN_FRONTEND=noninteractive
101
DEBCONF_NONINTERACTIVE_SEEN=true
102
export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
107
p; progress $baseprog $bases INSTCORE "Installing core packages" #1
108
info INSTCORE "Installing core packages..."
110
p; progress $baseprog $bases INSTCORE "Installing core packages" #2
111
ln -sf mawk "$TARGET/usr/bin/awk"
112
x_core_install base-files base-passwd
113
p; progress $baseprog $bases INSTCORE "Installing core packages" #3
116
if [ ! -e "$TARGET/etc/localtime" ]; then
117
ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
120
if doing_variant fakechroot; then
121
install_fakechroot_tools
124
p; progress $baseprog $bases INSTCORE "Installing core packages" #4
127
p; progress $baseprog $bases INSTCORE "Installing core packages" #5
128
x_core_install perl-base
130
p; progress $baseprog $bases INSTCORE "Installing core packages" #6
131
rm "$TARGET/usr/bin/awk"
134
p; progress $baseprog $bases INSTCORE "Installing core packages" #7
135
if doing_variant -; then
136
x_core_install debconf
140
bases=$(set -- $required; echo $#)
142
info UNPACKREQ "Unpacking required packages..."
145
(repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
146
dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
147
dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
149
info CONFREQ "Configuring required packages..."
151
if doing_variant fakechroot; then
152
# fix initscripts postinst (no mounting possible, and wrong if condition)
153
sed -i '/dpkg.*--compare-versions/ s/\<lt\>/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst"
155
# kill libdevmapper postinst; it tries to create /dev/mapper/
156
rm "$TARGET/var/lib/dpkg/info/libdevmapper1"*.postinst
159
mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
163
echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
164
chmod 755 "$TARGET/sbin/start-stop-daemon"
166
setup_dselect_method apt
169
(in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
170
dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
171
dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
174
bases="$(set -- $base; echo $#)"
176
info UNPACKBASE "Unpacking the base system..."
179
(repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
180
dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
181
dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
183
info CONFBASE "Configuring the base system..."
186
(repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \
187
dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
188
dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
190
mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
192
progress $bases $bases CONFBASE "Configuring base system"
193
info BASESUCCESS "Base system installed successfully."