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