~ubuntu-branches/ubuntu/gutsy/debootstrap/gutsy-backports

« back to all changes in this revision

Viewing changes to warty.buildd

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson, warty
  • Date: 2004-10-13 00:02:10 UTC
  • Revision ID: james.westby@ubuntu.com-20041013000210-6kxir6wy5l3x0qm0
Tags: 0.2.39ubuntu22
[warty] Remove pcmcia-cs from Base.

Show diffs side-by-side

added added

removed removed

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