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

« back to all changes in this revision

Viewing changes to scripts/dapper

  • 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
case $ARCH in
 
2
  amd64|i386|powerpc|sparc)
 
3
    default_mirror http://archive.ubuntu.com/ubuntu
 
4
    ;;
 
5
  *)
 
6
    default_mirror http://ports.ubuntu.com/ubuntu-ports
 
7
    ;;
 
8
esac
 
9
mirror_style release
 
10
download_style apt
 
11
finddebs_style from-indices
 
12
variants - buildd
 
13
 
 
14
case $ARCH in
 
15
  alpha|ia64) LIBC="libc6.1" ;;
 
16
  *)          LIBC="libc6" ;;
 
17
esac
 
18
 
 
19
work_out_debs () {
 
20
    required="$(get_debs Priority: required)"
 
21
 
 
22
    if doing_variant -; then
 
23
      #required="$required $(get_debs Priority: important)"
 
24
      #  ^^ should be getting debconf here somehow maybe
 
25
      base="$(get_debs Priority: important)"
 
26
    elif doing_variant buildd; then
 
27
      # TODO: add Build-Essential: yes extraoverrides
 
28
      #base="$(get_debs Build-Essential: yes)"
 
29
 
 
30
      add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; }
 
31
 
 
32
      base="apt binutils cpio cpp cpp-4.0 dpkg-dev g++ g++-4.0 gcc gcc-4.0 ${LIBC}-dev libgdbm3 libstdc++6 libstdc++6-4.0-dev linux-kernel-headers make patch perl perl-modules"
 
33
 
 
34
      add ia64 base "libunwind7-dev"
 
35
      add sparc base "lib64gcc1"
 
36
      add sparc base "libc6-dev-sparc64"
 
37
      add sparc base "libc6-sparc64"
 
38
    fi
 
39
}
 
40
 
 
41
first_stage_install () {
 
42
    extract $required
 
43
 
 
44
    mkdir -p "$TARGET/var/lib/dpkg"
 
45
    : >"$TARGET/var/lib/dpkg/status"
 
46
    : >"$TARGET/var/lib/dpkg/available"
 
47
 
 
48
    setup_etc
 
49
    if [ ! -e "$TARGET/etc/fstab" ]; then
 
50
        echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
 
51
        chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
 
52
    fi
 
53
 
 
54
    setup_devices
 
55
 
 
56
    x_feign_install () {
 
57
        local pkg="$1"
 
58
        local deb="$(debfor $pkg)"
 
59
        local ver="$(extract_deb_field "$TARGET/$deb" Version)"
 
60
 
 
61
        mkdir -p "$TARGET/var/lib/dpkg/info"
 
62
 
 
63
        echo \
 
64
"Package: $pkg
 
65
Version: $ver
 
66
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
 
67
 
 
68
        touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
 
69
    }
 
70
 
 
71
    x_feign_install dpkg
 
72
}
 
73
 
 
74
second_stage_install () {
 
75
    x_core_install () {
 
76
        smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
 
77
    }
 
78
 
 
79
    p () {
 
80
        baseprog="$(($baseprog + ${1:-1}))"
 
81
    }
 
82
 
 
83
    setup_proc
 
84
    in_target /sbin/ldconfig
 
85
 
 
86
    DEBIAN_FRONTEND=noninteractive
 
87
    DEBCONF_NONINTERACTIVE_SEEN=true
 
88
    export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
 
89
 
 
90
    baseprog=0
 
91
    bases=7
 
92
 
 
93
    p; progress $baseprog $bases INSTCORE "Installing core packages" #1
 
94
    info INSTCORE "Installing core packages..."
 
95
 
 
96
    p; progress $baseprog $bases INSTCORE "Installing core packages" #2
 
97
    ln -sf mawk "$TARGET/usr/bin/awk"
 
98
    x_core_install base-files base-passwd
 
99
    p; progress $baseprog $bases INSTCORE "Installing core packages" #3
 
100
    x_core_install dpkg
 
101
 
 
102
    if [ ! -e "$TARGET/etc/localtime" ]; then
 
103
        ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
 
104
    fi
 
105
 
 
106
    p; progress $baseprog $bases INSTCORE "Installing core packages" #4
 
107
    x_core_install $LIBC
 
108
 
 
109
    p; progress $baseprog $bases INSTCORE "Installing core packages" #5
 
110
    x_core_install perl-base
 
111
 
 
112
    p; progress $baseprog $bases INSTCORE "Installing core packages" #6
 
113
    rm "$TARGET/usr/bin/awk"
 
114
    x_core_install mawk
 
115
 
 
116
    p; progress $baseprog $bases INSTCORE "Installing core packages" #7
 
117
    if doing_variant -; then
 
118
      x_core_install debconf
 
119
    fi
 
120
 
 
121
    baseprog=0
 
122
    bases=$(set -- $required; echo $#)
 
123
 
 
124
    info UNPACKREQ "Unpacking required packages..."
 
125
 
 
126
    smallyes '' |
 
127
      (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages.  This will be attempted up to five times." "" \
 
128
      dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
 
129
      dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
 
130
 
 
131
    info CONFREQ "Configuring required packages..."
 
132
 
 
133
    mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
 
134
    echo \
 
135
"#!/bin/sh
 
136
echo
 
137
echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
 
138
    chmod 755 "$TARGET/sbin/start-stop-daemon"
 
139
 
 
140
    setup_dselect_method apt
 
141
 
 
142
    smallyes '' |
 
143
      (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
 
144
      dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
 
145
      dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
 
146
 
 
147
    baseprog=0
 
148
    bases="$(set -- $base; echo $#)"
 
149
 
 
150
    info UNPACKBASE "Unpacking the base system..."
 
151
 
 
152
    smallyes '' |
 
153
      (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages.  This will be re-attempted up to five times." "" \
 
154
      dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
 
155
      dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
 
156
 
 
157
    info CONFBASE "Configuring the base system..."
 
158
 
 
159
    smallyes '' |
 
160
      (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages.  This will be attempted 5 times." "" \
 
161
      dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
 
162
      dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
 
163
 
 
164
    mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
 
165
 
 
166
    progress $bases $bases CONFBASE "Configuring base system"
 
167
    info BASESUCCESS "Base system installed successfully."
 
168
}