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

« back to all changes in this revision

Viewing changes to warty.template

  • 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="@WARTY_REQUIRED@"
 
7
 
 
8
    base="@WARTY_BASE@ $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
        "i386")
 
21
            required="$required @WARTY_REQUIRED_I386@"
 
22
            base="$base @WARTY_BASE_I386@"
 
23
            ;;
 
24
        "powerpc")
 
25
            required="$required @WARTY_REQUIRED_POWERPC@"
 
26
            base="$base @WARTY_BASE_POWERPC@"
 
27
            ;;
 
28
        "amd64")
 
29
            base="$base @WARTY_BASE_AMD64@"
 
30
            ;;
 
31
        *)
 
32
            # who knows?
 
33
            ;;
 
34
    esac
 
35
 
 
36
    all_debs="$required $base"
 
37
 
 
38
    for x in $exclude; do
 
39
      all_debs="$(without_package "$x" "$all_debs")"
 
40
    done
 
41
    
 
42
}
 
43
 
 
44
install_debs () {
 
45
    first_stage_install
 
46
    second_stage_install
 
47
}
 
48
 
 
49
first_stage_install () {
 
50
    extract $required
 
51
 
 
52
    mkdir -p "$TARGET/var/lib/dpkg"
 
53
    : >"$TARGET/var/lib/dpkg/status"
 
54
    : >"$TARGET/var/lib/dpkg/available"
 
55
 
 
56
    setup_etc
 
57
    if [ ! -e "$TARGET/etc/fstab" ]; then
 
58
        echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
 
59
        chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
 
60
    fi
 
61
 
 
62
    setup_proc
 
63
    setup_devices
 
64
 
 
65
    in_target /sbin/ldconfig
 
66
 
 
67
    p () {
 
68
        baseprog="$(($baseprog + ${1:-1}))"
 
69
    }
 
70
 
 
71
    x_feign_install () {
 
72
        local pkg="$1"
 
73
        local deb="$(debfor $pkg)"
 
74
        local ver="$(
 
75
            ar -p "$TARGET/$deb" control.tar.gz | zcat |
 
76
                tar -O -xf - control ./control 2>/dev/null |
 
77
                sed -ne 's/^Version: *//Ip' | head -n 1
 
78
        )"
 
79
 
 
80
        mkdir -p "$TARGET/var/lib/dpkg/info"
 
81
 
 
82
        echo \
 
83
"Package: $pkg
 
84
Version: $ver
 
85
Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
 
86
 
 
87
        touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
 
88
    }
 
89
 
 
90
    x_feign_install dpkg
 
91
}
 
92
 
 
93
second_stage_install () {
 
94
    x_core_install () {
 
95
        smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
 
96
    }
 
97
 
 
98
    DEBIAN_FRONTEND=noninteractive
 
99
    DEBCONF_NONINTERACTIVE_SEEN=true
 
100
    export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
 
101
 
 
102
    baseprog=0
 
103
    bases=7
 
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 -s 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 $LIBC6
 
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
    x_core_install debconf
 
128
 
 
129
    baseprog=0
 
130
    bases="$(set -- $required; echo $#)"
 
131
 
 
132
    info UNPACKREQ "Unpacking required packages..."
 
133
 
 
134
    smallyes '' | (repeat 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages.  This will be attempted up to five times." "" dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
 
135
 
 
136
    baseprog=0
 
137
 
 
138
    info CONFREQ "Configuring required packages..."
 
139
 
 
140
    mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
 
141
    echo \
 
142
"#!/bin/sh
 
143
echo
 
144
echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
 
145
    chmod 755 "$TARGET/sbin/start-stop-daemon"
 
146
 
 
147
    setup_dselect_method apt
 
148
    #on_exit "(in_target_nofail umount /dev/pts) || true"
 
149
 
 
150
    smallyes '' | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
 
151
 
 
152
    baseprog=0
 
153
    bases="$(set -- $base; echo $#)"
 
154
 
 
155
    info UNPACKBASE "Unpacking the base system..."
 
156
 
 
157
    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 --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
 
158
 
 
159
    baseprog=0
 
160
 
 
161
    info CONFBASE "Configuring the base system..."
 
162
 
 
163
    mv "$TARGET/usr/sbin/sendmail" "$TARGET/usr/sbin/sendmail.REAL"
 
164
    ln -s /bin/true "$TARGET/usr/sbin/sendmail"
 
165
 
 
166
    smallyes '' | (repeat 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages.  This will be attempted 5 times." "" dpkg --status-fd 8 --force-confold --skip-same-version  --configure -a 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
 
167
 
 
168
    rm -f "$TARGET/usr/sbin/sendmail"
 
169
    mv "$TARGET/usr/sbin/sendmail.REAL" "$TARGET/usr/sbin/sendmail"
 
170
 
 
171
    mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
 
172
 
 
173
    progress $bases $bases CONFBASE "Configuring base system"
 
174
    info BASESUCCESS "Base system installed successfully."
 
175
}
 
176