5
if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then
11
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 mawk mount ncurses-base ncurses-bin passwd perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g"
13
base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules"
16
echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
19
echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
24
required="$(subst_package "libc6" "libc6.1" "$required")"
25
base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
32
required="$(subst_package "libc6" "libc6.1" "$required")"
33
base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
57
first_stage_install () {
60
mkdir -p "$TARGET/var/lib/dpkg"
61
: >"$TARGET/var/lib/dpkg/status"
62
echo >"$TARGET/var/lib/dpkg/available"
65
if [ ! -e "$TARGET/etc/fstab" ]; then
66
echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
67
chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
74
local deb="$(debfor $pkg)"
76
ar -p "$TARGET/$deb" control.tar.gz | zcat |
77
tar -O -xf - control ./control 2>/dev/null |
78
grep -i ^Version: | sed -e 's/[^:]*: *//' | head -n 1
81
mkdir -p "$TARGET/var/lib/dpkg/info"
86
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
88
touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
94
second_stage_install () {
96
smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
100
baseprog="$(($baseprog + ${1:-1}))"
104
in_target /sbin/ldconfig
106
DEBIAN_FRONTEND=noninteractive
107
export DEBIAN_FRONTEND
112
p; progress $baseprog $bases INSTBASE "Installing base system" #1
113
info INSTCORE "Installing core packages..."
115
p; progress $baseprog $bases INSTBASE "Installing base system" #2
116
ln -sf mawk "$TARGET/usr/bin/awk"
117
x_core_install base-files base-passwd
118
p; progress $baseprog $bases INSTBASE "Installing base system" #3
121
if [ ! -e "$TARGET/etc/localtime" ]; then
122
ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
125
p; progress $baseprog $bases INSTBASE "Installing base system" #4
128
p; progress $baseprog $bases INSTBASE "Installing base system" #5
129
x_core_install perl-base
130
p; progress $baseprog $bases INSTBASE "Installing base system" #6
131
rm "$TARGET/usr/bin/awk"
133
p; progress $baseprog $bases INSTBASE "Installing base system" #7
135
info UNPACKREQ "Unpacking required packages..."
137
p; progress $baseprog $bases INSTBASE "Installing base system" #8
138
smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required)
139
p 10; progress $baseprog $bases INSTBASE "Installing base system" #18
141
info CONFREQ "Configuring required packages..."
143
mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
147
echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
148
chmod 755 "$TARGET/sbin/start-stop-daemon"
150
setup_dselect_method apt
152
p; progress $baseprog $bases INSTBASE "Installing base system" #19
153
smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
154
p 10; progress $baseprog $bases INSTBASE "Installing base system" #29
156
info INSTBASE "Installing base packages..."
158
p; progress $baseprog $bases INSTBASE "Installing base system" #30
159
smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
161
smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a
163
p 9; progress $baseprog $bases INSTBASE "Installing base system" #39
165
mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
167
progress $bases $bases INSTBASE "Installing base system" #40
168
info BASESUCCESS "Base system installed successfully."