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

« back to all changes in this revision

Viewing changes to scripts/debian/sid

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador, Otavio Salvador, Guillem Jover, Frans Pop, Joey Hess
  • Date: 2010-02-21 23:11:06 UTC
  • mto: (0.1.7 maverick)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: james.westby@ubuntu.com-20100221231106-leq9wi54r2kbxyjk
Tags: 1.0.21
[ Otavio Salvador ]
* Apply patch from Clint Adams <schizo@debian.org> to add support for
  gz/bz2/xz data.tar (closes: #458663).

[ Guillem Jover ]
* Refactor deb extractors into two new functions.
* Use dpkg-deb if available instead of ar (closes: #557296).
* Add an --extractor option to override the automatic extractor selection.

[ Otavio Salvador ]
* Document new --extractor option in manpage.
* Apply patch from Vagrant Cascadian <vagrant+bugs@freegeek.org> not
  fail if resolv.conf is a broken symlink (closes: #390647).

[ Frans Pop ]
* Use tab indentation in scripts/debian/sid to reduce its size (relevant
  for Debian Installer).
* Add apt to base packages for the buildd variant as it is no longer marked
  Build-Essential.

[ Otavio Salvador ]
* Apply patch from Andres Salomon <dilinger@collabora.co.uk> to honor
  --components when using mirror_style 'main' (closes: #561283).
* Apply patch from Andres Salomon <dilinger@collabora.co.uk> to fix
  iteration through components in download_main (closes: #561298).

[ Joey Hess ]
* Allow the suite to be stable, testing, or unstable when debootstrapping
  Debian. Closes: #288109
* Make scripts directory in source tree look like installed directory,
  and add a section to README explaining an easy way to run
  debootstrap w/o installing it. Closes: #345762
* Convert rules file to use dh with overrides.
* Remove binary-basedebs target from debian/rules.
  This target has been broken in multiple ways since 2007. While I
  accidentially partially fixed it with the above changes, this is evidence
  it's dead code that can be safely removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
mirror_style release
2
 
download_style apt
3
 
finddebs_style from-indices
4
 
variants - buildd fakechroot minbase scratchbox
5
 
 
6
 
if doing_variant fakechroot; then
7
 
    test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
8
 
fi
9
 
 
10
 
case $ARCH in
11
 
  alpha|ia64) LIBC="libc6.1" ;;
12
 
  kfreebsd-*) LIBC="libc0.1" ;;
13
 
  hurd-*)     LIBC="libc0.3" ;;
14
 
  *)          LIBC="libc6" ;;
15
 
esac
16
 
 
17
 
work_out_debs () {
18
 
    required="$(get_debs Priority: required)"
19
 
 
20
 
    if doing_variant - || doing_variant fakechroot; then 
21
 
      #required="$required $(get_debs Priority: important)"
22
 
      #  ^^ should be getting debconf here somehow maybe
23
 
      base="$(get_debs Priority: important)"
24
 
    elif doing_variant buildd || doing_variant scratchbox; then
25
 
      base="$(get_debs Build-Essential: yes)"
26
 
    elif doing_variant minbase; then
27
 
      base="apt"
28
 
    fi
29
 
 
30
 
    if doing_variant fakechroot; then 
31
 
      # ldd.fake needs binutils
32
 
      required="$required binutils"
33
 
    fi
34
 
}
35
 
 
36
 
first_stage_install () {
37
 
    extract $required
38
 
 
39
 
    mkdir -p "$TARGET/var/lib/dpkg"
40
 
    : >"$TARGET/var/lib/dpkg/status"
41
 
    echo >"$TARGET/var/lib/dpkg/available"
42
 
 
43
 
    setup_etc
44
 
    if [ ! -e "$TARGET/etc/fstab" ]; then
45
 
        echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
46
 
        chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
47
 
    fi
48
 
 
49
 
    if [ -x "$TARGET/usr/bin/md5sum.textutils" ] && [ \! -e "$TARGET/usr/bin/md5sum" ]; then
50
 
        cp "$TARGET/usr/bin/md5sum.textutils" "$TARGET/usr/bin/md5sum"
51
 
    fi
52
 
 
53
 
    if doing_variant fakechroot; then 
54
 
        setup_devices_fakechroot
55
 
    else
56
 
        setup_devices
57
 
    fi
58
 
 
59
 
    x_feign_install () {
60
 
        local pkg="$1"
61
 
        local deb="$(debfor $pkg)"
62
 
        local ver="$(
63
 
            ar -p "$TARGET/$deb" control.tar.gz | zcat |
64
 
                tar -O -xf - control ./control 2>/dev/null |
65
 
                grep -i ^Version: | sed -e 's/[^:]*: *//' | head -n 1
66
 
        )"
67
 
 
68
 
        mkdir -p "$TARGET/var/lib/dpkg/info"
69
 
 
70
 
        echo \
71
 
"Package: $pkg
72
 
Version: $ver
73
 
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
74
 
 
75
 
        touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
76
 
    }
77
 
 
78
 
    x_feign_install dpkg
79
 
}
80
 
 
81
 
second_stage_install () {
82
 
    x_core_install () {
83
 
        smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
84
 
    }
85
 
 
86
 
    p () {
87
 
        baseprog="$(($baseprog + ${1:-1}))"
88
 
    }
89
 
 
90
 
    if doing_variant fakechroot; then 
91
 
        setup_proc_fakechroot
92
 
    elif doing_variant scratchbox; then
93
 
        true
94
 
    else
95
 
        setup_proc
96
 
        in_target /sbin/ldconfig
97
 
    fi
98
 
 
99
 
    DEBIAN_FRONTEND=noninteractive
100
 
    DEBCONF_NONINTERACTIVE_SEEN=true
101
 
    export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
102
 
 
103
 
    baseprog=0
104
 
    bases=7
105
 
 
106
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #1
107
 
    info INSTCORE "Installing core packages..."
108
 
 
109
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #2
110
 
    ln -sf mawk "$TARGET/usr/bin/awk"
111
 
    x_core_install base-files base-passwd
112
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #3
113
 
    x_core_install dpkg
114
 
 
115
 
    if [ ! -e "$TARGET/etc/localtime" ]; then
116
 
        ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
117
 
    fi
118
 
 
119
 
    if doing_variant fakechroot; then 
120
 
        install_fakechroot_tools
121
 
    fi
122
 
 
123
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #4
124
 
    x_core_install $LIBC
125
 
 
126
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #5
127
 
    x_core_install perl-base
128
 
 
129
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #6
130
 
    rm "$TARGET/usr/bin/awk"
131
 
    x_core_install mawk
132
 
 
133
 
    p; progress $baseprog $bases INSTCORE "Installing core packages" #7
134
 
    if doing_variant -; then
135
 
      x_core_install debconf
136
 
    fi
137
 
 
138
 
    baseprog=0
139
 
    bases=$(set -- $required; echo $#)
140
 
 
141
 
    info UNPACKREQ "Unpacking required packages..."
142
 
 
143
 
    exec 7>&1
144
 
 
145
 
    smallyes '' | 
146
 
     (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages.  This will be attempted up to five times." "" \
147
 
        dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) |
148
 
     dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING
149
 
 
150
 
    info CONFREQ "Configuring required packages..."
151
 
 
152
 
    mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
153
 
    echo \
154
 
"#!/bin/sh
155
 
echo
156
 
echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
157
 
    chmod 755 "$TARGET/sbin/start-stop-daemon"
158
 
 
159
 
    setup_dselect_method apt
160
 
 
161
 
    smallyes '' | 
162
 
     (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
163
 
       dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) |
164
 
     dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING
165
 
 
166
 
    baseprog=0
167
 
    bases="$(set -- $base; echo $#)"
168
 
 
169
 
    info UNPACKBASE "Unpacking the base system..."
170
 
 
171
 
    setup_available $required $base
172
 
    done_predeps=
173
 
    while predep=$(get_next_predep); do
174
 
      # We have to resolve dependencies of pre-dependencies manually because
175
 
      # dpkg --predep-package doesn't handle this.
176
 
      predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps")
177
 
      # XXX: progress is tricky due to how dpkg_progress works
178
 
      # -- cjwatson 2009-07-29
179
 
      p; smallyes '' | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep)
180
 
      base=$(without "$base" "$predep")
181
 
      done_predeps="$done_predeps $predep"
182
 
    done
183
 
 
184
 
    smallyes '' | 
185
 
     (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages.  This will be re-attempted up to five times." "" \
186
 
       dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) |
187
 
     dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING
188
 
 
189
 
    info CONFBASE "Configuring the base system..."
190
 
 
191
 
    smallyes '' |
192
 
     (repeatn 5 \
193
 
      in_target_failmsg CONF_BASE_FAIL "Failure while configuring base packages." "" \
194
 
      dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) |
195
 
     dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING
196
 
  
197
 
    mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
198
 
 
199
 
    progress $bases $bases CONFBASE "Configuring base system"
200
 
    info BASESUCCESS "Base system installed successfully."
201
 
}