live-build/functions/defaults.sh

1208 lines
30 KiB
Bash
Raw Normal View History

2007-09-23 08:04:46 +00:00
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2011 Daniel Baumann <daniel@debian.org>
##
## live-build comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
2007-09-23 08:04:46 +00:00
Set_defaults ()
{
## config/common
LB_BASE="${LB_BASE:-/usr/share/live/build}"
# Setting mode (currently: debian, emdebian, progress, ubuntu and kubuntu)
2010-12-27 16:12:36 -01:00
LB_MODE="${LB_MODE:-debian}"
2007-09-23 08:04:49 +00:00
2007-09-23 08:05:13 +00:00
# Setting distribution name
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
2011-01-01 22:45:08 -01:00
progress)
LB_DISTRIBUTION="${LB_DISTRIBUTION:-artax}"
LB_DERIVATIVE="true"
2011-01-01 22:45:08 -01:00
;;
ubuntu|kubuntu)
2010-12-27 16:12:36 -01:00
LB_DISTRIBUTION="${LB_DISTRIBUTION:-karmic}"
LB_DERIVATIVE="false"
2010-12-27 16:12:36 -01:00
;;
2009-04-15 20:07:26 +00:00
2010-12-27 16:12:36 -01:00
*)
LB_DISTRIBUTION="${LB_DISTRIBUTION:-wheezy}"
LB_DERIVATIVE="false"
;;
esac
case "${LB_MODE}" in
progress)
case "${LB_DISTRIBUTION}" in
artax|artax-backports)
LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION:-squeeze}"
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}"
;;
baureo)
LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION:-sid}"
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}"
;;
esac
;;
*)
LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION:-${LB_DISTRIBUTION}}"
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}"
2010-12-27 16:12:36 -01:00
;;
esac
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:11 +00:00
# Setting package manager
LB_APT="${LB_APT:-apt}"
2007-09-23 08:05:11 +00:00
2007-09-23 08:04:46 +00:00
# Setting apt ftp proxy
2010-12-27 16:12:36 -01:00
LB_APT_FTP_PROXY="${LB_APT_FTP_PROXY:-${ftp_proxy}}"
ftp_proxy="${ftp_proxy:-${LB_APT_FTP_PROXY}}"
2007-09-23 08:04:46 +00:00
# Setting apt http proxy
2010-12-27 16:12:36 -01:00
LB_APT_HTTP_PROXY="${LB_APT_HTTP_PROXY:-${http_proxy}}"
http_proxy="${http_proxy:-${LB_APT_HTTP_PROXY}}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:11 +00:00
# Setting apt pipeline
# LB_APT_PIPELINE
2007-09-23 08:04:46 +00:00
APT_OPTIONS="${APT_OPTIONS:---yes}"
APTITUDE_OPTIONS="${APTITUDE_OPTIONS:---assume-yes}"
BZIP2_OPTIONS="${BZIP2_OPTIONS:---best}"
GZIP_OPTIONS="${GZIP_OPTIONS:---best}"
if gzip --help | grep -qs "\-\-rsyncable"
then
GZIP_OPTIONS="$(echo ${GZIP_OPTIONS} | sed -e 's|--rsyncable||') --rsyncable"
fi
LZIP_OPTIONS="${LZIP_OPTIONS:---best}"
LZMA_OPTIONS="${LZMA_OPTIONS:---best}"
2007-09-23 08:04:46 +00:00
# Setting apt recommends
case "${LB_MODE}" in
2011-01-01 22:45:08 -01:00
emdebian|progress)
LB_APT_RECOMMENDS="${LB_APT_RECOMMENDS:-false}"
2008-12-08 10:24:11 -01:00
;;
2010-12-27 16:12:36 -01:00
*)
LB_APT_RECOMMENDS="${LB_APT_RECOMMENDS:-true}"
;;
2007-09-23 08:05:17 +00:00
esac
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:48 +00:00
# Setting apt secure
LB_APT_SECURE="${LB_APT_SECURE:-true}"
2007-09-23 08:04:48 +00:00
2007-09-23 08:04:46 +00:00
# Setting bootstrap program
if [ -z "${LB_BOOTSTRAP}" ] || ( [ ! -x "$(which ${LB_BOOTSTRAP} 2>/dev/null)" ] && [ "${LB_BOOTSTRAP}" != "copy" ] )
2007-09-23 08:04:46 +00:00
then
2007-10-19 10:45:57 +00:00
if [ -x "/usr/sbin/debootstrap" ]
then
LB_BOOTSTRAP="debootstrap"
2007-10-19 10:45:57 +00:00
elif [ -x "/usr/bin/cdebootstrap" ]
then
LB_BOOTSTRAP="cdebootstrap"
2007-10-19 10:45:57 +00:00
else
Echo_error "Cannot find /usr/sbin/debootstrap or /usr/bin/cdebootstrap. Please install debootstrap or cdebootstrap, or specify an alternative bootstrapping utility."
2007-10-19 10:45:57 +00:00
exit 1
fi
2007-09-23 08:04:46 +00:00
fi
# Setting cache option
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}"
2007-09-23 08:04:46 +00:00
# Setting debconf frontend
LB_DEBCONF_FRONTEND="${LB_DEBCONF_FRONTEND:-noninteractive}"
LB_DEBCONF_NOWARNINGS="${LB_DEBCONF_NOWARNINGS:-yes}"
LB_DEBCONF_PRIORITY="${LB_DEBCONF_PRIORITY:-critical}"
2007-09-23 08:04:50 +00:00
case "${LB_DEBCONF_NOWARNINGS}" in
true)
LB_DEBCONF_NOWARNINGS="yes"
2007-09-23 08:05:14 +00:00
;;
false)
LB_DEBCONF_NOWARNINGS="no"
2007-09-23 08:05:14 +00:00
;;
esac
2007-09-23 08:05:10 +00:00
# Setting initramfs hook
2010-12-27 16:12:36 -01:00
case "${LB_INITRAMFS}" in
auto)
case "${LB_MODE}" in
ubuntu|kubuntu)
LB_INITRAMFS="casper"
2009-04-15 20:07:26 +00:00
;;
2008-12-08 10:24:11 -01:00
*)
2010-12-27 16:12:36 -01:00
LB_INITRAMFS="live-boot"
2008-12-08 10:24:11 -01:00
;;
2007-09-23 08:05:17 +00:00
esac
2010-12-27 16:12:36 -01:00
;;
*)
LB_INITRAMFS="${LB_INITRAMFS:-auto}"
;;
esac
2007-09-23 08:05:10 +00:00
LB_INITRAMFS_COMPRESSION="${LB_INITRAMFS_COMPRESSION:-gzip}"
# Setting initsystem
2011-02-10 21:31:21 -01:00
case "${LB_MODE}" in
ubuntu|kubuntu)
case "${LB_INITRAMFS}" in
live-boot)
LB_INITSYSTEM="${LB_INITSYSTEM:-upstart}"
;;
esac
2011-02-10 21:31:21 -01:00
;;
*)
LB_INITSYSTEM="${LB_INITSYSTEM:-sysvinit}"
;;
2011-02-10 21:31:21 -01:00
esac
# Setting fdisk
if [ -z "${LB_FDISK}" ] || [ ! -x "${LB_FDISK}" ]
then
# Workaround for gnu-fdisk divertion
# (gnu-fdisk is buggy, #445304).
if [ -x /sbin/fdisk.distrib ]
then
LB_FDISK="fdisk.distrib"
elif [ -x /sbin/fdisk ]
then
LB_FDISK="fdisk"
else
Echo_error "Can't process file /sbin/fdisk"
fi
fi
2007-09-23 08:04:47 +00:00
# Setting losetup
if [ -z "${LB_LOSETUP}" ] || [ "${LB_LOSETUP}" != "/sbin/losetup.orig" ]
2007-09-23 08:04:46 +00:00
then
2007-09-23 08:05:10 +00:00
# Workaround for loop-aes-utils divertion
# (loop-aes-utils' losetup lacks features).
2007-09-23 08:04:47 +00:00
if [ -x /sbin/losetup.orig ]
then
LB_LOSETUP="losetup.orig"
2007-09-23 08:04:47 +00:00
elif [ -x /sbin/losetup ]
then
LB_LOSETUP="losetup"
2007-09-23 08:04:47 +00:00
else
Echo_error "Can't process file /sbin/losetup"
2007-09-23 08:04:47 +00:00
fi
2007-09-23 08:04:46 +00:00
fi
if [ "$(id -u)" = "0" ]
2007-09-23 08:04:51 +00:00
then
2007-09-23 08:05:11 +00:00
# If we are root, disable root command
LB_ROOT_COMMAND=""
2007-09-23 08:05:11 +00:00
else
if [ -x /usr/bin/sudo ]
then
# FIXME: this is false until considered safe
#LB_ROOT_COMMAND="sudo"
LB_ROOT_COMMAND=""
2007-09-23 08:05:11 +00:00
fi
2007-09-23 08:04:51 +00:00
fi
if [ "${LB_ARCHITECTURE}" = "i386" ] && [ "$(uname -m)" = "x86_64" ]
then
LB_ROOT_COMMAND="${LB_ROOT_COMMAND} linux32"
fi
2007-09-23 08:05:10 +00:00
# Setting tasksel
case "${LB_DISTRIBUTION}" in
squeeze)
LB_TASKSEL="${LB_TASKSEL:-tasksel}"
;;
*)
LB_TASKSEL="${LB_TASKSEL:-apt}"
;;
esac
2007-09-23 08:04:52 +00:00
2007-09-23 08:04:47 +00:00
# Setting root directory
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
2011-01-07 19:09:49 -01:00
debian)
2010-12-27 16:12:36 -01:00
LB_ROOT="${LB_ROOT:-debian-live}"
;;
2009-04-15 20:07:26 +00:00
2011-01-01 22:45:08 -01:00
progress)
LB_ROOT="${LB_ROOT:-progress-linux}"
;;
2010-12-27 16:12:36 -01:00
*)
LB_ROOT="${LB_ROOT:-${LB_MODE}-live}"
;;
esac
2007-09-23 08:04:49 +00:00
2007-09-23 08:04:52 +00:00
# Setting includes
2010-12-27 16:12:36 -01:00
LB_INCLUDES="${LB_INCLUDES:-${LB_BASE}/includes}"
2007-09-23 08:04:52 +00:00
# Setting templates
2010-12-27 16:12:36 -01:00
LB_TEMPLATES="${LB_TEMPLATES:-${LB_BASE}/templates}"
2007-09-23 08:04:52 +00:00
2010-09-13 19:49:20 +00:00
# Setting live build options
_BREAKPOINTS="${_BREAKPOINTS:-false}"
_COLOR="${_COLOR:-false}"
_DEBUG="${_DEBUG:-false}"
_FORCE="${_FORCE:-false}"
_QUIET="${_QUIET:-false}"
_VERBOSE="${_VERBOSE:-false}"
2007-09-23 08:04:46 +00:00
## config/bootstrap
2007-09-23 08:04:47 +00:00
# Setting architecture value
if [ -z "${LB_ARCHITECTURES}" ]
2007-09-23 08:04:46 +00:00
then
if [ -x "/usr/bin/dpkg" ]
then
LB_ARCHITECTURES="$(dpkg --print-architecture)"
2007-09-23 08:04:46 +00:00
else
2008-08-31 22:46:38 +00:00
case "$(uname -m)" in
sparc|powerpc)
LB_ARCHITECTURES="$(uname -m)"
2008-08-31 22:46:38 +00:00
;;
x86_64)
LB_ARCHITECTURES="amd64"
2008-08-31 22:46:38 +00:00
;;
*)
if [ -e /lib64 ]
then
LB_ARCHITECTURES="amd64"
else
LB_ARCHITECTURES="i386"
fi
Echo_warning "Can't determine architecture, assuming ${LB_ARCHITECTURES}"
2008-08-31 22:46:38 +00:00
;;
esac
2007-09-23 08:04:46 +00:00
fi
fi
# Include packages on base
# LB_BOOTSTRAP_INCLUDE
# Exclude packages on base
# LB_BOOTSTRAP_EXCLUDE
2007-09-23 08:04:47 +00:00
# Setting flavour value
case "${LB_BOOTSTRAP}" in
cdebootstrap)
LB_BOOTSTRAP_FLAVOUR="${LB_BOOTSTRAP_FLAVOUR:-standard}"
;;
esac
2007-09-23 08:05:11 +00:00
# Setting bootstrap keyring
# LB_BOOTSTRAP_KEYRING
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:48 +00:00
# Setting mirror to fetch packages from
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
2011-01-07 19:18:27 -01:00
debian)
LB_PARENT_MIRROR_BOOTSTRAP="${LB_PARENT_MIRROR_BOOTSTRAP:-http://ftp.de.debian.org/debian/}"
LB_MIRROR_BOOTSTRAP="${LB_MIRROR_BOOTSTRAP:-${LB_PARENT_MIRROR_BOOTSTRAP}}"
2010-12-27 16:12:36 -01:00
;;
2008-12-08 10:24:11 -01:00
2010-12-27 16:12:36 -01:00
emdebian)
LB_PARENT_MIRROR_BOOTSTRAP="${LB_PARENT_MIRROR_BOOTSTRAP:-http://www.emdebian.org/grip/}"
LB_MIRROR_BOOTSTRAP="${LB_MIRROR_BOOTSTRAP:-${LB_PARENT_MIRROR_BOOTSTRAP}}"
2010-12-27 16:12:36 -01:00
;;
2009-04-15 20:07:26 +00:00
2011-01-07 19:18:27 -01:00
progress)
LB_PARENT_MIRROR_BOOTSTRAP="${LB_PARENT_MIRROR_BOOTSTRAP:-http://cdn.debian.net/debian/}"
LB_MIRROR_BOOTSTRAP="${LB_MIRROR_BOOTSTRAP:-http://archive.progress-linux.org/progress/}"
2011-01-07 19:18:27 -01:00
;;
ubuntu|kubuntu)
2010-12-27 16:12:36 -01:00
case "${LB_ARCHITECTURES}" in
amd64|i386)
LB_PARENT_MIRROR_BOOTSTRAP="${LB_PARENT_MIRROR_BOOTSTRAP:-http://archive.ubuntu.com/ubuntu/}"
2010-12-27 16:12:36 -01:00
;;
2009-04-15 20:07:26 +00:00
2010-12-27 16:12:36 -01:00
*)
LB_PARENT_MIRROR_BOOTSTRAP="${LB_PARENT_MIRROR_BOOTSTRAP:-http://ports.ubuntu.com/}"
2010-12-27 16:12:36 -01:00
;;
esac
LB_MIRROR_BOOTSTRAP="${LB_MIRROR_BOOTSTRAP:-${LB_PARENT_MIRROR_BOOTSTRAP}}"
2010-12-27 16:12:36 -01:00
;;
esac
2007-09-23 08:04:46 +00:00
LB_PARENT_MIRROR_CHROOT="${LB_PARENT_MIRROR_CHROOT:-${LB_PARENT_MIRROR_BOOTSTRAP}}"
LB_MIRROR_CHROOT="${LB_MIRROR_CHROOT:-${LB_MIRROR_BOOTSTRAP}}"
2007-09-23 08:04:48 +00:00
# Setting security mirror to fetch packages from
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
2011-01-07 19:18:27 -01:00
debian)
LB_PARENT_MIRROR_CHROOT_SECURITY="${LB_PARENT_MIRROR_CHROOT_SECURITY:-http://security.debian.org/}"
LB_MIRROR_CHROOT_SECURITY="${LB_MIRROR_CHROOT_SECURITY:-${LB_PARENT_MIRROR_CHROOT_SECURITY}}"
2010-12-27 16:12:36 -01:00
;;
2008-12-08 10:24:11 -01:00
2010-12-27 16:12:36 -01:00
emdebian)
LB_PARENT_MIRROR_CHROOT_SECURITY="${LB_PARENT_MIRROR_CHROOT_SECURITY:-none}"
LB_MIRROR_CHROOT_SECURITY="${LB_MIRROR_CHROOT_SECURITY:-${LB_PARENT_MIRROR_CHROOT_SECURITY}}"
2010-12-27 16:12:36 -01:00
;;
2009-04-15 20:07:26 +00:00
2011-01-07 19:18:27 -01:00
progress)
LB_PARENT_MIRROR_CHROOT_SECURITY="${LB_PARENT_MIRROR_CHROOT_SECURITY:-http://cdn.debian.net/debian-security/}"
LB_MIRROR_CHROOT_SECURITY="${LB_MIRROR_CHROOT_SECURITY:-${LB_MIRROR_CHROOT}}"
2011-01-07 19:18:27 -01:00
;;
ubuntu|kubuntu)
2010-12-27 16:12:36 -01:00
case "${LB_ARCHITECTURES}" in
amd64|i386)
LB_PARENT_MIRROR_CHROOT_SECURITY="${LB_PARENT_MIRROR_CHROOT_SECURITY:-http://security.ubuntu.com/ubuntu/}"
2010-12-27 16:12:36 -01:00
;;
2009-04-15 20:07:26 +00:00
2010-12-27 16:12:36 -01:00
*)
LB_PARENT_MIRROR_CHROOT_SECURITY="${LB_PARENT_MIRROR_CHROOT_SECURITY:-http://ports.ubuntu.com/}"
2010-12-27 16:12:36 -01:00
;;
esac
LB_MIRROR_CHROOT_SECURITY="${LB_MIRROR_CHROOT_SECURITY:-${LB_PARENT_MIRROR_CHROOT_SECURITY}}"
2010-12-27 16:12:36 -01:00
;;
esac
2007-09-23 08:04:46 +00:00
# Setting volatile mirror to fetch packages from
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
debian)
LB_PARENT_MIRROR_CHROOT_VOLATILE="${LB_PARENT_MIRROR_CHROOT_VOLATILE:-${LB_PARENT_MIRROR_CHROOT}}"
LB_MIRROR_CHROOT_VOLATILE="${LB_MIRROR_CHROOT_VOLATILE:-${LB_PARENT_MIRROR_CHROOT}}"
;;
progress)
LB_PARENT_MIRROR_CHROOT_VOLATILE="${LB_PARENT_MIRROR_CHROOT_VOLATILE:-${LB_PARENT_MIRROR_CHROOT}}"
LB_MIRROR_CHROOT_VOLATILE="${LB_MIRROR_CHROOT_VOLATILE:-none}"
2010-12-27 16:12:36 -01:00
;;
ubuntu|kubuntu)
2010-12-27 16:12:36 -01:00
case "${LB_ARCHITECTURES}" in
amd64|i386)
LB_PARENT_MIRROR_CHROOT_VOLATILE="${LB_PARENT_MIRROR_CHROOT_VOLATILE:-http://archive.ubuntu.com/ubuntu/}"
2010-12-27 16:12:36 -01:00
;;
2010-12-27 16:12:36 -01:00
*)
LB_PARENT_MIRROR_CHROOT_VOLATILE="${LB_PARENT_MIRROR_CHROOT_VOLATILE:-http://ports.ubuntu.com/}"
2010-12-27 16:12:36 -01:00
;;
esac
LB_MIRROR_CHROOT_VOLATILE="${LB_MIRROR_CHROOT_VOLATILE:-${LB_PARENT_MIRROR_CHROOT}}"
2010-12-27 16:12:36 -01:00
;;
2010-12-27 16:12:36 -01:00
*)
LB_PARENT_MIRROR_CHROOT_VOLATILE="${LB_PARENT_MIRROR_CHROOT_VOLATILE:-none}"
LB_MIRROR_CHROOT_VOLATILE="${LB_MIRROR_CHROOT_VOLATILE:-none}"
2010-12-27 16:12:36 -01:00
;;
esac
# Setting backports mirror to fetch packages from
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
2011-01-07 19:09:49 -01:00
debian)
LB_PARENT_MIRROR_CHROOT_BACKPORTS="${LB_PARENT_MIRROR_CHROOT_BACKPORTS:-http://backports.debian.org/debian-backports/}"
LB_MIRROR_CHROOT_BACKPORTS="${LB_MIRROR_CHROOT_BACKPORTS:-${LB_PARENT_MIRROR_CHROOT_BACKPORTS}}"
;;
progress)
LB_MIRROR_CHROOT_BACKPORTS="${LB_MIRROR_CHROOT_BACKPORTS:-${LB_MIRROR_CHROOT}}"
2010-12-27 16:12:36 -01:00
;;
2010-12-27 16:12:36 -01:00
*)
LB_PARENT_MIRROR_CHROOT_BACKPORTS="${LB_PARENT_MIRROR_CHROOT_BACKPORTS:-none}"
LB_MIRROR_CHROOT_BACKPORTS="${LB_MIRROR_CHROOT_BACKPORTS:-none}"
2010-12-27 16:12:36 -01:00
;;
esac
2007-09-23 08:04:48 +00:00
# Setting mirror which ends up in the image
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
debian)
LB_PARENT_MIRROR_BINARY="${LB_PARENT_MIRROR_BINARY:-http://cdn.debian.net/debian/}"
LB_MIRROR_BINARY="${LB_MIRROR_BINARY:-${LB_PARENT_MIRROR_BINARY}}"
;;
progress)
LB_PARENT_MIRROR_BINARY="${LB_PARENT_MIRROR_BINARY:-http://cdn.debian.net/debian/}"
LB_MIRROR_BINARY="${LB_MIRROR_BINARY:-${LB_MIRROR_CHROOT}}"
2010-12-27 16:12:36 -01:00
;;
2009-04-15 20:07:26 +00:00
2010-12-27 16:12:36 -01:00
emdebian)
LB_PARENT_MIRROR_BINARY="${LB_PARENT_MIRROR_BINARY:-http://www.emdebian.org/grip/}"
LB_MIRROR_BINARY="${LB_MIRROR_BINARY:-${LB_PARENT_MIRROR_BINARY}}"
2010-12-27 16:12:36 -01:00
;;
2009-04-15 20:07:26 +00:00
ubuntu|kubuntu)
2010-12-27 16:12:36 -01:00
case "${LB_ARCHITECTURES}" in
amd64|i386)
LB_PARENT_MIRROR_BINARY="${LB_PARENT_MIRROR_BINARY:-http://archive.ubuntu.com/ubuntu/}"
2009-04-15 20:07:26 +00:00
;;
2010-12-27 16:12:36 -01:00
*)
LB_PARENT_MIRROR_BINARY="${LB_PARENT_MIRROR_BINARY:-http://ports.ubuntu.com/}"
2010-12-27 16:12:36 -01:00
;;
esac
LB_MIRROR_BINARY="${LB_MIRROR_BINARY:-${LB_PARENT_MIRROR_BINARY}}"
2010-12-27 16:12:36 -01:00
;;
esac
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:48 +00:00
# Setting security mirror which ends up in the image
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
2011-01-07 19:18:27 -01:00
debian)
LB_PARENT_MIRROR_BINARY_SECURITY="${LB_PARENT_MIRROR_BINARY_SECURITY:-http://security.debian.org/}"
LB_MIRROR_BINARY_SECURITY="${LB_MIRROR_BINARY_SECURITY:-${LB_PARENT_MIRROR_BINARY_SECURITY}}"
2010-12-27 16:12:36 -01:00
;;
2008-12-08 10:24:11 -01:00
2010-12-27 16:12:36 -01:00
emdebian)
LB_PARENT_MIRROR_BINARY_SECURITY="${LB_PARENT_MIRROR_BINARY_SECURITY:-none}"
LB_MIRROR_BINARY_SECURITY="${LB_MIRROR_BINARY_SECURITY:-${LB_PARENT_MIRROR_BINARY_SECURITY}}"
2010-12-27 16:12:36 -01:00
;;
2009-04-15 20:07:26 +00:00
2011-01-07 19:18:27 -01:00
progress)
LB_PARENT_MIRROR_BINARY_SECURITY="${LB_PARENT_MIRROR_BINARY_SECURITY:-http://cdn.debian.net/debian-security/}"
LB_MIRROR_BINARY_SECURITY="${LB_MIRROR_BINARY_SECURITY:-${LB_MIRROR_CHROOT}}"
2011-01-07 19:18:27 -01:00
;;
ubuntu|kubuntu)
2010-12-27 16:12:36 -01:00
case "${LB_ARCHITECTURES}" in
amd64|i386)
LB_PARENT_MIRROR_BINARY_SECURITY="${LB_PARENT_MIRROR_BINARY_SECURITY:-http://security.ubuntu.com/ubuntu/}"
2010-12-27 16:12:36 -01:00
;;
2009-04-15 20:07:26 +00:00
2010-12-27 16:12:36 -01:00
*)
LB_PARENT_MIRROR_BINARY_SECURITY="${LB_PARENT_MIRROR_BINARY_SECURITY:-http://ports.ubuntu.com/}"
2010-12-27 16:12:36 -01:00
;;
esac
LB_MIRROR_BINARY_SECURITY="${LB_MIRROR_BINARY_SECURITY:-${LB_PARENT_MIRROR_BINARY_SECURITY}}"
2010-12-27 16:12:36 -01:00
;;
esac
2007-09-23 08:04:46 +00:00
# Setting volatile mirror which ends up in the image
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
debian)
LB_PARENT_MIRROR_BINARY_VOLATILE="${LB_PARENT_MIRROR_BINARY_VOLATILE:-${LB_PARENT_MIRROR_BINARY}}"
LB_MIRROR_BINARY_VOLATILE="${LB_MIRROR_BINARY_VOLATILE:-${LB_PARENT_MIRROR_BINARY}}"
;;
progress)
LB_PARENT_MIRROR_BINARY_VOLATILE="${LB_PARENT_MIRROR_BINARY_VOLATILE:-${LB_PARENT_MIRROR_BINARY}}"
LB_MIRROR_BINARY_VOLATILE="${LB_MIRROR_BINARY_VOLATILE:-none}"
2010-12-27 16:12:36 -01:00
;;
ubuntu|kubuntu)
2010-12-27 16:12:36 -01:00
case "${LB_ARCHITECTURES}" in
amd64|i386)
LB_PARENT_MIRROR_BINARY_VOLATILE="${LB_PARENT_MIRROR_BINARY_VOLATILE:-http://archive.ubuntu.com/ubuntu/}"
2010-12-27 16:12:36 -01:00
;;
2010-12-27 16:12:36 -01:00
*)
LB_PARENT_MIRROR_BINARY_VOLATILE="${LB_PARENT_MIRROR_BINARY_VOLATILE:-http://ports.ubuntu.com/}"
2010-12-27 16:12:36 -01:00
;;
esac
;;
2010-12-27 16:12:36 -01:00
*)
LB_PARENT_MIRROR_BINARY_VOLATILE="${LB_PARENT_MIRROR_BINARY_VOLATILE:-none}"
2010-12-27 16:12:36 -01:00
;;
esac
# Setting backports mirror which ends up in the image
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
2011-01-07 19:09:49 -01:00
debian)
LB_PARENT_MIRROR_BINARY_BACKPORTS="${LB_PARENT_MIRROR_BINARY_BACKPORTS:-http://backports.debian.org/debian-backports/}"
LB_MIRROR_BINARY_BACKPORTS="${LB_MIRROR_BINARY_BACKPORTS:-${LB_PARENT_MIRROR_BINARY_BACKPORTS}}"
;;
progress)
LB_PARENT_MIRROR_BINARY_BACKPORTS="${LB_PARENT_MIRROR_BINARY_BACKPORTS:-none}"
LB_MIRROR_BINARY_BACKPORTS="${LB_MIRROR_BINARY_BACKPORTS:-${LB_MIRROR_CHROOT}}"
2010-12-27 16:12:36 -01:00
;;
2010-12-27 16:12:36 -01:00
*)
LB_PARENT_MIRROR_BINARY_BACKPORTS="${LB_PARENT_MIRROR_BINARY_BACKPORTS:-none}"
LB_MIRROR_BINARY_BACKPORTS="${LB_MIRROR_BINARY_BACKPORTS:-${LB_PARENT_MIRROR_BINARY_BACKPORTS}}"
2010-12-27 16:12:36 -01:00
;;
esac
case "${LB_MODE}" in
progress)
LB_PARENT_MIRROR_DEBIAN_INSTALLER="${LB_PARENT_MIRROR_DEBIAN_INSTALLER:-${LB_PARENT_MIRROR_BOOTSTRAP}}"
LB_MIRROR_DEBIAN_INSTALLER="${LB_MIRROR_DEBIAN_INSTALLER:-${LB_MIRROR_CHROOT}}"
;;
*)
LB_PARENT_MIRROR_DEBIAN_INSTALLER="${LB_PARENT_MIRROR_DEBIAN_INSTALLER:-${LB_PARENT_MIRROR_BOOTSTRAP}}"
LB_MIRROR_DEBIAN_INSTALLER="${LB_MIRROR_DEBIAN_INSTALLER:-${LB_PARENT_MIRROR_DEBIAN_INSTALLER}}"
;;
esac
2009-11-22 12:40:20 -01:00
# Setting archive areas value
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
2011-03-24 18:25:34 -01:00
progress)
LB_PARENT_ARCHIVE_AREAS="${LB_PARENT_ARCHIVE_AREAS:-main}"
LB_ARCHIVE_AREAS="${LB_ARCHIVE_AREAS:-main}"
;;
ubuntu|kubuntu)
LB_PARENT_ARCHIVE_AREAS="${LB_PARENT_ARCHIVE_AREAS:-main restricted}"
2011-03-24 18:25:34 -01:00
LB_ARCHIVE_AREAS="${LB_ARCHIVE_AREAS:-${LB_PARENT_ARCHIVE_AREAS}}"
2010-12-27 16:12:36 -01:00
;;
2010-12-27 16:12:36 -01:00
*)
LB_PARENT_ARCHIVE_AREAS="${LB_PARENT_ARCHIVE_AREAS:-main}"
2011-03-24 18:25:34 -01:00
LB_ARCHIVE_AREAS="${LB_ARCHIVE_AREAS:-${LB_PARENT_ARCHIVE_AREAS}}"
2010-12-27 16:12:36 -01:00
;;
esac
2007-09-23 08:04:46 +00:00
## config/chroot
2007-09-23 08:05:10 +00:00
# Setting chroot filesystem
LB_CHROOT_FILESYSTEM="${LB_CHROOT_FILESYSTEM:-squashfs}"
2007-09-23 08:05:10 +00:00
# Setting virtual root size
LB_VIRTUAL_ROOT_SIZE="${LB_VIRTUAL_ROOT_SIZE:-10000}"
# Setting whether to expose root filesystem as read only
LB_EXPOSED_ROOT="${LB_EXPOSED_ROOT:-false}"
2007-09-23 08:05:13 +00:00
# Setting union filesystem
LB_UNION_FILESYSTEM="${LB_UNION_FILESYSTEM:-aufs}"
2007-09-23 08:05:13 +00:00
# Setting distribution hooks
case "${LB_MODE}" in
*)
LB_CHROOT_HOOKS="update-apt-xapian-index \
update-mlocate-database \
remove-python-py"
;;
kubuntu)
LB_CHROOT_HOOKS="update-apt-xapian-index \
update-mlocate-database \
remove-gnome-icon-cache \
remove-python-py"
;;
esac
2007-09-23 08:05:10 +00:00
2007-09-23 08:04:48 +00:00
# Setting interactive shell/X11/Xnest
LB_INTERACTIVE="${LB_INTERACTIVE:-false}"
2007-09-23 08:04:48 +00:00
2007-09-23 08:05:10 +00:00
# Setting keyring packages
case "${LB_MODE}" in
ubuntu|kubuntu)
LB_KEYRING_PACKAGES="${LB_KEYRING_PACKAGES:-ubuntu-keyring}"
2007-09-23 08:05:17 +00:00
;;
2008-12-08 10:24:11 -01:00
*)
LB_KEYRING_PACKAGES="${LB_KEYRING_PACKAGES:-debian-archive-keyring}"
2008-12-08 10:24:11 -01:00
;;
2007-09-23 08:05:17 +00:00
esac
2007-09-23 08:05:10 +00:00
# Setting linux flavour string
2010-12-27 16:12:36 -01:00
case "${LB_ARCHITECTURES}" in
armel)
if [ -z "${LB_LINUX_FLAVOURS}" ]
then
Echo_error "There is no default kernel flavour defined for your architecture."
Echo_error "Please configure it manually with 'lb config -k FLAVOUR'."
exit 1
fi
2010-12-27 16:12:36 -01:00
;;
2010-12-27 16:12:36 -01:00
amd64)
case "${LB_MODE}" in
ubuntu|kubuntu)
2010-12-27 16:12:36 -01:00
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
;;
2009-04-15 20:07:26 +00:00
2010-12-27 16:12:36 -01:00
*)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-amd64}"
;;
esac
;;
2007-09-23 08:04:46 +00:00
2010-12-27 16:12:36 -01:00
i386)
case "${LB_MODE}" in
2011-01-01 22:45:08 -01:00
progress)
case "${LB_DISTRIBUTION}" in
artax)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-686}"
;;
*)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-686-pae}"
;;
esac
2011-01-01 22:45:08 -01:00
;;
ubuntu|kubuntu)
2010-12-27 16:12:36 -01:00
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
;;
2010-12-27 16:12:36 -01:00
*)
case "${LIST}" in
stripped|minimal)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-486}"
;;
2007-09-23 08:04:46 +00:00
2010-12-27 16:12:36 -01:00
*)
case "${LB_DISTRIBUTION}" in
wheezy|sid)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-486 686-pae}"
;;
*)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-486 686}"
;;
esac
2010-12-27 16:12:36 -01:00
;;
esac
;;
esac
;;
2007-09-23 08:04:46 +00:00
2010-12-27 16:12:36 -01:00
ia64)
2011-01-01 22:45:08 -01:00
case "${LB_MODE}" in
progress)
Echo_error "Architecture ${LB_ARCHITECTURES} not supported in the ${LB_MODE} mode."
exit 1
;;
*)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-itanium}"
;;
esac
2010-12-27 16:12:36 -01:00
;;
2010-12-27 16:12:36 -01:00
powerpc)
2011-01-01 22:45:08 -01:00
case "${LB_MODE}" in
progress)
Echo_error "Architecture ${LB_ARCHITECTURES} not supported in the ${LB_MODE} mode."
exit 1
;;
2007-09-23 08:04:46 +00:00
ubuntu|kubuntu)
case "${LIST}" in
stripped|minimal)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-powerpc}"
;;
*)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-powerpc powerpc64-smp}"
;;
esac
;;
2010-12-27 16:12:36 -01:00
*)
2011-01-01 22:45:08 -01:00
case "${LIST}" in
stripped|minimal)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-powerpc}"
;;
2011-01-01 22:45:08 -01:00
*)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-powerpc powerpc64}"
;;
esac
2010-12-27 16:12:36 -01:00
;;
esac
;;
2009-04-15 20:07:26 +00:00
2010-12-27 16:12:36 -01:00
s390)
case "${LB_MODE}" in
progress|ubuntu|kubuntu)
2011-01-01 22:45:08 -01:00
Echo_error "Architecture ${LB_ARCHITECTURES} not supported in the ${LB_MODE} mode."
2010-12-27 16:12:36 -01:00
exit 1
;;
2007-09-23 08:04:46 +00:00
2010-12-27 16:12:36 -01:00
*)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-s390}"
;;
esac
;;
2007-09-23 08:04:46 +00:00
2010-12-27 16:12:36 -01:00
sparc)
2011-01-01 22:45:08 -01:00
case "${LB_MODE}" in
progress)
Echo_error "Architecture ${LB_ARCHITECTURES} not supported in the ${LB_MODE} mode."
exit 1
;;
*)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-sparc64}"
;;
esac
2010-12-27 16:12:36 -01:00
;;
*)
Echo_error "Architecture(s) ${LB_ARCHITECTURES} not yet supported (FIXME)"
exit 1
;;
esac
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# Set linux packages
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
ubuntu|kubuntu)
2010-12-27 16:12:36 -01:00
LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES:-linux}"
;;
2007-09-23 08:04:49 +00:00
2010-12-27 16:12:36 -01:00
*)
LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES:-linux-image-2.6}"
;;
esac
2007-09-23 08:04:46 +00:00
# Setting package list
LB_PACKAGE_LISTS="${LB_PACKAGE_LISTS:-standard}"
2009-04-15 20:07:26 +00:00
2007-09-23 08:04:46 +00:00
# Setting security updates option
case "${LB_DISTRIBUTION}" in
wheezy|sid|baureo)
LB_SECURITY="${LB_SECURITY:-false}"
;;
*)
LB_SECURITY="${LB_SECURITY:-true}"
;;
esac
2007-09-23 08:04:46 +00:00
# Setting volatile updates option
case "${LB_DISTRIBUTION}" in
wheezy|sid|baureo)
LB_VOLATILE="${LB_VOLATILE:-false}"
;;
*)
LB_VOLATILE="${LB_VOLATILE:-true}"
;;
esac
2007-09-23 08:05:10 +00:00
## config/binary
# Setting image filesystem
case "${LB_ARCHITECTURES}" in
sparc)
LB_BINARY_FILESYSTEM="${LB_BINARY_FILESYSTEM:-ext2}"
;;
2009-04-15 20:07:26 +00:00
*)
LB_BINARY_FILESYSTEM="${LB_BINARY_FILESYSTEM:-fat16}"
;;
esac
2007-09-23 08:05:10 +00:00
# Setting image type
2010-12-27 16:12:36 -01:00
case "${LB_ARCHITECTURES}" in
amd64|i386)
LB_BINARY_IMAGES="${LB_BINARY_IMAGES:-iso-hybrid}"
;;
*)
LB_BINARY_IMAGES="${LB_BINARY_IMAGES:-iso}"
;;
esac
2007-09-23 08:05:10 +00:00
# Setting apt indices
case "${LB_MODE}" in
progress)
LB_APT_INDICES="${LB_APT_INDICES:-none}"
;;
*)
if echo ${LB_PACKAGE_LISTS} | grep -qs -E "(stripped|minimal)\b"
then
LB_APT_INDICES="${LB_APT_INDICES:-none}"
else
LB_APT_INDICES="${LB_APT_INDICES:-true}"
fi
;;
esac
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# Setting bootloader
if [ -z "${LB_BOOTLOADER}" ]
2007-09-23 08:05:10 +00:00
then
case "${LB_ARCHITECTURES}" in
amd64|i386)
LB_BOOTLOADER="syslinux"
2007-09-23 08:05:10 +00:00
;;
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
powerpc)
LB_BOOTLOADER="yaboot"
2007-09-23 08:05:10 +00:00
;;
sparc)
LB_BOOTLOADER="silo"
;;
2007-09-23 08:05:10 +00:00
esac
fi
# Setting checksums
LB_CHECKSUMS="${LB_CHECKSUMS:-md5}"
# Setting compression
2011-01-01 22:45:08 -01:00
case "${LB_MODE}" in
progress)
LB_COMPRESSION="${LB_COMPRESSION:-none}"
2011-01-01 22:45:08 -01:00
;;
*)
LB_COMPRESSION="${LB_COMPRESSION:-gzip}"
2011-01-01 22:45:08 -01:00
;;
esac
2007-09-23 08:05:15 +00:00
# Setting chroot option
LB_BUILD_WITH_CHROOT="${LB_BUILD_WITH_CHROOT:-true}"
2007-09-23 08:05:15 +00:00
LB_BUILD_WITH_TMPFS="${LB_BUILD_WITH_TMPFS:-false}"
2007-09-23 08:05:10 +00:00
# Setting debian-installer option
2011-01-01 22:45:08 -01:00
case "${LB_MODE}" in
progress)
2011-01-01 22:45:08 -01:00
LB_DEBIAN_INSTALLER="${LB_DEBIAN_INSTALLER:-live}"
;;
*)
LB_DEBIAN_INSTALLER="${LB_DEBIAN_INSTALLER:-false}"
;;
esac
2007-09-23 08:04:48 +00:00
LB_DEBIAN_INSTALLER_DISTRIBUTION="${LB_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_DISTRIBUTION}}"
# Setting debian-installer-gui
case "${LB_MODE}" in
2011-01-07 19:09:49 -01:00
debian|progress)
LB_DEBIAN_INSTALLER_GUI="${LB_DEBIAN_INSTALLER_GUI:-true}"
2010-09-26 10:38:38 +00:00
;;
*)
LB_DEBIAN_INSTALLER_GUI="${LB_DEBIAN_INSTALLER_GUI:-false}"
;;
esac
# Setting debian-installer preseed filename
if [ -z "${LB_DEBIAN_INSTALLER_PRESEEDFILE}" ]
then
if Find_files config/binary_debian-installer/preseed.cfg
then
LB_DEBIAN_INSTALLER_PRESEEDFILE="/preseed.cfg"
fi
if Find_files config/binary_debian-installer/*.cfg && [ ! -e config/binary_debian-installer/preseed.cfg ]
then
Echo_warning "You have placed some preseeding files into config/binary_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."
fi
fi
# Setting boot parameters
# LB_BOOTAPPEND_LIVE
if [ -n "${LB_DEBIAN_INSTALLER_PRESEEDFILE}" ]
then
case "${LB_BINARY_IMAGES}" in
iso*)
_LB_BOOTAPPEND_PRESEED="file=/cdrom/install/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
;;
usb*)
case "${LB_MODE}" in
ubuntu|kubuntu)
if [ "${LB_DEBIAN_INSTALLER}" = "live" ]
then
_LB_BOOTAPPEND_PRESEED="file=/cdrom/install/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
else
_LB_BOOTAPPEND_PRESEED="file=/hd-media/install/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
fi
;;
*)
_LB_BOOTAPPEND_PRESEED="file=/hd-media/install/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
;;
esac
;;
net)
case "${LB_DEBIAN_INSTALLER_PRESEEDFILE}" in
2008-08-12 20:21:40 +00:00
*://*)
_LB_BOOTAPPEND_PRESEED="file=${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
2008-08-12 20:21:40 +00:00
;;
*)
_LB_BOOTAPPEND_PRESEED="file=/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
2008-08-12 20:21:40 +00:00
;;
esac
;;
esac
fi
if [ -n ${_LB_BOOTAPPEND_PRESEED} ]
then
LB_BOOTAPPEND_INSTALL="${LB_BOOTAPPEND_INSTALL} ${_LB_BOOTAPPEND_PRESEED}"
fi
LB_BOOTAPPEND_INSTALL="$(echo ${LB_BOOTAPPEND_INSTALL} | sed -e 's/[ \t]*$//')"
2007-09-23 08:05:10 +00:00
# Setting grub splash
# LB_GRUB_SPLASH
2007-09-23 08:05:10 +00:00
2007-09-23 08:04:48 +00:00
# Setting hostname
2011-01-07 19:18:27 -01:00
LB_HOSTNAME="${LB_HOSTNAME:-${LB_MODE}}"
2007-09-23 08:04:48 +00:00
2007-09-23 08:05:10 +00:00
# Setting iso author
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
2011-01-07 19:09:49 -01:00
debian)
2010-12-27 16:12:36 -01:00
LB_ISO_APPLICATION="${LB_ISO_APPLICATION:-Debian Live}"
;;
2008-12-08 10:24:11 -01:00
2010-12-27 16:12:36 -01:00
emdebian)
LB_ISO_APPLICATION="${LB_ISO_APPLICATION:-Emdebian Live}"
;;
2009-04-15 20:07:26 +00:00
2011-01-01 22:45:08 -01:00
progress)
LB_ISO_APPLICATION="${LB_ISO_APPLICATION:-Progress Linux}"
;;
2010-12-27 16:12:36 -01:00
ubuntu)
LB_ISO_APPLICATION="${LB_ISO_APPLICATION:-Ubuntu Live}"
;;
kubuntu)
LB_ISO_APPLICATION="${LB_ISO_APPLICATION:-Kubuntu Live}"
;;
2010-12-27 16:12:36 -01:00
esac
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# Set iso preparer
LB_ISO_PREPARER="${LB_ISO_PREPARER:-live-build \$VERSION; http://packages.qa.debian.org/live-build}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# Set iso publisher
2011-01-01 22:45:08 -01:00
case "${LB_MODE}" in
progress)
LB_ISO_PUBLISHER="${LB_ISO_PUBLISHER:-Progress Linux; http://www.progress-linux.org/; progress-project@lists.progress-linux.org}"
;;
*)
LB_ISO_PUBLISHER="${LB_ISO_PUBLISHER:-Debian Live project; http://live.debian.net/; debian-live@lists.debian.org}"
;;
esac
2007-09-23 08:04:52 +00:00
2007-09-23 08:04:46 +00:00
# Setting iso volume
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
debian)
LB_ISO_VOLUME="${LB_ISO_VOLUME:-Debian ${LB_DISTRIBUTION} \$(date +%Y%m%d-%H:%M)}"
;;
2008-12-08 10:24:11 -01:00
2010-12-27 16:12:36 -01:00
emdebian)
LB_ISO_VOLUME="${LB_ISO_VOLUME:-Emdebian ${LB_DISTRIBUTION} \$(date +%Y%m%d-%H:%M)}"
;;
2009-04-15 20:07:26 +00:00
2011-01-01 22:45:08 -01:00
progress)
LB_ISO_VOLUME="${LB_ISO_VOLUME:-Progress ${LB_DISTRIBUTION}}"
2011-01-01 22:45:08 -01:00
;;
2010-12-27 16:12:36 -01:00
ubuntu)
LB_ISO_VOLUME="${LB_ISO_VOLUME:-Ubuntu ${LB_DISTRIBUTION} \$(date +%Y%m%d-%H:%M)}"
;;
kubuntu)
LB_ISO_VOLUME="${LB_ISO_VOLUME:-Ubuntu ${LB_DISTRIBUTION} \$(date +%Y%m%d-%H:%M)}"
;;
2010-12-27 16:12:36 -01:00
esac
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# Setting memtest option
LB_MEMTEST="${LB_MEMTEST:-memtest86+}"
2007-09-23 08:04:46 +00:00
# Setting win32-loader option
2010-12-27 16:12:36 -01:00
case "${LB_MODE}" in
progress|ubuntu|kubuntu)
2010-12-27 16:12:36 -01:00
;;
2010-12-27 16:12:36 -01:00
*)
case "${LB_ARCHITECTURES}" in
amd64|i386)
if [ "${LB_DEBIAN_INSTALLER}" != "false" ]
then
LB_WIN32_LOADER="${LB_WIN32_LOADER:-true}"
else
LB_WIN32_LOADER="${LB_WIN32_LOADER:-false}"
fi
;;
*)
LB_WIN32_LOADER="${LB_WIN32_LOADER:-false}"
;;
esac
;;
esac
2007-09-23 08:05:14 +00:00
# Setting netboot filesystem
LB_NET_ROOT_FILESYSTEM="${LB_NET_ROOT_FILESYSTEM:-nfs}"
2007-09-23 08:05:14 +00:00
2007-09-23 08:04:46 +00:00
# Setting netboot server path
2011-01-01 22:45:08 -01:00
case "${LB_MODE}" in
progress)
LB_NET_ROOT_PATH="${LB_NET_ROOT_PATH:-/srv/progress-linux}"
;;
*)
LB_NET_ROOT_PATH="${LB_NET_ROOT_PATH:-/srv/${LB_MODE}-live}"
;;
esac
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# Setting netboot server address
LB_NET_ROOT_SERVER="${LB_NET_ROOT_SERVER:-192.168.1.1}"
# Setting net cow filesystem
LB_NET_COW_FILESYSTEM="${LB_NET_COW_FILESYSTEM:-nfs}"
2007-09-23 08:05:10 +00:00
# Setting net tarball
LB_NET_TARBALL="${LB_NET_TARBALL:-true}"
# Setting syslinux theme package
2011-01-01 22:45:08 -01:00
case "${LB_MODE}" in
progress)
LB_SYSLINUX_THEME="${LB_SYSLINUX_THEME:-progress-standard}"
;;
*)
LB_SYSLINUX_THEME="${LB_SYSLINUX_THEME:-debian-squeeze}"
;;
esac
2007-09-23 08:05:10 +00:00
# Setting username
case "${LB_MODE}" in
2009-04-15 20:07:26 +00:00
ubuntu)
LB_USERNAME="${LB_USERNAME:-ubuntu}"
2009-04-15 20:07:26 +00:00
;;
kubuntu)
LB_USERNAME="${LB_USERNAME:-ubuntu}"
;;
2009-04-15 20:07:26 +00:00
*)
LB_USERNAME="${LB_USERNAME:-user}"
2009-04-15 20:07:26 +00:00
;;
esac
2007-09-23 08:05:10 +00:00
# Setting swap file
LB_SWAP_FILE_SIZE="${LB_SWAP_FILE_SIZE:-512}"
2007-09-23 08:05:10 +00:00
## config/source
2007-09-23 08:04:46 +00:00
# Setting source option
LB_SOURCE="${LB_SOURCE:-false}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# Setting image type
LB_SOURCE_IMAGES="${LB_SOURCE_IMAGES:-tar}"
# Setting fakeroot/fakechroot
LB_USE_FAKEROOT="${LB_USE_FAKEROOT:-false}"
2007-09-23 08:04:46 +00:00
}
Check_defaults ()
{
if [ "${LB_CONFIG_VERSION}" ]
then
# We're only checking when we're actually running the checks
# that's why the check for emptyness of the version;
# however, as live-build always declares LB_CONFIG_VERSION
# internally, this is safe assumption (no cases where it's unset,
# except when bootstrapping the functions/defaults etc.).
CURRENT_CONFIG_VERSION="$(echo ${LB_CONFIG_VERSION} | awk -F. '{ print $1 }')"
if [ ${CURRENT_CONFIG_VERSION} -ge 4 ]
then
Echo_error "This config tree is too new for this version of live-build (${VERSION})."
Echo_error "Aborting build, please get a new version of live-build."
2009-11-16 06:28:06 -01:00
exit 1
elif [ ${CURRENT_CONFIG_VERSION} -eq 2 ]
2009-11-16 06:28:06 -01:00
then
Echo_error "This config tree is too old for this version of live-build (${VERSION})."
2009-11-16 06:28:06 -01:00
Echo_error "Aborting build, please repopulate the config tree."
exit 1
elif [ ${CURRENT_CONFIG_VERSION} -lt 1 ]
then
Echo_warning "This config tree does not specify a format version or has an unknown version number."
Echo_warning "Continuing build, but it could lead to errors or different results. Please repopulate the config tree."
fi
fi
if echo ${LB_PACKAGE_LISTS} | grep -qs -E "(stripped|minimal)\b"
then
# aptitude + stripped|minimal
if [ "${LB_APT}" = "aptitude" ]
then
Echo_warning "You selected LB_PACKAGE_LISTS='%s' and LB_APT='aptitude'" "${LB_PACKAGE_LIST}. This configuration is potentially unsafe, as aptitude is not used in the stripped/minimal package lists."
fi
fi
if [ "${LB_DEBIAN_INSTALLER}" != "false" ]
then
# d-i true, no caching
if ! echo ${LB_CACHE_STAGES} | grep -qs "bootstrap\b" || [ "${LB_CACHE}" != "true" ] || [ "${LB_CACHE_PACKAGES}" != "true" ]
then
Echo_warning "You have selected values of LB_CACHE, LB_CACHE_PACKAGES, LB_CACHE_STAGES and LB_DEBIAN_INSTALLER which will result in 'bootstrap' packages not being cached. This configuration is potentially unsafe as the bootstrap packages are re-used when integrating the Debian Installer."
fi
fi
if [ "${LB_BOOTLOADER}" = "syslinux" ]
then
# syslinux + fat
case "${LB_BINARY_FILESYSTEM}" in
fat*)
;;
*)
Echo_warning "You have selected values of LB_BOOTLOADER and LB_BINARY_FILESYSTEM which are incompatible - syslinux only supports FAT filesystems."
;;
esac
fi
case "${LB_BINARY_IMAGES}" in
usb*)
# grub or yaboot + usb
case "${LB_BOOTLOADER}" in
grub|yaboot)
Echo_error "You have selected a combination of bootloader and image type that is currently not supported by live-build. Please use either another bootloader or a different image type."
exit 1
;;
esac
;;
esac
if [ "$(echo ${LB_ISO_APPLICATION} | wc -c)" -gt 128 ]
then
Echo_warning "You have specified a value of LB_ISO_APPLICATION that is too long; the maximum length is 128 characters."
fi
if [ "$(echo ${LB_ISO_PREPARER} | wc -c)" -gt 128 ]
then
Echo_warning "You have specified a value of LB_ISO_PREPARER that is too long; the maximum length is 128 characters."
fi
if [ "$(echo ${LB_ISO_PUBLISHER} | wc -c)" -gt 128 ]
then
Echo_warning "You have specified a value of LB_ISO_PUBLISHER that is too long; the maximum length is 128 characters."
fi
if [ "$(eval "echo ${LB_ISO_VOLUME}" | wc -c)" -gt 32 ]
then
Echo_warning "You have specified a value of LB_ISO_VOLUME that is too long; the maximum length is 32 characters."
fi
if echo ${LB_PACKAGE_LISTS} | grep -qs -E "(stripped|minimal)\b"
then
if [ "${LB_APT_INDICES}" = "true" ]
then
Echo_warning "You have selected hook to minimise image size but you are still including package indices with your value of LB_APT_INDICES."
fi
fi
}