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

« back to all changes in this revision

Viewing changes to scripts/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="$(extract_deb_field "$TARGET/$deb" Version)"
 
101
 
 
102
        mkdir -p "$TARGET/var/lib/dpkg/info"
 
103
 
 
104
        echo \
 
105
"Package: $pkg
 
106
Version: $ver
 
107
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
 
108
 
 
109
        touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
 
110
    }
 
111
 
 
112
    x_feign_install dpkg
 
113
}
 
114
 
 
115
second_stage_install () {
 
116
    x_core_install () {
 
117
        smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
 
118
    }
 
119
 
 
120
    p () {
 
121
        baseprog="$(($baseprog + ${1:-1}))"
 
122
    }
 
123
 
 
124
    setup_proc
 
125
    in_target /sbin/ldconfig
 
126
 
 
127
    DEBIAN_FRONTEND=Noninteractive
 
128
    export DEBIAN_FRONTEND
 
129
 
 
130
    baseprog=0
 
131
    bases=40
 
132
 
 
133
    p; progress $baseprog $bases INSTBASE "Installing base system" #1
 
134
    info INSTCORE "Installing core packages..."
 
135
 
 
136
    p; progress $baseprog $bases INSTBASE "Installing base system" #2
 
137
    ln -sf mawk "$TARGET/usr/bin/awk"
 
138
    x_core_install base-files base-passwd
 
139
    p; progress $baseprog $bases INSTBASE "Installing base system" #3
 
140
    x_core_install dpkg
 
141
 
 
142
    if [ ! -e "$TARGET/etc/localtime" ]; then
 
143
        ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
 
144
    fi
 
145
 
 
146
    p; progress $baseprog $bases INSTBASE "Installing base system" #4
 
147
    x_core_install $LIBC
 
148
 
 
149
    p; progress $baseprog $bases INSTBASE "Installing base system" #5
 
150
    x_core_install perl-base
 
151
    p; progress $baseprog $bases INSTBASE "Installing base system" #6
 
152
    rm "$TARGET/usr/bin/awk"
 
153
    x_core_install mawk
 
154
    p; progress $baseprog $bases INSTBASE "Installing base system" #7
 
155
    x_core_install debconf
 
156
 
 
157
    info UNPACKREQ "Unpacking required packages..."
 
158
 
 
159
    p; progress $baseprog $bases INSTBASE "Installing base system" #8
 
160
    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)
 
161
    p 10; progress $baseprog $bases INSTBASE "Installing base system"  #18
 
162
 
 
163
    info CONFREQ "Configuring required packages..."
 
164
 
 
165
    mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
 
166
    echo \
 
167
"#!/bin/sh
 
168
echo
 
169
echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
 
170
    chmod 755 "$TARGET/sbin/start-stop-daemon"
 
171
 
 
172
    setup_dselect_method apt
 
173
 
 
174
    p; progress $baseprog $bases INSTBASE "Installing base system" #19
 
175
    smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
 
176
    p 10; progress $baseprog $bases INSTBASE "Installing base system" #29
 
177
 
 
178
    if [ ! -e "$TARGET/etc/exim/exim.conf" ]; then
 
179
        mkdir -p "$TARGET/etc/exim"
 
180
        touch "$TARGET/etc/exim/exim.conf"
 
181
    fi
 
182
 
 
183
    info INSTBASE "Installing base packages..."
 
184
 
 
185
    p; progress $baseprog $bases INSTBASE "Installing base system" #30
 
186
    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)
 
187
 
 
188
    rm -f "$TARGET/usr/sbin/sendmail"
 
189
    ln -sf /bin/true "$TARGET/usr/sbin/sendmail"
 
190
 
 
191
    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
 
192
 
 
193
    rm -f "$TARGET/usr/sbin/sendmail"
 
194
    ln -sf exim "$TARGET/usr/sbin/sendmail"
 
195
 
 
196
    p 9; progress $baseprog $bases INSTBASE "Installing base system" #39
 
197
 
 
198
    mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
 
199
 
 
200
    progress $bases $bases INSTBASE "Installing base system" #40
 
201
    info BASESUCCESS "Base system installed successfully."
 
202
}