~ubuntu-branches/ubuntu/hardy/debootstrap/hardy-backports

« back to all changes in this revision

Viewing changes to scripts/debian/woody

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-10-21 11:36:48 UTC
  • mfrom: (0.1.8 maverick)
  • Revision ID: james.westby@ubuntu.com-20101021113648-fac3y327xkwbmdte
Tags: 1.0.23ubuntu1~hardy1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
mirror_style release
2
 
download_style apt
3
 
 
4
 
LIBC=libc6
5
 
if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then
6
 
  LIBC="libc6.1"
7
 
fi
8
 
 
9
 
work_out_debs () {
10
 
 
11
 
    required="base-files base-passwd bash bsdutils debconf debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname libcap1 libc6 libdb2 libdb3 libncurses5 libnewt0 libpam-modules libpam-runtime libpam0g libperl5.6 libpopt0 libreadline4 libstdc++2.10-glibc2.2 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed shellutils slang1 sysvinit tar textutils util-linux whiptail"
12
 
 
13
 
    base="adduser apt apt-utils at base-config bsdmainutils console-common console-tools console-tools-libs console-data cpio cron dhcp-client ed exim fdutils gettext-base groff-base ifupdown info klogd libident libldap2 liblockfile1 libpcre3 libsasl7 libwrap0 logrotate mailx man-db manpages modconf nano net-tools netbase netkit-inetd netkit-ping nvi ppp pppconfig pppoe pppoeconf libpcap0 sysklogd tasksel tcpd telnet"
14
 
 
15
 
    without_package () {
16
 
        echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
17
 
    }
18
 
 
19
 
    IPFWTOOL=iptables
20
 
 
21
 
    case $ARCH in
22
 
        "alpha")
23
 
            required="$(without_package "libc6" "$required") libc6.1"
24
 
            base="$base setserial aboot pciutils"
25
 
            IPFWTOOL="ipchains"
26
 
            ;;
27
 
        "arm")
28
 
            base="$base setserial libgpmg1"
29
 
            IPFWTOOL="ipchains iptables"
30
 
            ;;
31
 
        "i386")
32
 
            required="$(without_package "libperl5.6" "$required") mbr"
33
 
            base="$base lilo pciutils setserial syslinux psmisc pcmcia-cs"
34
 
            IPFWTOOL="ipchains iptables"
35
 
            ;;
36
 
        "ia64")
37
 
            required="$(without_package "libc6" "$required") libc6.1 gcc-2.96-base"
38
 
            base="$base elilo efibootmgr dosfstools libparted1.4 parted"
39
 
            ;;
40
 
        "m68k")
41
 
            base="$base atari-bootstrap atari-fdisk amiga-fdisk eject mac-fdisk pmac-fdisk-cross setserial vmelilo"
42
 
            IPFWTOOL="ipchains"
43
 
            ;;
44
 
        "powerpc")
45
 
            base="$base quik mac-fdisk amiga-fdisk psmisc powerpc-utils setserial pciutils hfsutils yaboot pcmcia-cs"
46
 
            IPFWTOOL="ipchains iptables"
47
 
            ;;
48
 
        "sparc")
49
 
            base="$base silo eject pciutils sparc-utils"
50
 
            IPFWTOOL="ipchains iptables"
51
 
            ;;
52
 
        "mips")
53
 
            base="$base dvhtool pciutils setserial" # pcmcia-cs
54
 
            ;;
55
 
        "mipsel")
56
 
            base="$base delo pciutils setserial" # pcmcia-cs
57
 
            ;;
58
 
        "hppa")
59
 
            base="$base palo libstdc++3 gcc-3.0-base"
60
 
            required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
61
 
            ;;
62
 
        s390|s390x)
63
 
            # base-config depends on console-data and console-common
64
 
            # so we can't exclude them although they are useless on s390
65
 
            base="$base s390-tools telnetd devfsd"
66
 
            base="$(without_package "console-tools" "$base")"
67
 
            base="$(without_package "console-tools-libs" "$base")"
68
 
            base="$(without_package "fdutils" "$base")"
69
 
            base="$(without_package "ppp" "$base")"
70
 
            base="$(without_package "pppconfig" "$base")"
71
 
            base="$(without_package "pppoe" "$base")"
72
 
            base="$(without_package "pppoeconf" "$base")"
73
 
            ;;
74
 
        *)
75
 
            # who knows?
76
 
            ;;
77
 
    esac
78
 
 
79
 
    base="$base $IPFWTOOL"
80
 
}
81
 
 
82
 
first_stage_install () {
83
 
    extract $required
84
 
 
85
 
    mkdir -p "$TARGET/var/lib/dpkg"
86
 
    : >"$TARGET/var/lib/dpkg/status"
87
 
    echo >"$TARGET/var/lib/dpkg/available"
88
 
 
89
 
    setup_etc
90
 
    if [ ! -e "$TARGET/etc/fstab" ]; then
91
 
        echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
92
 
        chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
93
 
    fi
94
 
 
95
 
    setup_devices
96
 
 
97
 
    x_feign_install () {
98
 
        local pkg="$1"
99
 
        local deb="$(debfor $pkg)"
100
 
        local ver="$(
101
 
            ar -p "$TARGET/$deb" control.tar.gz | zcat |
102
 
                tar -O -xf - control ./control 2>/dev/null |
103
 
                grep -i ^Version: | sed -e 's/[^:]*: *//' | head -n 1
104
 
        )"
105
 
 
106
 
        mkdir -p "$TARGET/var/lib/dpkg/info"
107
 
 
108
 
        echo \
109
 
"Package: $pkg
110
 
Version: $ver
111
 
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
112
 
 
113
 
        touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
114
 
    }
115
 
 
116
 
    x_feign_install dpkg
117
 
}
118
 
 
119
 
second_stage_install () {
120
 
    x_core_install () {
121
 
        smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
122
 
    }
123
 
 
124
 
    p () {
125
 
        baseprog="$(($baseprog + ${1:-1}))"
126
 
    }
127
 
 
128
 
    setup_proc
129
 
    in_target /sbin/ldconfig
130
 
 
131
 
    DEBIAN_FRONTEND=Noninteractive
132
 
    export DEBIAN_FRONTEND
133
 
 
134
 
    baseprog=0
135
 
    bases=40
136
 
 
137
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #1
138
 
    info INSTCORE "Installing core packages..."
139
 
 
140
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #2
141
 
    ln -sf mawk "$TARGET/usr/bin/awk"
142
 
    x_core_install base-files base-passwd
143
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #3
144
 
    x_core_install dpkg
145
 
 
146
 
    if [ ! -e "$TARGET/etc/localtime" ]; then
147
 
        ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
148
 
    fi
149
 
 
150
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #4
151
 
    x_core_install $LIBC
152
 
 
153
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #5
154
 
    x_core_install perl-base
155
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #6
156
 
    rm "$TARGET/usr/bin/awk"
157
 
    x_core_install mawk
158
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #7
159
 
    x_core_install debconf
160
 
 
161
 
    info UNPACKREQ "Unpacking required packages..."
162
 
 
163
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #8
164
 
    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)
165
 
    p 10; progress $baseprog $bases INSTBASE "Installing base system"  #18
166
 
 
167
 
    info CONFREQ "Configuring required packages..."
168
 
 
169
 
    mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
170
 
    echo \
171
 
"#!/bin/sh
172
 
echo
173
 
echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
174
 
    chmod 755 "$TARGET/sbin/start-stop-daemon"
175
 
 
176
 
    setup_dselect_method apt
177
 
 
178
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #19
179
 
    smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
180
 
    p 10; progress $baseprog $bases INSTBASE "Installing base system" #29 
181
 
 
182
 
    if [ ! -e "$TARGET/etc/exim/exim.conf" ]; then
183
 
        mkdir -p "$TARGET/etc/exim"
184
 
        touch "$TARGET/etc/exim/exim.conf"
185
 
    fi
186
 
 
187
 
    info INSTBASE "Installing base packages..."
188
 
 
189
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #30
190
 
    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)
191
 
 
192
 
    rm -f "$TARGET/usr/sbin/sendmail"
193
 
    ln -sf /bin/true "$TARGET/usr/sbin/sendmail"
194
 
 
195
 
    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
196
 
 
197
 
    rm -f "$TARGET/usr/sbin/sendmail"
198
 
    ln -sf exim "$TARGET/usr/sbin/sendmail"
199
 
 
200
 
    p 9; progress $baseprog $bases INSTBASE "Installing base system" #39
201
 
 
202
 
    mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
203
 
 
204
 
    progress $bases $bases INSTBASE "Installing base system" #40
205
 
    info BASESUCCESS "Base system installed successfully."
206
 
}