defaults.sh 27.1 KB
Newer Older
Daniel Baumann's avatar
Daniel Baumann committed
1
2
#!/bin/sh

3
## live-build(7) - System Build Scripts
4
## Copyright (C) 2006-2014 Daniel Baumann <mail@daniel-baumann.ch>
5
##
6
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7
8
9
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.

Daniel Baumann's avatar
Daniel Baumann committed
10

11
12
New_configuration ()
{
13
	## Runtime
14

15
16
	# Image: Architecture
	if [ -x "/usr/bin/dpkg" ]
17
	then
18
19
20
21
22
23
		CURRENT_IMAGE_ARCHITECTURE="$(dpkg --print-architecture)"
	else
		case "$(uname -m)" in
			x86_64)
				CURRENT_IMAGE_ARCHITECTURE="amd64"
				;;
24

25
26
27
28
29
30
31
32
33
			i?86)
				CURRENT_IMAGE_ARCHITECTURE="i386"
				;;

			*)
				Echo_warning "Unable to determine current architecture, using ${CURRENT_IMAGE_ARCHITECTURE}"
				;;
		esac
	fi
34
35
36
37
38


	## Configuration

	# Configuration-Version
39
	LIVE_CONFIGURATION_VERSION="${LIVE_CONFIGURATION_VERSION:-$(Get_configuration config/build Configuration-Version)}"
40
41
42
	LIVE_CONFIGURATION_VERSION="${LIVE_CONFIGURATION_VERSION:-${LIVE_BUILD_VERSION}}"
	export LIVE_CONFIGURATION_VERSION

43
	# Image: Name
44
	LIVE_IMAGE_NAME="${LIVE_IMAGE_NAME:-$(Get_configuration config/build Name)}"
45
	LIVE_IMAGE_NAME="${LIVE_IMAGE_NAME:-live-image}"
46
	export LIVE_IMAGE_NAME
47
48

	# Image: Architecture (FIXME: Support and default to 'any')
49
	LIVE_IMAGE_ARCHITECTURE="${LIVE_IMAGE_ARCHITECTURE:-$(Get_configuration config/build Architecture)}"
50
51
52
	LIVE_IMAGE_ARCHITECTURE="${LIVE_IMAGE_ARCHITECTURE:-${CURRENT_IMAGE_ARCHITECTURE}}"
	export LIVE_IMAGE_ARCHITECTURE

53
	# Image: Archive Areas
54
	LIVE_IMAGE_ARCHIVE_AREAS="${LIVE_IMAGE_ARCHIVE_AREAS:-$(Get_configuration config/build Archive-Areas)}"
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

	case "${LB_MODE}" in
		progress-linux)
			LIVE_IMAGE_ARCHIVE_AREAS="${LIVE_IMAGE_ARCHIVE_AREAS:-main contrib non-free}"
			;;

		ubuntu)
			LIVE_IMAGE_ARCHIVE_AREAS="${LIVE_IMAGE_ARCHIVE_AREAS:-main restricted}"
			;;

		*)
			LIVE_IMAGE_ARCHIVE_AREAS="${LIVE_IMAGE_ARCHIVE_AREAS:-main}"
			;;
	esac

	export LIVE_IMAGE_ARCHIVE_AREAS

72
	# Image: Archive Areas
73
	LIVE_IMAGE_PARENT_ARCHIVE_AREAS="${LIVE_IMAGE_PARENT_ARCHIVE_AREAS:-$(Get_configuration config/build Parent-Archive-Areas)}"
74
75
76
	LIVE_IMAGE_PARENT_ARCHIVE_AREAS="${LIVE_IMAGE_PARENT_ARCHIVE_AREAS:-${LIVE_IMAGE_ARCHIVE_AREAS}}"
	export LIVE_IMAGE_PARENT_ARCHIVE_AREAS

77
	# Image: Type
78
	LIVE_IMAGE_TYPE="${LIVE_IMAGE_TYPE:-$(Get_configuration config/build Type)}"
79
80
	LIVE_IMAGE_TYPE="${LIVE_IMAGE_TYPE:-iso-hybrid}"
	export LIVE_IMAGE_TYPE
81
82
}

Daniel Baumann's avatar
Daniel Baumann committed
83
84
Set_defaults ()
{
85
86
87
	# FIXME
	New_configuration

Daniel Baumann's avatar
Daniel Baumann committed
88
89
	## config/common

90
91
	if [ -e local/live-build ]
	then
92
		LIVE_BUILD="${LIVE_BUILD:-${PWD}/local/live-build}"
93
		export LIVE_BUILD
94
	fi
95

96
	# Setting system type
97
	LB_SYSTEM="${LB_SYSTEM:-live}"
98

99
	# Setting mode (currently: debian, progress-linux, and ubuntu)
100
101
	if [ -x /usr/bin/lsb_release ]
	then
102
		_DISTRIBUTOR="$(lsb_release -is | tr "[A-Z]" "[a-z]")"
103
104

		case "${_DISTRIBUTOR}" in
105
			debian|progress-linux|ubuntu)
106
107
108
109
110
111
112
113
				LB_MODE="${LB_MODE:-${_DISTRIBUTOR}}"
				;;

			*)
				LB_MODE="${LB_MODE:-debian}"
				;;
		esac
	else
114
		if [ -e /etc/progress-linux_version ]
115
		then
116
			LB_MODE="${LB_MODE:-progress-linux}"
117
118
119
		elif [ -e /etc/ubuntu_version ]
		then
			LB_MODE="${LB_MODE:-ubuntu}"
120
121
		else
			LB_MODE="${LB_MODE:-debian}"
122
123
		fi
	fi
Daniel Baumann's avatar
Daniel Baumann committed
124

Daniel Baumann's avatar
Daniel Baumann committed
125
	# Setting distribution name
126
	case "${LB_MODE}" in
127
		progress-linux)
128
			LB_DISTRIBUTION="${LB_DISTRIBUTION:-baureo}"
129
			LB_DERIVATIVE="true"
130
131
			;;

132
		ubuntu)
133
			LB_DISTRIBUTION="${LB_DISTRIBUTION:-quantal}"
134
			LB_DERIVATIVE="false"
135
			;;
Cody A.W. Somerville's avatar
Cody A.W. Somerville committed
136

137
		*)
138
			LB_DISTRIBUTION="${LB_DISTRIBUTION:-jessie}"
139
			LB_DERIVATIVE="false"
140
141
142
143
			;;
	esac

	case "${LB_MODE}" in
144
		progress-linux)
145
			case "${LB_DISTRIBUTION}" in
146
				baureo|baureo-backports)
147
148
149
150
					LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION:-wheezy}"
					LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}"
					;;

151
				charon|charon-backports)
152
					LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION:-sid}"
153
					LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}"
154
155
					;;
			esac
156
157

			LB_BACKPORTS="${LB_BACKPORTS:-true}"
158
159
160
161
			;;

		*)
			LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION:-${LB_DISTRIBUTION}}"
162
			LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}"
163
164

			LB_BACKPORTS="${LB_BACKPORTS:-false}"
165
166
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
167

Daniel Baumann's avatar
Daniel Baumann committed
168
	# Setting package manager
169
	LB_APT="${LB_APT:-apt}"
Daniel Baumann's avatar
Daniel Baumann committed
170

Daniel Baumann's avatar
Daniel Baumann committed
171
	# Setting apt ftp proxy
172
	LB_APT_FTP_PROXY="${LB_APT_FTP_PROXY}"
Daniel Baumann's avatar
Daniel Baumann committed
173
174

	# Setting apt http proxy
175
	LB_APT_HTTP_PROXY="${LB_APT_HTTP_PROXY}"
Daniel Baumann's avatar
Daniel Baumann committed
176

Daniel Baumann's avatar
Daniel Baumann committed
177
	# Setting apt pipeline
178
	# LB_APT_PIPELINE
Daniel Baumann's avatar
Daniel Baumann committed
179

Daniel Baumann's avatar
Daniel Baumann committed
180
181
182
	APT_OPTIONS="${APT_OPTIONS:---yes}"
	APTITUDE_OPTIONS="${APTITUDE_OPTIONS:---assume-yes}"

183
	BZIP2_OPTIONS="${BZIP2_OPTIONS:--6}"
184

185
	GZIP_OPTIONS="${GZIP_OPTIONS:--6}"
186

187
	if gzip --help | grep -qs "\-\-rsyncable"
188
	then
189
		GZIP_OPTIONS="$(echo ${GZIP_OPTIONS} | sed -e 's|--rsyncable||') --rsyncable"
190
191
	fi

192
	LZIP_OPTIONS="${LZIP_OPTIONS:--6}"
193

194
	LZMA_OPTIONS="${LZMA_OPTIONS:--6}"
195

196
197
	XZ_OPTIONS="${XZ_OPTIONS:--6}"

Daniel Baumann's avatar
Daniel Baumann committed
198
	# Setting apt recommends
199
	case "${LB_MODE}" in
200
		progress-linux)
201
			LB_APT_RECOMMENDS="${LB_APT_RECOMMENDS:-false}"
Daniel Baumann's avatar
Daniel Baumann committed
202
			;;
203
204
205
206

		*)
			LB_APT_RECOMMENDS="${LB_APT_RECOMMENDS:-true}"
			;;
Daniel Baumann's avatar
Daniel Baumann committed
207
	esac
Daniel Baumann's avatar
Daniel Baumann committed
208

Daniel Baumann's avatar
Daniel Baumann committed
209
	# Setting apt secure
210
	LB_APT_SECURE="${LB_APT_SECURE:-true}"
Daniel Baumann's avatar
Daniel Baumann committed
211

212
	# Setting apt source
213
	case "${LB_MODE}" in
214
		progress-linux)
215
			LB_APT_SOURCE_ARCHIVES="${LB_APT_SOURCE_ARCHIVES:-false}"
216
217
218
			;;

		*)
219
			LB_APT_SOURCE_ARCHIVES="${LB_APT_SOURCE_ARCHIVES:-true}"
220
221
			;;
	esac
222

Daniel Baumann's avatar
Daniel Baumann committed
223
	# Setting bootstrap program
224
	if [ -z "${LB_BOOTSTRAP}" ] || ( [ ! -x "$(which ${LB_BOOTSTRAP} 2>/dev/null)" ] && [ "${LB_BOOTSTRAP}" != "copy" ] )
Daniel Baumann's avatar
Daniel Baumann committed
225
	then
Daniel Baumann's avatar
Daniel Baumann committed
226
227
		if [ -x "/usr/sbin/debootstrap" ]
		then
228
			LB_BOOTSTRAP="debootstrap"
Daniel Baumann's avatar
Daniel Baumann committed
229
230
		elif [ -x "/usr/bin/cdebootstrap" ]
		then
231
			LB_BOOTSTRAP="cdebootstrap"
Daniel Baumann's avatar
Daniel Baumann committed
232
		fi
Daniel Baumann's avatar
Daniel Baumann committed
233
234
235
	fi

	# Setting cache option
236
237
238
239
	LB_CACHE="${LB_CACHE:-true}"
	LB_CACHE_INDICES="${LB_CACHE_INDICES:-false}"
	LB_CACHE_PACKAGES="${LB_CACHE_PACKAGES:-true}"
	LB_CACHE_STAGES="${LB_CACHE_STAGES:-bootstrap}"
Daniel Baumann's avatar
Daniel Baumann committed
240
241

	# Setting debconf frontend
242
243
	LB_DEBCONF_FRONTEND="${LB_DEBCONF_FRONTEND:-noninteractive}"
	LB_DEBCONF_PRIORITY="${LB_DEBCONF_PRIORITY:-critical}"
Daniel Baumann's avatar
Daniel Baumann committed
244

Daniel Baumann's avatar
Daniel Baumann committed
245
	# Setting initramfs hook
246
247
	case "${LB_SYSTEM}" in
		live)
248
			case "${LB_MODE}" in
249
				ubuntu)
250
					LB_INITRAMFS="${LB_INITRAMFS:-casper}"
Cody A.W. Somerville's avatar
Cody A.W. Somerville committed
251
252
					;;

Daniel Baumann's avatar
Daniel Baumann committed
253
				*)
254
					LB_INITRAMFS="${LB_INITRAMFS:-live-boot}"
Daniel Baumann's avatar
Daniel Baumann committed
255
					;;
Daniel Baumann's avatar
Daniel Baumann committed
256
			esac
257
258
			;;

259
260
		normal)
			LB_INITRAMFS="${LB_INITRAMFS:-none}"
261
262
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
263

264
265
	LB_INITRAMFS_COMPRESSION="${LB_INITRAMFS_COMPRESSION:-gzip}"

266
	# Setting initsystem
Marco Amadori's avatar
Marco Amadori committed
267
	case "${LB_MODE}" in
268
		ubuntu)
269
270
271
272
273
			case "${LB_INITRAMFS}" in
				live-boot)
					LB_INITSYSTEM="${LB_INITSYSTEM:-upstart}"
					;;
			esac
Marco Amadori's avatar
Marco Amadori committed
274
			;;
275

276
		progress-linux)
277
278
279
280
281
282
283
284
285
			case "${LB_DISTRIBUTION}" in
				chairon*)
					LB_INITSYSTEM="${LB_INITSYSTEM:-systemd}"
					;;

				*)
					LB_INITSYSTEM="${LB_INITSYSTEM:-sysvinit}"
					;;
			esac
286
287
			;;

288
		*)
289
290
291
292
293
294
295
296
297
			case "${LB_SYSTEM}" in
				live)
					LB_INITSYSTEM="${LB_INITSYSTEM:-sysvinit}"
					;;

				normal)
					LB_INITSYSTEM="${LB_INITSYSTEM:-none}"
					;;
			esac
298
			;;
Marco Amadori's avatar
Marco Amadori committed
299
	esac
300

301
	# Setting fdisk
302
	if [ -z "${LB_FDISK}" ] || [ ! -x "${LB_FDISK}" ]
303
304
305
306
307
	then
		# Workaround for gnu-fdisk divertion
		# (gnu-fdisk is buggy, #445304).
		if [ -x /sbin/fdisk.distrib ]
		then
308
			LB_FDISK="fdisk.distrib"
309
310
		elif [ -x /sbin/fdisk ]
		then
311
			LB_FDISK="fdisk"
312
		else
313
			Echo_error "Can't process file /sbin/fdisk"
314
315
316
		fi
	fi

Daniel Baumann's avatar
Daniel Baumann committed
317
	# Setting losetup
318
	if [ -z "${LB_LOSETUP}" ] || [ "${LB_LOSETUP}" != "/sbin/losetup.orig" ]
Daniel Baumann's avatar
Daniel Baumann committed
319
	then
Daniel Baumann's avatar
Daniel Baumann committed
320
		# Workaround for loop-aes-utils divertion
321
		# (loop-aes-utils' losetup lacks features).
Daniel Baumann's avatar
Daniel Baumann committed
322
323
		if [ -x /sbin/losetup.orig ]
		then
324
			LB_LOSETUP="losetup.orig"
Daniel Baumann's avatar
Daniel Baumann committed
325
326
		elif [ -x /sbin/losetup ]
		then
327
			LB_LOSETUP="losetup"
Daniel Baumann's avatar
Daniel Baumann committed
328
		else
329
			Echo_error "Can't process file /sbin/losetup"
Daniel Baumann's avatar
Daniel Baumann committed
330
		fi
Daniel Baumann's avatar
Daniel Baumann committed
331
332
	fi

333
	if [ "${LIVE_IMAGE_ARCHITECTURE}" = "i386" ] && [ "${CURRENT_IMAGE_ARCHITECTURE}" = "amd64" ]
334
	then
335
		# Use linux32 when building amd64 images on i386
336
337
338
		_LINUX32="linux32"
	else
		_LINUX32=""
339
340
	fi

Daniel Baumann's avatar
Daniel Baumann committed
341
	# Setting tasksel
342
	LB_TASKSEL="${LB_TASKSEL:-apt}"
Daniel Baumann's avatar
Daniel Baumann committed
343

Daniel Baumann's avatar
Daniel Baumann committed
344
	# Setting root directory
345
	case "${LB_MODE}" in
346
		progress-linux)
347
348
349
			LB_ROOT="${LB_ROOT:-progress-linux}"
			;;

350
351
352
353
		*)
			LB_ROOT="${LB_ROOT:-${LB_MODE}-live}"
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
354

Daniel Baumann's avatar
Daniel Baumann committed
355
	# Setting templates
356
	if [ -n "${LIVE_BUILD}" ]
357
358
359
360
361
	then
		LB_TEMPLATES="${LB_TEMPLATES:-${LIVE_BUILD}/templates}"
	else
		LB_TEMPLATES="${LB_TEMPLATES:-/usr/share/live/build/templates}"
	fi
Daniel Baumann's avatar
Daniel Baumann committed
362

363
	# Setting live build options
364
	_BREAKPOINTS="${_BREAKPOINTS:-false}"
365
	_COLOR="${_COLOR:-false}"
366
367
368
369
	_DEBUG="${_DEBUG:-false}"
	_FORCE="${_FORCE:-false}"
	_QUIET="${_QUIET:-false}"
	_VERBOSE="${_VERBOSE:-false}"
Daniel Baumann's avatar
Daniel Baumann committed
370
371
372

	## config/bootstrap

Daniel Baumann's avatar
Daniel Baumann committed
373
	# Setting mirror to fetch packages from
374
	case "${LB_MODE}" in
375
		debian)
376
			LB_MIRROR_BOOTSTRAP="${LB_MIRROR_BOOTSTRAP:-http://ftp.debian.org/debian/}"
377
			LB_PARENT_MIRROR_BOOTSTRAP="${LB_PARENT_MIRROR_BOOTSTRAP:-${LB_MIRROR_BOOTSTRAP}}"
378
			;;
Daniel Baumann's avatar
Daniel Baumann committed
379

380
		progress-linux)
381
			LB_PARENT_MIRROR_BOOTSTRAP="${LB_PARENT_MIRROR_BOOTSTRAP:-http://ftp.debian.org/debian/}"
382
			LB_MIRROR_BOOTSTRAP="${LB_MIRROR_BOOTSTRAP:-http://cdn.archive.progress-linux.org/packages/}"
383
384
			;;

385
		ubuntu)
386
			case "${LIVE_IMAGE_ARCHITECTURE}" in
387
				amd64|i386)
388
					LB_MIRROR_BOOTSTRAP="${LB_MIRROR_BOOTSTRAP:-http://archive.ubuntu.com/ubuntu/}"
389
					;;
Cody A.W. Somerville's avatar
Cody A.W. Somerville committed
390

391
				*)
392
					LB_MIRROR_BOOTSTRAP="${LB_MIRROR_BOOTSTRAP:-http://ports.ubuntu.com/ubuntu-ports/}"
393
394
					;;
			esac
395

396
			LB_PARENT_MIRROR_BOOTSTRAP="${LB_PARENT_MIRROR_BOOTSTRAP:-${LB_MIRROR_BOOTSTRAP}}"
397
398
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
399

400
	LB_PARENT_MIRROR_CHROOT="${LB_PARENT_MIRROR_CHROOT:-${LB_PARENT_MIRROR_BOOTSTRAP}}"
401
	LB_MIRROR_CHROOT="${LB_MIRROR_CHROOT:-${LB_MIRROR_BOOTSTRAP}}"
402

Daniel Baumann's avatar
Daniel Baumann committed
403
	# Setting security mirror to fetch packages from
404
	case "${LB_MODE}" in
405
		debian)
406
			LB_MIRROR_CHROOT_SECURITY="${LB_MIRROR_CHROOT_SECURITY:-http://security.debian.org/}"
407
			LB_PARENT_MIRROR_CHROOT_SECURITY="${LB_PARENT_MIRROR_CHROOT_SECURITY:-${LB_MIRROR_CHROOT_SECURITY}}"
408
			;;
Daniel Baumann's avatar
Daniel Baumann committed
409

410
		progress-linux)
411
			LB_PARENT_MIRROR_CHROOT_SECURITY="${LB_PARENT_MIRROR_CHROOT_SECURITY:-http://security.debian.org/}"
412
			LB_MIRROR_CHROOT_SECURITY="${LB_MIRROR_CHROOT_SECURITY:-${LB_MIRROR_CHROOT}}"
413
414
			;;

415
		ubuntu)
416
			case "${LIVE_IMAGE_ARCHITECTURE}" in
417
				amd64|i386)
418
					LB_MIRROR_CHROOT_SECURITY="${LB_MIRROR_CHROOT_SECURITY:-http://security.ubuntu.com/ubuntu/}"
419
					;;
Cody A.W. Somerville's avatar
Cody A.W. Somerville committed
420

421
				*)
422
					LB_MIRROR_CHROOT_SECURITY="${LB_MIRROR_CHROOT_SECURITY:-http://ports.ubuntu.com/ubuntu-ports/}"
423
424
					;;
			esac
425

426
			LB_PARENT_MIRROR_CHROOT_SECURITY="${LB_PARENT_MIRROR_CHROOT_SECURITY:-${LB_MIRROR_CHROOT_SECURITY}}"
427
428
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
429

Daniel Baumann's avatar
Daniel Baumann committed
430
	# Setting mirror which ends up in the image
431
	case "${LB_MODE}" in
432
		debian)
433
			LB_MIRROR_BINARY="${LB_MIRROR_BINARY:-http://http.debian.net/debian/}"
434
			LB_PARENT_MIRROR_BINARY="${LB_PARENT_MIRROR_BINARY:-${LB_MIRROR_BINARY}}"
435
436
			;;

437
		progress-linux)
438
			LB_PARENT_MIRROR_BINARY="${LB_PARENT_MIRROR_BINARY:-http://ftp.debian.org/debian/}"
439
			LB_MIRROR_BINARY="${LB_MIRROR_BINARY:-${LB_MIRROR_CHROOT}}"
440
			;;
Cody A.W. Somerville's avatar
Cody A.W. Somerville committed
441

442
		ubuntu)
443
			case "${LIVE_IMAGE_ARCHITECTURE}" in
444
				amd64|i386)
445
					LB_MIRROR_BINARY="${LB_MIRROR_BINARY:-http://archive.ubuntu.com/ubuntu/}"
Cody A.W. Somerville's avatar
Cody A.W. Somerville committed
446
				;;
447
448

				*)
449
					LB_MIRROR_BINARY="${LB_MIRROR_BINARY:-http://ports.ubuntu.com/ubuntu-ports/}"
450
451
					;;
			esac
452

453
			LB_PARENT_MIRROR_BINARY="${LB_PARENT_MIRROR_BINARY:-${LB_MIRROR_BINARY}}"
454
455
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
456

Daniel Baumann's avatar
Daniel Baumann committed
457
	# Setting security mirror which ends up in the image
458
	case "${LB_MODE}" in
459
		debian)
460
461
			LB_MIRROR_BINARY_SECURITY="${LB_MIRROR_BINARY_SECURITY:-http://security.debian.org/}"
			LB_PARENT_MIRROR_BINARY_SECURITY="${LB_PARENT_MIRROR_BINARY_SECURITY:-${LB_MIRROR_BINARY_SECURITY}}"
462
			;;
Daniel Baumann's avatar
Daniel Baumann committed
463

464
		progress-linux)
465
			LB_PARENT_MIRROR_BINARY_SECURITY="${LB_PARENT_MIRROR_BINARY_SECURITY:-http://security.debian.org/}"
466
			LB_MIRROR_BINARY_SECURITY="${LB_MIRROR_BINARY_SECURITY:-${LB_MIRROR_CHROOT}}"
467
468
			;;

469
		ubuntu)
470
			case "${LIVE_IMAGE_ARCHITECTURE}" in
471
				amd64|i386)
472
					LB_MIRROR_BINARY_SECURITY="${LB_MIRROR_BINARY_SECURITY:-http://security.ubuntu.com/ubuntu/}"
473
					;;
Cody A.W. Somerville's avatar
Cody A.W. Somerville committed
474

475
				*)
476
					LB_MIRROR_BINARY_SECURITY="${LB_MIRROR_BINARY_SECURITY:-http://ports.ubuntu.com/ubuntu-ports/}"
477
478
					;;
			esac
479

480
			LB_PARENT_MIRROR_BINARY_SECURITY="${LB_PARENT_MIRROR_BINARY_SECURITY:-${LB_MIRROR_BINARY_SECURITY}}"
481
482
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
483

484
	case "${LB_MODE}" in
485
		progress-linux)
486
			LB_PARENT_MIRROR_DEBIAN_INSTALLER="${LB_PARENT_MIRROR_DEBIAN_INSTALLER:-${LB_MIRROR_CHROOT}}"
487
488
489
490
			LB_MIRROR_DEBIAN_INSTALLER="${LB_MIRROR_DEBIAN_INSTALLER:-${LB_MIRROR_CHROOT}}"
			;;

		*)
491
			LB_MIRROR_DEBIAN_INSTALLER="${LB_MIRROR_DEBIAN_INSTALLER:-${LB_MIRROR_CHROOT}}"
492
			LB_PARENT_MIRROR_DEBIAN_INSTALLER="${LB_PARENT_MIRROR_DEBIAN_INSTALLER:-${LB_PARENT_MIRROR_CHROOT}}"
493
494
			;;
	esac
495

Daniel Baumann's avatar
Daniel Baumann committed
496
497
	## config/chroot

Daniel Baumann's avatar
Daniel Baumann committed
498
	# Setting chroot filesystem
499
	LB_CHROOT_FILESYSTEM="${LB_CHROOT_FILESYSTEM:-squashfs}"
Daniel Baumann's avatar
Daniel Baumann committed
500

Daniel Baumann's avatar
Daniel Baumann committed
501
	# Setting union filesystem
502
	LB_UNION_FILESYSTEM="${LB_UNION_FILESYSTEM:-aufs}"
Daniel Baumann's avatar
Daniel Baumann committed
503

Daniel Baumann's avatar
Daniel Baumann committed
504
	# Setting interactive shell/X11/Xnest
505
	LB_INTERACTIVE="${LB_INTERACTIVE:-false}"
Daniel Baumann's avatar
Daniel Baumann committed
506

Daniel Baumann's avatar
Daniel Baumann committed
507
	# Setting keyring packages
508
	case "${LB_MODE}" in
509
		ubuntu)
510
			LB_KEYRING_PACKAGES="${LB_KEYRING_PACKAGES:-ubuntu-keyring}"
Daniel Baumann's avatar
Daniel Baumann committed
511
			;;
Daniel Baumann's avatar
Daniel Baumann committed
512

513
		*)
514
			LB_KEYRING_PACKAGES="${LB_KEYRING_PACKAGES:-debian-archive-keyring}"
Daniel Baumann's avatar
Daniel Baumann committed
515
			;;
Daniel Baumann's avatar
Daniel Baumann committed
516
	esac
Daniel Baumann's avatar
Daniel Baumann committed
517
518

	# Setting linux flavour string
519
	case "${LIVE_IMAGE_ARCHITECTURE}" in
520
		armel)
521
			case "${LB_MODE}" in
522
                                ubuntu)
523
524
525
526
527
528
529
530
					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-omap}"
					;;
				*)
					# armel will have special images: one rootfs image and many additional kernel images.
					# therefore we default to all available armel flavours
					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-iop32x ixp4xx kirkwood orion5x versatile}"
					;;
			esac
531
			;;
532

533
534
535
536
537
538
		armhf)
			# armhf will have special images: one rootfs image and many additional kernel images.
			# therefore we default to all available armel flavours
			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-mx5 omap}"
			;;

539
540
		amd64)
			case "${LB_MODE}" in
541
				ubuntu)
542
543
					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
					;;
Cody A.W. Somerville's avatar
Cody A.W. Somerville committed
544

545
546
547
548
549
				*)
					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-amd64}"
					;;
			esac
			;;
Daniel Baumann's avatar
Daniel Baumann committed
550

551
552
		i386)
			case "${LB_MODE}" in
553
				progress-linux)
554
					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-686-pae}"
555
556
					;;

557
				ubuntu)
558
559
560
561
					case "${LB_DISTRIBUTION}" in
						precise)
							LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic-pae}"
							;;
562

563
564
565
566
						*)
							LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
							;;
					esac
567
					;;
568

569
				*)
570
					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-486}"
571
572
573
					;;
			esac
			;;
Daniel Baumann's avatar
Daniel Baumann committed
574

575
		ia64)
576
			case "${LB_MODE}" in
577
				progress-linux)
578
					Echo_error "Architecture ${LIVE_IMAGE_ARCHITECTURE} not supported in the ${LB_MODE} mode."
579
580
581
582
583
584
585
					exit 1
					;;

				*)
					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-itanium}"
					;;
			esac
586
			;;
587

588
		powerpc)
589
			case "${LB_MODE}" in
590
				progress-linux)
591
					Echo_error "Architecture ${LIVE_IMAGE_ARCHITECTURE} not supported in the ${LB_MODE} mode."
592
593
					exit 1
					;;
Daniel Baumann's avatar
Daniel Baumann committed
594

595
				ubuntu)
596
					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-powerpc-smp powerpc64-smp e500 powerpc-e500mc}"
597
598
					;;

599
				*)
600
					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-powerpc64 powerpc}"
601
602
603
					;;
			esac
			;;
Cody A.W. Somerville's avatar
Cody A.W. Somerville committed
604

605
		s390x)
606
			case "${LB_MODE}" in
607
				progress-linux|ubuntu)
608
					Echo_error "Architecture ${LIVE_IMAGE_ARCHITECTURE} not supported in the ${LB_MODE} mode."
609
610
					exit 1
					;;
Daniel Baumann's avatar
Daniel Baumann committed
611

612
				*)
613
					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-s390x}"
614
615
616
					;;
			esac
			;;
Daniel Baumann's avatar
Daniel Baumann committed
617

618
		sparc)
619
			case "${LB_MODE}" in
620
				progress-linux)
621
					Echo_error "Architecture ${LIVE_IMAGE_ARCHITECTURE} not supported in the ${LB_MODE} mode."
622
623
624
625
626
627
628
					exit 1
					;;

				*)
					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-sparc64}"
					;;
			esac
629
630
631
			;;

		*)
632
			Echo_error "Architecture(s) ${LIVE_IMAGE_ARCHITECTURE} not yet supported (FIXME)"
633
634
635
			exit 1
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
636

Daniel Baumann's avatar
Daniel Baumann committed
637
	# Set linux packages
638
	case "${LB_MODE}" in
639
		ubuntu)
640
641
			LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES:-linux}"
			;;
Daniel Baumann's avatar
Daniel Baumann committed
642

643
		*)
644
			LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES:-linux-image}"
645
646
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
647
648

	# Setting security updates option
649
650
	case "${LB_PARENT_DISTRIBUTION}" in
		jessie|sid)
651
652
653
654
655
656
657
			LB_SECURITY="${LB_SECURITY:-false}"
			;;

		*)
			LB_SECURITY="${LB_SECURITY:-true}"
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
658

659
	# Setting updates updates option
660
	case "${LB_PARENT_DISTRIBUTION}" in
661
		jessie|sid)
662
			LB_UPDATES="${LB_UPDATES:-false}"
663
664
665
			;;

		*)
666
			LB_UPDATES="${LB_UPDATES:-true}"
667
668
			;;
	esac
669

Daniel Baumann's avatar
Daniel Baumann committed
670
671
	## config/binary

672
	# Setting image filesystem
673
	case "${LIVE_IMAGE_ARCHITECTURE}" in
674
		sparc)
675
			LB_BINARY_FILESYSTEM="${LB_BINARY_FILESYSTEM:-ext4}"
676
			;;
Cody A.W. Somerville's avatar
Cody A.W. Somerville committed
677

678
		*)
679
			LB_BINARY_FILESYSTEM="${LB_BINARY_FILESYSTEM:-fat32}"
680
681
			;;
	esac
682

Daniel Baumann's avatar
Daniel Baumann committed
683
	# Setting image type
684
	case "${LIVE_IMAGE_ARCHITECTURE}" in
685
		amd64|i386)
686
			LIVE_IMAGE_TYPE="${LIVE_IMAGE_TYPE:-iso-hybrid}"
687
688
689
			;;

		*)
690
			LIVE_IMAGE_TYPE="${LIVE_IMAGE_TYPE:-iso}"
691
692
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
693
694

	# Setting apt indices
695
	case "${LB_MODE}" in
696
		progress-linux)
697
			LB_APT_INDICES="${LB_APT_INDICES:-false}"
698
699
700
			;;

		*)
701
			LB_APT_INDICES="${LB_APT_INDICES:-true}"
702
703
			;;
	esac
Daniel Baumann's avatar
Daniel Baumann committed
704

Daniel Baumann's avatar
Daniel Baumann committed
705
	# Setting bootloader
706
	if [ -z "${LB_BOOTLOADER}" ]
Daniel Baumann's avatar
Daniel Baumann committed
707
	then
708
		case "${LIVE_IMAGE_ARCHITECTURE}" in
709
			amd64|i386)
710
				LB_BOOTLOADER="syslinux"
Daniel Baumann's avatar
Daniel Baumann committed
711
712
713
714
				;;
		esac
	fi

715
	# Setting checksums
716
717
718
719
720
721
722
723
724
	case "${LB_MODE}" in
		progress-linux)
			LB_CHECKSUMS="${LB_CHECKSUMS:-sha256}"
			;;

		*)
			LB_CHECKSUMS="${LB_CHECKSUMS:-md5}"
			;;
	esac
725

726
	# Setting compression
727
	LB_COMPRESSION="${LB_COMPRESSION:-none}"
728

729
730
731
	# Setting zsync
	LB_ZSYNC="${LB_ZSYNC:-true}"

Daniel Baumann's avatar
Daniel Baumann committed
732
	# Setting chroot option
733
	LB_BUILD_WITH_CHROOT="${LB_BUILD_WITH_CHROOT:-true}"
Daniel Baumann's avatar
Daniel Baumann committed
734

735
736
	LB_BUILD_WITH_TMPFS="${LB_BUILD_WITH_TMPFS:-false}"

Daniel Baumann's avatar
Daniel Baumann committed
737
	# Setting debian-installer option
738
	LB_DEBIAN_INSTALLER="${LB_DEBIAN_INSTALLER:-false}"
Daniel Baumann's avatar
Daniel Baumann committed
739

740
	LB_DEBIAN_INSTALLER_DISTRIBUTION="${LB_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_DISTRIBUTION}}"
741

742
	# Setting debian-installer-gui
743
	case "${LB_MODE}" in
744
		debian|progress-linux)
745
			LB_DEBIAN_INSTALLER_GUI="${LB_DEBIAN_INSTALLER_GUI:-true}"
746
747
			;;

748
		*)
749
			LB_DEBIAN_INSTALLER_GUI="${LB_DEBIAN_INSTALLER_GUI:-false}"
750
751
752
			;;
	esac

753
	# Setting debian-installer preseed filename
754
	if [ -z "${LB_DEBIAN_INSTALLER_PRESEEDFILE}" ]
755
	then
756
		if Find_files config/debian-installer/preseed.cfg
757
		then
758
			LB_DEBIAN_INSTALLER_PRESEEDFILE="/preseed.cfg"
759
760
		fi

761
		if Find_files config/debian-installer/*.cfg && [ ! -e config/debian-installer/preseed.cfg ]
762
		then
763
			Echo_warning "You have placed some preseeding files into config/debian-installer but you didn't specify the default preseeding file through LB_DEBIAN_INSTALLER_PRESEEDFILE. This means that debian-installer will not take up a preseeding file by default."