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

« back to all changes in this revision

Viewing changes to scripts/debian/sarge.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
 
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 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"
12
 
 
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"
14
 
 
15
 
    without_package () {
16
 
        echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
17
 
    }
18
 
    subst_package () {
19
 
        echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
20
 
    }
21
 
 
22
 
    case $ARCH in
23
 
        "alpha")
24
 
            required="$(subst_package "libc6" "libc6.1" "$required")"
25
 
            base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
26
 
            ;;
27
 
        "arm")
28
 
            ;;
29
 
        "i386")
30
 
            ;;
31
 
        "ia64")
32
 
            required="$(subst_package "libc6" "libc6.1" "$required")"
33
 
            base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
34
 
            ;;
35
 
        "m68k")
36
 
            ;;
37
 
        "powerpc")
38
 
            ;;
39
 
        "sparc")
40
 
            ;;
41
 
        "mips")
42
 
            ;;
43
 
        "mipsel")
44
 
            ;;
45
 
        "hppa")
46
 
            ;;
47
 
        s390|s390x)
48
 
            ;;
49
 
        sh*)
50
 
            ;;
51
 
        *)
52
 
            # who knows?
53
 
            ;;
54
 
    esac
55
 
}
56
 
 
57
 
first_stage_install () {
58
 
    extract $required
59
 
 
60
 
    mkdir -p "$TARGET/var/lib/dpkg"
61
 
    : >"$TARGET/var/lib/dpkg/status"
62
 
    echo >"$TARGET/var/lib/dpkg/available"
63
 
 
64
 
    setup_etc
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"
68
 
    fi
69
 
 
70
 
    setup_devices
71
 
 
72
 
    x_feign_install () {
73
 
        local pkg="$1"
74
 
        local deb="$(debfor $pkg)"
75
 
        local ver="$(
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
79
 
        )"
80
 
 
81
 
        mkdir -p "$TARGET/var/lib/dpkg/info"
82
 
 
83
 
        echo \
84
 
"Package: $pkg
85
 
Version: $ver
86
 
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
87
 
 
88
 
        touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
89
 
    }
90
 
 
91
 
    x_feign_install dpkg
92
 
}
93
 
 
94
 
second_stage_install () {
95
 
    x_core_install () {
96
 
        smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
97
 
    }
98
 
 
99
 
    p () {
100
 
        baseprog="$(($baseprog + ${1:-1}))"
101
 
    }
102
 
 
103
 
    setup_proc
104
 
    in_target /sbin/ldconfig
105
 
 
106
 
    DEBIAN_FRONTEND=noninteractive
107
 
    export DEBIAN_FRONTEND
108
 
 
109
 
    baseprog=0
110
 
    bases=40
111
 
 
112
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #1
113
 
    info INSTCORE "Installing core packages..."
114
 
 
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
119
 
    x_core_install dpkg
120
 
 
121
 
    if [ ! -e "$TARGET/etc/localtime" ]; then
122
 
        ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
123
 
    fi
124
 
 
125
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #4
126
 
    x_core_install $LIBC
127
 
 
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"
132
 
    x_core_install mawk
133
 
    p; progress $baseprog $bases INSTBASE "Installing base system" #7
134
 
 
135
 
    info UNPACKREQ "Unpacking required packages..."
136
 
 
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
140
 
 
141
 
    info CONFREQ "Configuring required packages..."
142
 
 
143
 
    mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
144
 
    echo \
145
 
"#!/bin/sh
146
 
echo
147
 
echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
148
 
    chmod 755 "$TARGET/sbin/start-stop-daemon"
149
 
 
150
 
    setup_dselect_method apt
151
 
 
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 
155
 
 
156
 
    info INSTBASE "Installing base packages..."
157
 
 
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)
160
 
 
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
162
 
 
163
 
    p 9; progress $baseprog $bases INSTBASE "Installing base system" #39
164
 
 
165
 
    mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
166
 
 
167
 
    progress $bases $bases INSTBASE "Installing base system" #40
168
 
    info BASESUCCESS "Base system installed successfully."
169
 
}