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

« back to all changes in this revision

Viewing changes to scripts/ubuntu/warty.buildd

  • 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
 
default_mirror http://old-releases.ubuntu.com/ubuntu
2
 
mirror_style release
3
 
download_style apt
4
 
 
5
 
LIBC=libc6
6
 
if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then
7
 
  LIBC="libc6.1"
8
 
fi
9
 
 
10
 
work_out_debs () {
11
 
 
12
 
    required="base-files base-passwd bash bsdutils build-essential coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs fakeroot 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 lsb-base mawk mount ncurses-base ncurses-bin perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g"
13
 
 
14
 
    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"
15
 
 
16
 
    without_package () {
17
 
        echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
18
 
    }
19
 
    subst_package () {
20
 
        echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
21
 
    }
22
 
 
23
 
    case $ARCH in
24
 
        "amd64")
25
 
            ;;
26
 
        "i386")
27
 
            ;;
28
 
        "powerpc")
29
 
            ;;
30
 
 
31
 
        # Unsupported architectures:
32
 
        "alpha")
33
 
            required="$(subst_package "libc6" "libc6.1" "$required")"
34
 
            base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
35
 
            ;;
36
 
        "ia64")
37
 
            required="$(subst_package "libc6" "libc6.1" "$required")"
38
 
            base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
39
 
            ;;
40
 
        *)
41
 
            # who knows?
42
 
            ;;
43
 
    esac
44
 
}
45
 
 
46
 
install_debs () {
47
 
    first_stage_install
48
 
    second_stage_install
49
 
}
50
 
 
51
 
first_stage_install () {
52
 
    extract $required
53
 
 
54
 
    mkdir -p "$TARGET/var/lib/dpkg"
55
 
    : >"$TARGET/var/lib/dpkg/status"
56
 
    echo >"$TARGET/var/lib/dpkg/available"
57
 
 
58
 
    setup_etc
59
 
    if [ ! -e "$TARGET/etc/fstab" ]; then
60
 
        echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
61
 
        chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
62
 
    fi
63
 
 
64
 
    setup_devices
65
 
 
66
 
    x_feign_install () {
67
 
        local pkg="$1"
68
 
        local deb="$(debfor $pkg)"
69
 
        local ver="$(
70
 
            ar -p "$TARGET/$deb" control.tar.gz | zcat |
71
 
                tar -O -xf - control ./control 2>/dev/null |
72
 
                grep -i ^Version: | sed -e 's/[^:]*: *//' | head -n 1
73
 
        )"
74
 
 
75
 
        mkdir -p "$TARGET/var/lib/dpkg/info"
76
 
 
77
 
        echo \
78
 
"Package: $pkg
79
 
Version: $ver
80
 
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
81
 
 
82
 
        touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
83
 
    }
84
 
 
85
 
    x_feign_install dpkg
86
 
}
87
 
 
88
 
second_stage_install () {
89
 
    x_core_install () {
90
 
        smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
91
 
    }
92
 
    p () {
93
 
        baseprog="$(($baseprog + ${1:-1}))"
94
 
    }
95
 
 
96
 
    DEBIAN_FRONTEND=noninteractive
97
 
    export DEBIAN_FRONTEND
98
 
 
99
 
    baseprog=0
100
 
    bases=40
101
 
 
102
 
    setup_proc
103
 
    in_target /sbin/ldconfig
104
 
 
105
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #1
106
 
    info INSTCORE "Installing core packages..."
107
 
 
108
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #2
109
 
    ln -sf mawk "$TARGET/usr/bin/awk"
110
 
    x_core_install base-files base-passwd
111
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #3
112
 
    x_core_install dpkg
113
 
 
114
 
    if [ ! -e "$TARGET/etc/localtime" ]; then
115
 
        ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
116
 
    fi
117
 
 
118
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #4
119
 
    x_core_install $LIBC
120
 
 
121
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #5
122
 
    x_core_install perl-base
123
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #6
124
 
    rm "$TARGET/usr/bin/awk"
125
 
    x_core_install mawk
126
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #7
127
 
 
128
 
    info UNPACKREQ "Unpacking required packages..."
129
 
 
130
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #8
131
 
    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)
132
 
    p 10; progress $baseprog $bases INSTCORE "Installing core packages" #18
133
 
 
134
 
    info CONFREQ "Configuring required packages..."
135
 
 
136
 
    mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
137
 
    echo \
138
 
"#!/bin/sh
139
 
echo
140
 
echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
141
 
    chmod 755 "$TARGET/sbin/start-stop-daemon"
142
 
 
143
 
    setup_dselect_method apt
144
 
    #on_exit "in_target_nofail umount /dev/pts"
145
 
 
146
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #19
147
 
    smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
148
 
    p 10; progress $baseprog $bases INSTCORE "Installing core packages" #29 
149
 
 
150
 
    info INSTCORE "Installing base packages..."
151
 
 
152
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #30
153
 
    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)
154
 
 
155
 
    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
156
 
 
157
 
    p 9; progress $baseprog $bases INSTCORE "Installing core packages" #39
158
 
 
159
 
    mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
160
 
 
161
 
    progress $bases $bases INSTCORE "Installing core packages" #40
162
 
    info BASESUCCESS "Base system installed successfully."
163
 
}