2007-09-23 08:04:46 +00:00
#!/bin/sh
2010-09-02 11:12:37 +00:00
## live-build(7) - System Build Scripts
2010-09-26 10:38:38 +00:00
## Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
2010-09-02 11:12:37 +00:00
##
## 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
2010-09-07 13:11:20 +00:00
LB_BASE = " ${ LB_BASE :- /usr/share/live/build } "
2009-11-21 08:16:58 -01:00
2007-09-23 08:04:49 +00:00
# Setting mode
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_MODE } " ]
2007-09-23 08:04:49 +00:00
then
2010-09-07 13:11:20 +00:00
LB_MODE = "debian"
2007-09-23 08:04:49 +00:00
fi
2007-09-23 08:05:13 +00:00
# Setting distribution name
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_DISTRIBUTION } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-02-08 09:10:07 -01:00
debian| debian-release)
2010-09-07 13:11:20 +00:00
LB_DISTRIBUTION = "squeeze"
2007-09-23 12:05:11 +00:00
; ;
2008-12-08 10:24:11 -01:00
emdebian)
2010-09-07 13:11:20 +00:00
LB_DISTRIBUTION = "sid"
2008-12-08 10:24:11 -01:00
; ;
2009-04-15 20:07:26 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_DISTRIBUTION = "karmic"
2009-04-15 20:07:26 +00:00
; ;
2007-09-23 08:05:11 +00:00
esac
2007-09-23 08:04:46 +00:00
fi
2007-09-23 08:05:11 +00:00
# Setting package manager
2010-09-07 13:11:20 +00:00
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-09-07 13:11:20 +00:00
if [ -z " ${ LB_APT_FTP_PROXY } " ] && [ -n " ${ ftp_proxy } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
LB_APT_FTP_PROXY = " ${ ftp_proxy } "
2007-09-23 08:04:46 +00:00
else
2010-09-07 13:11:20 +00:00
if [ -n " ${ LB_APT_FTP_PROXY } " ] && [ " ${ LB_APT_FTP_PROXY } " != " ${ ftp_proxy } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
ftp_proxy = " ${ LB_APT_FTP_PROXY } "
2007-09-23 08:04:46 +00:00
fi
fi
# Setting apt http proxy
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_APT_HTTP_PROXY } " ] && [ -n " ${ http_proxy } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
LB_APT_HTTP_PROXY = " ${ http_proxy } "
2007-09-23 08:04:46 +00:00
else
2010-11-01 22:35:38 -01:00
if [ -n " ${ LB_APT_HTTP_PROXY } " ] && [ " ${ LB_APT_HTTP_PROXY } " != " ${ http_proxy } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
http_proxy = " ${ LB_APT_HTTP_PROXY } "
2007-09-23 08:04:46 +00:00
fi
fi
2007-09-23 08:05:11 +00:00
# Setting apt pipeline
2010-09-07 13:11:20 +00:00
# LB_APT_PIPELINE
2007-09-23 08:04:46 +00:00
2008-02-21 18:03:57 -01:00
APT_OPTIONS = " ${ APT_OPTIONS :- --yes } "
APTITUDE_OPTIONS = " ${ APTITUDE_OPTIONS :- --assume-yes } "
2009-09-11 07:39:13 +00:00
GZIP_OPTIONS = " ${ GZIP_OPTIONS :- --best } "
2010-06-21 20:26:11 +00:00
if gzip --help | grep -qs "\-\-rsyncable"
2009-09-11 07:39:13 +00:00
then
2010-06-21 20:26:11 +00:00
GZIP_OPTIONS = " $( echo ${ GZIP_OPTIONS } | sed -e 's|--rsyncable||' ) --rsyncable "
2009-09-11 07:39:13 +00:00
fi
2007-09-23 08:04:46 +00:00
# Setting apt recommends
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-04-15 20:07:26 +00:00
debian| debian-release| ubuntu)
2010-09-07 13:11:20 +00:00
LB_APT_RECOMMENDS = " ${ LB_APT_RECOMMENDS :- true } "
2007-09-23 08:05:17 +00:00
; ;
2008-12-08 10:24:11 -01:00
emdebian)
2010-09-07 13:11:20 +00:00
LB_APT_RECOMMENDS = " ${ LB_APT_RECOMMENDS :- false } "
2008-12-08 10:24:11 -01:00
; ;
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
2010-09-07 13:11:20 +00:00
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
2010-09-07 13:11:20 +00:00
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
2010-09-07 13:11:20 +00:00
LB_BOOTSTRAP = "debootstrap"
2007-10-19 10:45:57 +00:00
elif [ -x "/usr/bin/cdebootstrap" ]
then
2010-09-07 13:11:20 +00:00
LB_BOOTSTRAP = "cdebootstrap"
2007-10-19 10:45:57 +00:00
else
2009-01-31 09:22:23 -01:00
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
2010-09-07 13:11:20 +00:00
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
2010-09-07 13:11:20 +00:00
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
2010-09-07 13:11:20 +00:00
case " ${ LB_DEBCONF_NOWARNINGS } " in
2009-12-13 19:17:45 -01:00
true )
2010-09-07 13:11:20 +00:00
LB_DEBCONF_NOWARNINGS = "yes"
2007-09-23 08:05:14 +00:00
; ;
2009-12-13 19:17:45 -01:00
false )
2010-09-07 13:11:20 +00:00
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-09-07 13:11:20 +00:00
if [ -z " ${ LB_INITRAMFS } " ]
2007-09-23 08:05:10 +00:00
then
2010-09-07 13:11:20 +00:00
LB_INITRAMFS = "auto"
2007-09-23 08:05:17 +00:00
else
2010-09-07 13:11:20 +00:00
if [ " ${ LB_INITRAMFS } " = "auto" ]
2007-09-23 08:05:10 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-04-15 20:07:26 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_INITRAMFS = "casper"
2009-04-15 20:07:26 +00:00
; ;
2008-12-08 10:24:11 -01:00
*)
2010-09-24 20:01:43 +00:00
case " ${ LB_DISTRIBUTION } " in
wheezy)
LB_INITRAMFS = "live-boot"
; ;
*)
LB_INITRAMFS = "live-initramfs"
; ;
esac
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
fi
fi
2007-11-12 20:43:28 -01:00
# Setting fdisk
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_FDISK } " ] || [ ! -x " ${ LB_FDISK } " ]
2007-11-12 20:43:28 -01:00
then
# Workaround for gnu-fdisk divertion
# (gnu-fdisk is buggy, #445304).
if [ -x /sbin/fdisk.distrib ]
then
2010-09-07 13:11:20 +00:00
LB_FDISK = "fdisk.distrib"
2007-11-12 20:43:28 -01:00
elif [ -x /sbin/fdisk ]
then
2010-09-07 13:11:20 +00:00
LB_FDISK = "fdisk"
2007-11-12 20:43:28 -01:00
else
2008-08-12 21:29:14 +00:00
Echo_error "Can't process file /sbin/fdisk"
2007-11-12 20:43:28 -01:00
fi
fi
2007-09-23 08:04:47 +00:00
# Setting losetup
2010-09-07 13:11:20 +00:00
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
2007-11-12 20:43:28 -01:00
# (loop-aes-utils' losetup lacks features).
2007-09-23 08:04:47 +00:00
if [ -x /sbin/losetup.orig ]
then
2010-09-07 13:11:20 +00:00
LB_LOSETUP = "losetup.orig"
2007-09-23 08:04:47 +00:00
elif [ -x /sbin/losetup ]
then
2010-09-07 13:11:20 +00:00
LB_LOSETUP = "losetup"
2007-09-23 08:04:47 +00:00
else
2008-08-12 20:36:48 +00:00
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
2007-09-24 06:47:42 +00:00
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
2010-09-07 13:11:20 +00:00
LB_ROOT_COMMAND = ""
2007-09-23 08:05:11 +00:00
else
if [ -x /usr/bin/sudo ]
then
2009-12-13 19:17:45 -01:00
# FIXME: this is false until considered safe
2010-09-07 13:11:20 +00:00
#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
2007-09-23 08:05:10 +00:00
# Setting tasksel
2010-09-07 13:11:20 +00:00
LB_TASKSEL = " ${ LB_TASKSEL :- tasksel } "
2007-09-23 08:04:52 +00:00
2007-09-23 08:04:47 +00:00
# Setting root directory
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_ROOT } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-02-08 09:10:07 -01:00
debian| debian-release)
2010-09-07 13:11:20 +00:00
LB_ROOT = "debian-live"
2007-09-23 08:05:17 +00:00
; ;
2008-12-08 10:24:11 -01:00
emdebian)
2010-09-07 13:11:20 +00:00
LB_ROOT = "emdebian-live"
2008-12-08 10:24:11 -01:00
; ;
2009-04-15 20:07:26 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_ROOT = "ubuntu-live"
2009-04-15 20:07:26 +00:00
; ;
2007-09-23 08:04:49 +00:00
esac
fi
2007-09-23 08:04:52 +00:00
# Setting includes
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_INCLUDES } " ]
2007-09-23 08:04:52 +00:00
then
2010-09-07 13:11:20 +00:00
LB_INCLUDES = " ${ LB_BASE } /includes "
2007-09-23 08:04:52 +00:00
fi
# Setting templates
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_TEMPLATES } " ]
2007-09-23 08:04:52 +00:00
then
2010-09-07 13:11:20 +00:00
LB_TEMPLATES = " ${ LB_BASE } /templates "
2007-09-23 08:04:52 +00:00
fi
2010-09-13 19:49:20 +00:00
# Setting live build options
2009-12-13 19:17:45 -01:00
_BREAKPOINTS = " ${ _BREAKPOINTS :- false } "
2009-01-10 13:42:47 -01:00
_COLOR = " ${ _COLOR :- false } "
2009-12-13 19:17:45 -01:00
_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
2010-12-05 12:27:08 -01:00
if [ -z " ${ LB_ARCHITECTURES } " ]
2007-09-23 08:04:46 +00:00
then
if [ -x "/usr/bin/dpkg" ]
then
2010-12-05 12:27:08 -01:00
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)
2010-12-05 12:27:08 -01:00
LB_ARCHITECTURES = " $( uname -m) "
2008-08-31 22:46:38 +00:00
; ;
x86_64)
2010-12-05 12:27:08 -01:00
LB_ARCHITECTURES = "amd64"
2008-08-31 22:46:38 +00:00
; ;
*)
2010-12-05 13:24:53 -01: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
2007-09-28 00:54:23 +00:00
# Include packages on base
2010-09-07 13:11:20 +00:00
# LB_BOOTSTRAP_INCLUDE
2007-09-28 00:54:23 +00:00
# Exclude packages on base
2010-09-07 13:11:20 +00:00
# LB_BOOTSTRAP_EXCLUDE
2007-09-28 00:54:23 +00:00
2007-09-23 08:04:47 +00:00
# Setting distribution configuration value
2010-09-07 13:11:20 +00:00
# LB_BOOTSTRAP_CONFIG
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:47 +00:00
# Setting flavour value
2010-09-07 13:11:20 +00:00
case " ${ LB_BOOTSTRAP } " in
2007-10-31 08:55:37 -01:00
cdebootstrap)
2010-09-07 13:11:20 +00:00
LB_BOOTSTRAP_FLAVOUR = " ${ LB_BOOTSTRAP_FLAVOUR :- standard } "
2007-10-31 08:55:37 -01:00
; ;
esac
2007-09-23 08:05:11 +00:00
2008-04-04 17:24:47 +00:00
# Setting bootstrap keyring
2010-09-07 13:11:20 +00:00
# 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-09-07 13:11:20 +00:00
if [ -z " ${ LB_MIRROR_BOOTSTRAP } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-02-08 09:10:07 -01:00
debian| debian-release)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BOOTSTRAP = "http://ftp.de.debian.org/debian/"
2007-09-23 08:04:49 +00:00
; ;
2008-12-08 10:24:11 -01:00
emdebian)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BOOTSTRAP = "http://buildd.emdebian.org/grip/"
2008-12-08 10:24:11 -01:00
; ;
2009-04-15 20:07:26 +00:00
ubuntu)
2010-12-05 12:27:08 -01:00
case " ${ LB_ARCHITECTURES } " in
2009-04-15 20:07:26 +00:00
amd64| i386)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BOOTSTRAP = "http://archive.ubuntu.com/ubuntu/"
2009-04-15 20:07:26 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BOOTSTRAP = "http://ports.ubuntu.com/"
2009-04-15 20:07:26 +00:00
; ;
esac
; ;
2007-09-23 08:04:49 +00:00
esac
2007-09-23 08:04:46 +00:00
fi
2010-09-07 13:11:20 +00:00
LB_MIRROR_CHROOT = " ${ LB_MIRROR_CHROOT :- ${ LB_MIRROR_BOOTSTRAP } } "
2008-02-21 18:52:37 -01:00
2007-09-23 08:04:48 +00:00
# Setting security mirror to fetch packages from
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_MIRROR_CHROOT_SECURITY } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-02-08 09:10:07 -01:00
debian| debian-release)
2010-09-07 13:11:20 +00:00
LB_MIRROR_CHROOT_SECURITY = "http://security.debian.org/"
2008-12-08 10:24:11 -01:00
; ;
emdebian)
2010-09-07 13:11:20 +00:00
LB_MIRROR_CHROOT_SECURITY = "none"
2008-12-08 10:24:11 -01:00
; ;
2009-04-15 20:07:26 +00:00
ubuntu)
2010-12-05 12:27:08 -01:00
case " ${ LB_ARCHITECTURES } " in
2009-04-15 20:07:26 +00:00
amd64| i386)
2010-09-07 13:11:20 +00:00
LB_MIRROR_CHROOT_SECURITY = "http://security.ubuntu.com/ubuntu/"
2009-04-15 20:07:26 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_MIRROR_CHROOT_SECURITY = "http://ports.ubuntu.com/"
2009-04-15 20:07:26 +00:00
; ;
esac
; ;
2008-12-08 10:24:11 -01:00
esac
2007-09-23 08:04:46 +00:00
fi
2010-03-06 15:23:59 -01:00
# Setting volatile mirror to fetch packages from
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_MIRROR_CHROOT_VOLATILE } " ]
2010-03-06 15:23:59 -01:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2010-03-06 15:23:59 -01:00
debian| debian-release)
2010-12-27 15:42:17 -01:00
LB_MIRROR_CHROOT_VOLATILE = " ${ LB_MIRROR_CHROOT } "
2010-03-06 15:23:59 -01:00
; ;
2010-03-11 16:03:29 -01:00
ubuntu)
2010-12-05 12:27:08 -01:00
case " ${ LB_ARCHITECTURES } " in
2010-03-11 16:03:29 -01:00
amd64| i386)
2010-09-07 13:11:20 +00:00
LB_MIRROR_CHROOT_VOLATILE = "http://security.ubuntu.com/ubuntu/"
2010-03-11 16:03:29 -01:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_MIRROR_CHROOT_VOLATILE = "http://ports.ubuntu.com/"
2010-03-11 16:03:29 -01:00
; ;
esac
; ;
2010-03-06 15:23:59 -01:00
2010-12-27 15:42:17 -01:00
*)
LB_MIRROR_CHROOT_VOLATILE = "none"
; ;
esac
2010-03-06 15:23:59 -01:00
fi
2010-09-16 12:15:30 +00:00
# Setting backports mirror to fetch packages from
if [ -z " ${ LB_MIRROR_CHROOT_BACKPORTS } " ]
then
case " ${ LB_MODE } " in
debian| debian-release)
2010-12-27 15:42:17 -01:00
LB_MIRROR_CHROOT_BACKPORTS = "http://backports.debian.org/debian-backports/"
2010-09-16 12:15:30 +00:00
; ;
2010-12-27 15:42:17 -01:00
*)
LB_MIRROR_CHROOT_BACKPORTS = "none"
; ;
esac
2010-09-16 12:15:30 +00:00
fi
2007-09-23 08:04:48 +00:00
# Setting mirror which ends up in the image
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_MIRROR_BINARY } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-02-08 09:10:07 -01:00
debian| debian-release)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BINARY = "http://cdn.debian.net/debian/"
2007-09-23 08:04:49 +00:00
; ;
2008-12-08 10:24:11 -01:00
emdebian)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BINARY = "http://buildd.emdebian.org/grip/"
2008-12-08 10:24:11 -01:00
; ;
2009-04-15 20:07:26 +00:00
ubuntu)
2010-12-05 12:27:08 -01:00
case " ${ LB_ARCHITECTURES } " in
2009-04-15 20:07:26 +00:00
amd64| i386)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BINARY = "http://archive.ubuntu.com/ubuntu/"
2009-04-15 20:07:26 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BINARY = "http://ports.ubuntu.com/"
2009-04-15 20:07:26 +00:00
; ;
esac
; ;
2007-09-23 08:04:49 +00:00
esac
2007-09-23 08:04:46 +00:00
fi
2007-09-23 08:04:48 +00:00
# Setting security mirror which ends up in the image
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_MIRROR_BINARY_SECURITY } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-02-08 09:10:07 -01:00
debian| debian-release)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BINARY_SECURITY = "http://security.debian.org/"
2008-12-08 10:24:11 -01:00
; ;
emdebian)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BINARY_SECURITY = "none"
2008-12-08 10:24:11 -01:00
; ;
2009-04-15 20:07:26 +00:00
ubuntu)
2010-12-05 12:27:08 -01:00
case " ${ LB_ARCHITECTURES } " in
2009-04-15 20:07:26 +00:00
amd64| i386)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BINARY_SECURITY = "http://archive.ubuntu.com/ubuntu/"
2009-04-15 20:07:26 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BINARY_SECURITY = "http://ports.ubuntu.com/"
2009-04-15 20:07:26 +00:00
; ;
esac
; ;
2008-12-08 10:24:11 -01:00
esac
2007-09-23 08:04:46 +00:00
fi
2010-03-06 15:23:59 -01:00
# Setting volatile mirror which ends up in the image
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_MIRROR_BINARY_VOLATILE } " ]
2010-03-06 15:23:59 -01:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2010-03-06 15:23:59 -01:00
debian| debian-release)
2010-12-27 15:42:17 -01:00
LB_MIRROR_BINARY_VOLATILE = " ${ LB_MIRROR_BINARY } "
2010-03-06 15:23:59 -01:00
; ;
2010-03-11 16:03:29 -01:00
ubuntu)
2010-12-05 12:27:08 -01:00
case " ${ LB_ARCHITECTURES } " in
2010-03-11 16:03:29 -01:00
amd64| i386)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BINARY_VOLATILE = "http://security.ubuntu.com/ubuntu/"
2010-03-11 16:03:29 -01:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_MIRROR_BINARY_VOLATILE = "http://ports.ubuntu.com/"
2010-03-11 16:03:29 -01:00
; ;
esac
; ;
2010-03-06 15:23:59 -01:00
2010-12-27 15:42:17 -01:00
*)
LB_MIRROR_BINARY_VOLATILE = "none"
; ;
esac
2010-03-06 15:23:59 -01:00
fi
2010-09-16 12:15:30 +00:00
# Setting backports mirror which ends up in the image
if [ -z " ${ LB_MIRROR_BINARY_BACKPORTS } " ]
then
case " ${ LB_MODE } " in
debian| debian-release)
2010-12-27 15:42:17 -01:00
LB_MIRROR_BINARY_BACKPORTS = "http://backports.debian.org/debian-backports/"
2010-09-16 12:15:30 +00:00
; ;
2010-12-27 15:42:17 -01:00
*)
LB_MIRROR_BINARY_BACKPORTS = "none"
; ;
esac
2010-09-16 12:15:30 +00:00
fi
2010-09-07 13:11:20 +00:00
LB_MIRROR_DEBIAN_INSTALLER = " ${ LB_MIRROR_DEBIAN_INSTALLER :- ${ LB_MIRROR_BOOTSTRAP } } "
2010-03-04 11:22:15 -01:00
2009-11-22 12:40:20 -01:00
# Setting archive areas value
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_ARCHIVE_AREAS } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-04-17 19:32:48 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_ARCHIVE_AREAS = "main restricted"
2009-04-17 19:32:48 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_ARCHIVE_AREAS = "main"
2009-04-17 19:32:48 +00:00
; ;
esac
2007-09-23 08:04:46 +00:00
fi
## config/chroot
2007-09-23 08:05:10 +00:00
# Setting chroot filesystem
2010-09-07 13:11:20 +00:00
LB_CHROOT_FILESYSTEM = " ${ LB_CHROOT_FILESYSTEM :- squashfs } "
2007-09-23 08:05:10 +00:00
2009-02-25 07:51:28 -01:00
# Setting virtual root size
2010-09-07 13:11:20 +00:00
LB_VIRTUAL_ROOT_SIZE = " ${ LB_VIRTUAL_ROOT_SIZE :- 10000 } "
2009-02-25 07:51:28 -01:00
2007-10-23 20:56:43 +00:00
# Setting whether to expose root filesystem as read only
2010-09-07 13:11:20 +00:00
LB_EXPOSED_ROOT = " ${ LB_EXPOSED_ROOT :- false } "
2007-10-23 20:56:43 +00:00
2007-09-23 08:05:13 +00:00
# Setting union filesystem
2010-09-07 13:11:20 +00:00
LB_UNION_FILESYSTEM = " ${ LB_UNION_FILESYSTEM :- aufs } "
2007-09-23 08:05:13 +00:00
2010-09-07 13:11:20 +00:00
# LB_HOOKS
2007-09-23 08:05:10 +00:00
2007-09-23 08:04:48 +00:00
# Setting interactive shell/X11/Xnest
2010-09-07 13:11:20 +00:00
LB_INTERACTIVE = " ${ LB_INTERACTIVE :- false } "
2007-09-23 08:04:48 +00:00
2007-09-23 08:05:10 +00:00
# Setting keyring packages
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-02-08 09:10:07 -01:00
debian| debian-release)
2010-09-07 13:11:20 +00:00
LB_KEYRING_PACKAGES = " ${ LB_KEYRING_PACKAGES :- debian -archive-keyring } "
2007-09-23 08:05:17 +00:00
; ;
2008-12-08 10:24:11 -01:00
emdebian)
2010-09-07 13:11:20 +00:00
LB_KEYRING_PACKAGES = " ${ LB_KEYRING_PACKAGES :- debian -archive-keyring } "
2008-12-08 10:24:11 -01:00
; ;
2009-04-15 20:07:26 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_KEYRING_PACKAGES = " ${ LB_KEYRING_PACKAGES :- ubuntu -keyring } "
2009-04-15 20:07:26 +00:00
; ;
2007-09-23 08:05:17 +00:00
esac
2007-09-23 08:05:10 +00:00
# Setting language string
2010-09-07 13:11:20 +00:00
LB_LANGUAGE = " ${ LB_LANGUAGE :- en } "
2007-09-23 08:05:10 +00:00
# Setting linux flavour string
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_LINUX_FLAVOURS } " ]
2007-09-23 08:04:46 +00:00
then
2010-12-05 12:27:08 -01:00
case " ${ LB_ARCHITECTURES } " in
2010-10-21 08:44:34 +00:00
armel)
2010-02-17 12:57:12 -01:00
Echo_error "There is no default kernel flavour defined for your architecture."
2010-09-02 13:14:29 +00:00
Echo_error "Please configure it manually with 'lb config -k FLAVOUR'."
2010-02-17 12:57:12 -01:00
exit 1
; ;
2007-09-23 08:04:46 +00:00
alpha)
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-04-15 20:07:26 +00:00
ubuntu)
2010-12-05 12:27:08 -01:00
Echo_error " Architecture(s) ${ LB_ARCHITECTURES } not supported on Ubuntu. "
2009-11-01 09:39:31 -01:00
exit 1
2009-04-15 20:07:26 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_LINUX_FLAVOURS = "alpha-generic"
2009-04-15 20:07:26 +00:00
; ;
esac
2007-09-23 08:04:46 +00:00
; ;
amd64)
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-04-15 20:07:26 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_LINUX_FLAVOURS = "generic"
2009-04-15 20:07:26 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_LINUX_FLAVOURS = "amd64"
2009-04-15 20:07:26 +00:00
; ;
esac
2007-09-23 08:04:46 +00:00
; ;
i386)
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-04-15 20:07:26 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_LINUX_FLAVOURS = "generic"
2008-09-03 09:02:30 +00:00
; ;
*)
2009-04-15 20:07:26 +00:00
case " ${ LIST } " in
stripped| minimal)
2010-09-07 13:11:20 +00:00
LB_LINUX_FLAVOURS = "486"
2009-04-15 20:07:26 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_LINUX_FLAVOURS = "486 686"
2009-04-15 20:07:26 +00:00
; ;
esac
2008-09-03 09:02:30 +00:00
; ;
esac
2007-09-23 08:04:46 +00:00
; ;
ia64)
2010-09-07 13:11:20 +00:00
LB_LINUX_FLAVOURS = "itanium"
2007-09-23 08:04:46 +00:00
; ;
powerpc)
2008-09-03 09:02:30 +00:00
case " ${ LIST } " in
stripped| minimal)
2010-09-07 13:11:20 +00:00
LB_LINUX_FLAVOURS = "powerpc"
2008-09-03 09:02:30 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_LINUX_FLAVOURS = "powerpc powerpc64"
2008-09-03 09:02:30 +00:00
; ;
esac
2007-09-23 08:04:46 +00:00
; ;
s390)
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-04-15 20:07:26 +00:00
ubuntu)
2010-12-05 12:27:08 -01:00
Echo_error " Architecture(s) ${ LB_ARCHITECTURES } not supported on Ubuntu. "
2009-04-17 08:23:38 +00:00
exit 1
2009-04-15 20:07:26 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_LINUX_FLAVOURS = "s390"
2009-04-15 20:07:26 +00:00
; ;
esac
2007-09-23 08:04:46 +00:00
; ;
sparc)
2010-09-07 13:11:20 +00:00
LB_LINUX_FLAVOURS = "sparc64"
2007-09-23 08:04:46 +00:00
; ;
*)
2010-12-05 12:27:08 -01:00
Echo_error " Architecture(s) ${ LB_ARCHITECTURES } not yet supported (FIXME) "
2009-04-17 08:23:38 +00:00
exit 1
2007-09-23 08:04:46 +00:00
; ;
esac
fi
2007-09-23 08:05:10 +00:00
# Set linux packages
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_LINUX_PACKAGES } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2010-12-27 15:42:17 -01:00
ubuntu)
LB_LINUX_PACKAGES = "linux"
; ;
2007-09-23 08:04:49 +00:00
2010-12-27 15:42:17 -01:00
*)
LB_LINUX_PACKAGES = "linux-image-2.6"
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
case " ${ LB_ENCRYPTION } " in
2009-12-13 19:17:45 -01:00
"" | false )
2009-04-15 20:07:26 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_LINUX_PACKAGES = " ${ LB_LINUX_PACKAGES } loop-aes-modules-2.6 "
2009-04-15 20:07:26 +00:00
; ;
esac
2008-03-23 03:21:47 -01:00
; ;
esac
2007-09-23 08:04:46 +00:00
fi
# Setting packages string
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-04-15 20:07:26 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_PACKAGES = " ${ LB_PACKAGES :- ubuntu -minimal } "
2009-04-15 20:07:26 +00:00
; ;
*)
2010-11-23 10:31:15 -01:00
LB_PACKAGE_LISTS = " ${ LB_PACKAGE_LISTS :- standard } "
2009-04-15 20:07:26 +00:00
; ;
esac
2010-09-07 13:11:20 +00:00
case " ${ LB_ENCRYPTION } " in
2009-12-13 19:17:45 -01:00
"" | false )
2009-04-15 20:07:26 +00:00
2009-02-01 09:51:51 -01:00
; ;
*)
2010-09-07 13:11:20 +00:00
if ! In_list loop-aes-utils " ${ LB_PACKAGES } "
2009-02-01 09:51:51 -01:00
then
2010-09-07 13:11:20 +00:00
LB_PACKAGES = " ${ LB_PACKAGES } loop-aes-utils "
2009-02-01 09:51:51 -01:00
fi
; ;
esac
2007-09-23 08:04:46 +00:00
# Setting tasks string
2010-11-23 10:31:15 -01:00
for LIST in ${ LB_PACKAGE_LISTS }
2007-09-23 08:04:46 +00:00
do
case " ${ LIST } " in
2008-01-17 16:15:11 -01:00
stripped| minimal)
2010-09-07 13:11:20 +00:00
LB_APT = "apt-get"
2007-09-23 08:04:50 +00:00
; ;
2007-09-23 08:04:46 +00:00
gnome-desktop)
2010-11-23 10:31:15 -01:00
LB_PACKAGE_LISTS = " $( echo ${ LB_PACKAGE_LISTS } | sed -e 's|gnome-desktop||' ) standard-x11 "
2010-12-27 15:42:17 -01:00
LB_TASKS = " $( echo ${ LB_TASKS } | sed -e 's|standard||' -e 's|gnome-desktop||' -e 's|desktop||' -e 's|laptop||' ) standard gnome-desktop desktop laptop "
LB_PACKAGES = " $( echo ${ LB_PACKAGES } | sed -e 's|debian-installer-launcher||' ) debian-installer-launcher "
2007-09-23 08:04:46 +00:00
; ;
kde-desktop)
2010-11-23 10:31:15 -01:00
LB_PACKAGE_LISTS = " $( echo ${ LB_PACKAGE_LISTS } | sed -e 's|kde-desktop||' ) standard-x11 "
2010-02-20 22:37:32 -01:00
2010-12-27 15:42:17 -01:00
LB_TASKS = " $( echo ${ LB_TASKS } | sed -e 's|standard||' -e 's|kde-desktop||' -e 's|desktop||' -e 's|laptop||' ) standard kde-desktop desktop laptop "
LB_PACKAGES = " $( echo ${ LB_PACKAGES } | sed -e 's|debian-installer-launcher||' ) debian-installer-launcher "
2007-09-23 08:04:46 +00:00
; ;
2008-11-30 09:37:06 -01:00
lxde-desktop)
2010-11-23 10:31:15 -01:00
LB_PACKAGE_LISTS = " $( echo ${ LB_PACKAGE_LISTS } | sed -e 's|lxde-desktop||' ) standard-x11 "
2010-02-20 22:37:32 -01:00
2010-12-27 15:42:17 -01:00
LB_TASKS = " $( echo ${ LB_TASKS } | sed -e 's|standard||' -e 's|lxde-desktop||' -e 's|desktop||' -e 's|laptop||' ) standard lxde-desktop desktop laptop "
LB_PACKAGES = " $( echo ${ LB_PACKAGES } | sed -e 's|debian-installer-launcher||' ) debian-installer-launcher "
2008-11-30 09:37:06 -01:00
; ;
2007-09-23 08:04:46 +00:00
xfce-desktop)
2010-11-23 10:31:15 -01:00
LB_PACKAGE_LISTS = " $( echo ${ LB_PACKAGE_LISTS } | sed -e 's|xfce-desktop||' ) standard-x11 "
2010-02-20 22:37:32 -01:00
2010-12-27 15:42:17 -01:00
LB_TASKS = " $( echo ${ LB_TASKS } | sed -e 's|standard||' -e 's|xfce-desktop||' -e 's|desktop||' -e 's|laptop||' ) standard xfce-desktop desktop laptop "
LB_PACKAGES = " $( echo ${ LB_PACKAGES } | sed -e 's|debian-installer-launcher||' ) debian-installer-launcher "
2007-09-23 08:04:46 +00:00
; ;
esac
done
2010-11-23 10:31:15 -01:00
LB_PACKAGE_LISTS = " $( echo ${ LB_PACKAGE_LISTS } | sed -e 's| ||g' ) "
2010-09-07 13:11:20 +00:00
LB_TASKS = " $( echo ${ LB_TASKS } | sed -e 's| ||g' ) "
2007-09-23 08:04:48 +00:00
2007-09-23 08:04:46 +00:00
# Setting security updates option
2010-09-07 13:11:20 +00:00
if [ " ${ LB_MIRROR_CHROOT_SECURITY } " = "none" ] || [ " ${ LB_MIRROR_BINARY_SECURITY } " = "none" ]
2007-09-23 08:05:14 +00:00
then
2010-09-07 13:11:20 +00:00
LB_SECURITY = "false"
2007-09-23 08:05:14 +00:00
fi
2010-09-07 13:11:20 +00:00
LB_SECURITY = " ${ LB_SECURITY :- true } "
2007-09-23 08:04:46 +00:00
2010-03-06 15:23:59 -01:00
# Setting volatile updates option
2010-09-07 13:11:20 +00:00
if [ " ${ LB_MIRROR_CHROOT_VOLATILE } " = "none" ] || [ " ${ LB_MIRROR_BINARY_VOLATILE } " = "none" ]
2010-03-06 15:23:59 -01:00
then
2010-09-07 13:11:20 +00:00
LB_VOLATILE = "false"
2010-03-06 15:23:59 -01:00
fi
2010-09-07 13:11:20 +00:00
LB_VOLATILE = " ${ LB_VOLATILE :- true } "
2010-03-06 15:23:59 -01:00
2007-09-23 08:04:46 +00:00
# Setting sysvinit option
2010-09-07 13:11:20 +00:00
LB_SYSVINIT = " ${ LB_SYSVINIT :- false } "
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
## config/binary
2007-11-16 21:01:03 -01:00
# Setting image filesystem
2010-12-05 12:27:08 -01:00
case " ${ LB_ARCHITECTURES } " in
2008-06-15 15:27:35 +00:00
sparc)
2010-09-07 13:11:20 +00:00
LB_BINARY_FILESYSTEM = " ${ LB_BINARY_FILESYSTEM :- ext2 } "
2008-06-15 15:27:35 +00:00
; ;
2009-04-15 20:07:26 +00:00
2008-06-15 15:27:35 +00:00
*)
2010-09-07 13:11:20 +00:00
LB_BINARY_FILESYSTEM = " ${ LB_BINARY_FILESYSTEM :- fat16 } "
2008-06-15 15:27:35 +00:00
; ;
esac
2007-11-16 21:01:03 -01:00
2007-09-23 08:05:10 +00:00
# Setting image type
2010-09-07 13:11:20 +00:00
case " ${ LB_DISTRIBUTION } " in
2010-02-18 15:34:29 -01:00
squeeze| sid)
2010-12-05 12:27:08 -01:00
case " ${ LB_ARCHITECTURES } " in
2010-02-18 15:34:29 -01:00
amd64| i386)
2010-09-07 13:11:20 +00:00
LB_BINARY_IMAGES = " ${ LB_BINARY_IMAGES :- iso -hybrid } "
2010-02-18 15:34:29 -01:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_BINARY_IMAGES = " ${ LB_BINARY_IMAGES :- iso } "
2010-02-18 15:34:29 -01:00
; ;
esac
; ;
*)
2010-09-07 13:11:20 +00:00
LB_BINARY_IMAGES = " ${ LB_BINARY_IMAGES :- iso } "
2010-02-18 15:34:29 -01:00
; ;
esac
2007-09-23 08:05:10 +00:00
# Setting apt indices
2010-11-23 10:31:15 -01:00
if echo ${ LB_PACKAGE_LISTS } | grep -qs -E "(stripped|minimal)\b"
2009-02-13 08:17:29 -01:00
then
2010-11-21 15:17:48 -01:00
LB_APT_INDICES = " ${ LB_APT_INDICES :- none } "
2009-02-13 08:17:29 -01:00
else
2010-11-21 15:17:48 -01:00
LB_APT_INDICES = " ${ LB_APT_INDICES :- true } "
2009-02-13 08:17:29 -01:00
fi
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# Setting bootloader
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_BOOTLOADER } " ]
2007-09-23 08:05:10 +00:00
then
2010-12-05 12:27:08 -01:00
case " ${ LB_ARCHITECTURES } " in
2009-12-09 19:54:41 -01:00
amd64| i386)
2010-09-07 13:11:20 +00:00
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)
2010-09-07 13:11:20 +00:00
LB_BOOTLOADER = "yaboot"
2007-09-23 08:05:10 +00:00
; ;
2008-06-15 03:46:51 +00:00
sparc)
2010-09-07 13:11:20 +00:00
LB_BOOTLOADER = "silo"
2008-06-15 03:46:51 +00:00
; ;
2007-09-23 08:05:10 +00:00
esac
fi
2007-11-12 21:00:48 -01:00
# Setting checksums
2010-09-07 13:11:20 +00:00
LB_CHECKSUMS = " ${ LB_CHECKSUMS :- md5 } "
2007-11-12 21:00:48 -01:00
2007-09-23 08:05:15 +00:00
# Setting chroot option
2010-09-07 13:11:20 +00:00
LB_BUILD_WITH_CHROOT = " ${ LB_BUILD_WITH_CHROOT :- true } "
2007-09-23 08:05:15 +00:00
2010-10-28 07:51:55 +00:00
LB_BUILD_WITH_TMPFS = " ${ LB_BUILD_WITH_TMPFS :- false } "
2007-09-23 08:05:10 +00:00
# Setting debian-installer option
2010-09-07 13:11:20 +00:00
LB_DEBIAN_INSTALLER = " ${ LB_DEBIAN_INSTALLER :- false } "
2007-09-23 08:04:48 +00:00
2008-08-10 00:38:06 +00:00
# Setting debian-installer distribution
2010-09-07 13:11:20 +00:00
LB_DEBIAN_INSTALLER_DISTRIBUTION = " ${ LB_DEBIAN_INSTALLER_DISTRIBUTION :- ${ LB_DISTRIBUTION } } "
2008-08-10 00:38:06 +00:00
2009-09-02 05:39:13 +00:00
# Setting debian-installer-gui
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-09-02 05:39:13 +00:00
debian)
2010-09-30 05:04:55 +00:00
LB_DEBIAN_INSTALLER_GUI = " ${ LB_DEBIAN_INSTALLER_GUI :- true } "
2010-09-26 10:38:38 +00:00
; ;
2009-09-02 05:39:13 +00:00
*)
2010-09-07 13:11:20 +00:00
LB_DEBIAN_INSTALLER_GUI = " ${ LB_DEBIAN_INSTALLER_GUI :- false } "
2009-09-02 05:39:13 +00:00
; ;
esac
2008-08-12 20:04:25 +00:00
# Setting debian-installer preseed filename
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_DEBIAN_INSTALLER_PRESEEDFILE } " ]
2008-08-12 20:04:25 +00:00
then
if Find_files config/binary_debian-installer/preseed.cfg
then
2010-09-07 13:11:20 +00:00
LB_DEBIAN_INSTALLER_PRESEEDFILE = "/preseed.cfg"
2008-08-12 20:04:25 +00:00
fi
if Find_files config/binary_debian-installer/*.cfg && [ ! -e config/binary_debian-installer/preseed.cfg ]
then
2010-09-07 13:11:20 +00:00
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."
2008-08-12 20:04:25 +00:00
fi
fi
# Setting boot parameters
2010-09-07 13:11:20 +00:00
# LB_BOOTAPPEND_LIVE
if [ -n " ${ LB_DEBIAN_INSTALLER_PRESEEDFILE } " ]
2008-08-12 20:04:25 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_BINARY_IMAGES } " in
2010-02-18 15:34:29 -01:00
iso*)
2010-09-07 13:11:20 +00:00
_LB_BOOTAPPEND_PRESEED = " file=/cdrom/install/ ${ LB_DEBIAN_INSTALLER_PRESEEDFILE } "
2008-08-12 20:04:25 +00:00
; ;
2010-02-18 15:12:59 -01:00
usb*)
2010-09-07 13:11:20 +00:00
if [ " ${ LB_MODE } " = "ubuntu" ] || [ " ${ LB_DEBIAN_INSTALLER } " = "live" ]
2009-05-27 16:08:35 +00:00
then
2010-09-07 13:11:20 +00:00
_LB_BOOTAPPEND_PRESEED = " file=/cdrom/install/ ${ LB_DEBIAN_INSTALLER_PRESEEDFILE } "
2009-05-27 16:08:35 +00:00
else
2010-09-07 13:11:20 +00:00
_LB_BOOTAPPEND_PRESEED = " file=/hd-media/install/ ${ LB_DEBIAN_INSTALLER_PRESEEDFILE } "
2009-05-27 16:08:35 +00:00
fi
2008-08-12 20:11:18 +00:00
; ;
net)
2010-09-07 13:11:20 +00:00
case " ${ LB_DEBIAN_INSTALLER_PRESEEDFILE } " in
2008-08-12 20:21:40 +00:00
*://*)
2010-09-07 13:11:20 +00:00
_LB_BOOTAPPEND_PRESEED = " file= ${ LB_DEBIAN_INSTALLER_PRESEEDFILE } "
2008-08-12 20:21:40 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
_LB_BOOTAPPEND_PRESEED = " file=/ ${ LB_DEBIAN_INSTALLER_PRESEEDFILE } "
2008-08-12 20:21:40 +00:00
; ;
esac
2008-08-12 20:04:25 +00:00
; ;
esac
fi
2010-09-07 13:11:20 +00:00
if [ -n ${ _LB_BOOTAPPEND_PRESEED } ]
2009-11-13 07:27:00 -01:00
then
2010-09-07 13:11:20 +00:00
LB_BOOTAPPEND_INSTALL = " ${ LB_BOOTAPPEND_INSTALL } ${ _LB_BOOTAPPEND_PRESEED } "
2009-11-13 07:27:00 -01:00
fi
2008-08-12 20:04:25 +00:00
2010-09-07 13:11:20 +00:00
LB_BOOTAPPEND_INSTALL = " $( echo ${ LB_BOOTAPPEND_INSTALL } | sed -e 's/[ \t]*$//' ) "
2010-02-17 10:23:34 -01:00
2007-09-23 08:05:10 +00:00
# Setting encryption
2010-09-07 13:11:20 +00:00
LB_ENCRYPTION = " ${ LB_ENCRYPTION :- false } "
2007-09-23 08:05:10 +00:00
# Setting grub splash
2010-09-07 13:11:20 +00:00
# LB_GRUB_SPLASH
2007-09-23 08:05:10 +00:00
2007-09-23 08:04:48 +00:00
# Setting hostname
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_HOSTNAME } " ]
2007-09-23 08:04:48 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-04-15 20:07:26 +00:00
embedian)
2010-09-07 13:11:20 +00:00
LB_HOSTNAME = "embedian"
2009-04-15 20:07:26 +00:00
; ;
ubuntu)
2010-09-07 13:11:20 +00:00
LB_HOSTNAME = "ubuntu"
2009-04-15 20:07:26 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_HOSTNAME = "debian"
2009-04-15 20:07:26 +00:00
; ;
esac
2007-09-23 08:04:48 +00:00
fi
2007-09-23 08:05:10 +00:00
# Setting iso author
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_ISO_APPLICATION } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-02-08 09:10:07 -01:00
debian| debian-release)
2010-09-07 13:11:20 +00:00
LB_ISO_APPLICATION = "Debian Live"
2007-09-23 08:05:17 +00:00
; ;
2008-12-08 10:24:11 -01:00
emdebian)
2010-09-07 13:11:20 +00:00
LB_ISO_APPLICATION = "Emdebian Live"
2008-12-08 10:24:11 -01:00
; ;
2009-04-15 20:07:26 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_ISO_APPLICATION = "Ubuntu Live"
2009-04-15 20:07:26 +00:00
; ;
2007-09-23 08:05:10 +00:00
esac
2007-09-23 08:04:46 +00:00
fi
2007-09-23 08:05:10 +00:00
# Set iso preparer
2010-09-07 13:11:20 +00:00
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
2010-09-07 13:11:20 +00:00
LB_ISO_PUBLISHER = " ${ LB_ISO_PUBLISHER :- Debian Live project; http : //live.debian.net/; debian-live@lists.debian.org } "
2007-09-23 08:04:52 +00:00
2007-09-23 08:04:46 +00:00
# Setting iso volume
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_ISO_VOLUME } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-02-08 09:13:32 -01:00
debian)
2010-09-07 13:11:20 +00:00
LB_ISO_VOLUME = " Debian ${ LB_DISTRIBUTION } \$(date +%Y%m%d-%H:%M) "
2007-09-23 08:05:17 +00:00
; ;
2008-12-08 10:24:11 -01:00
2009-02-08 09:13:32 -01:00
debian-release)
2010-09-07 13:11:20 +00:00
eval VERSION = " $`echo RELEASE_ ${ LB_DISTRIBUTION } ` "
2010-12-05 12:27:08 -01:00
LB_ISO_VOLUME = " Debian ${ VERSION } ${ LB_ARCHITECTURES } live "
2009-02-08 09:13:32 -01:00
; ;
2008-12-08 10:24:11 -01:00
emdebian)
2010-09-07 13:11:20 +00:00
LB_ISO_VOLUME = " Emdebian ${ LB_DISTRIBUTION } \$(date +%Y%m%d-%H:%M) "
2008-12-08 10:24:11 -01:00
; ;
2009-04-15 20:07:26 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_ISO_VOLUME = " Ubuntu ${ LB_DISTRIBUTION } \$(date +%Y%m%d-%H:%M) "
2009-04-15 20:07:26 +00:00
; ;
2007-09-23 08:04:49 +00:00
esac
2007-09-23 08:04:46 +00:00
fi
2007-09-23 08:05:10 +00:00
# Setting memtest option
2010-09-07 13:11:20 +00:00
LB_MEMTEST = " ${ LB_MEMTEST :- memtest86 + } "
2007-09-23 08:04:46 +00:00
2008-08-14 19:33:56 +00:00
# Setting win32-loader option
2010-09-07 13:11:20 +00:00
if [ " ${ LB_MODE } " != "ubuntu" ]
2009-12-09 19:56:17 -01:00
then
2010-12-05 12:27:08 -01:00
case " ${ LB_ARCHITECTURES } " in
2009-12-09 19:56:17 -01:00
amd64| i386)
2010-09-07 13:11:20 +00:00
if [ " ${ LB_DEBIAN_INSTALLER } " != "false" ]
2009-12-09 19:56:17 -01:00
then
2010-09-07 13:11:20 +00:00
LB_WIN32_LOADER = " ${ LB_WIN32_LOADER :- true } "
2009-12-09 19:56:17 -01:00
else
2010-09-07 13:11:20 +00:00
LB_WIN32_LOADER = " ${ LB_WIN32_LOADER :- false } "
2009-12-09 19:56:17 -01:00
fi
; ;
2008-08-14 19:33:56 +00:00
2009-12-09 19:56:17 -01:00
*)
2010-09-07 13:11:20 +00:00
LB_WIN32_LOADER = " ${ LB_WIN32_LOADER :- false } "
2009-12-09 19:56:17 -01:00
; ;
esac
fi
2008-08-14 19:33:56 +00:00
2007-09-23 08:05:14 +00:00
# Setting netboot filesystem
2010-09-07 13:11:20 +00:00
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
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_NET_ROOT_PATH } " ]
2007-09-23 08:04:46 +00:00
then
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-02-08 09:10:07 -01:00
debian| debian-release)
2010-09-07 13:11:20 +00:00
LB_NET_ROOT_PATH = "/srv/debian-live"
2007-09-23 08:05:17 +00:00
; ;
2008-12-08 10:24:11 -01:00
emdebian)
2010-09-07 13:11:20 +00:00
LB_NET_ROOT_PATH = "/srv/emdebian-live"
2008-12-08 10:24:11 -01:00
; ;
2009-04-15 20:07:26 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_NET_ROOT_PATH = "/srv/ubuntu-live"
2009-04-15 20:07:26 +00:00
; ;
2007-09-23 08:04:49 +00:00
esac
2007-09-23 08:04:46 +00:00
fi
2007-09-23 08:05:10 +00:00
# Setting netboot server address
2010-09-07 13:11:20 +00:00
LB_NET_ROOT_SERVER = " ${ LB_NET_ROOT_SERVER :- 192 .168.1.1 } "
2007-10-30 17:17:16 -01:00
# Setting net cow filesystem
2010-09-07 13:11:20 +00:00
LB_NET_COW_FILESYSTEM = " ${ LB_NET_COW_FILESYSTEM :- nfs } "
2007-09-23 08:05:10 +00:00
2008-02-26 17:57:41 -01:00
# Setting net tarball
2010-09-07 13:11:20 +00:00
LB_NET_TARBALL = " ${ LB_NET_TARBALL :- gzip } "
2008-02-26 17:57:41 -01:00
2010-11-02 09:19:42 -01:00
# Setting syslinux theme package
LB_SYSLINUX_THEME = " ${ LB_SYSLINUX_THEME :- debian -squeeze } "
2007-09-19 00:42:09 +00:00
2007-09-23 08:05:10 +00:00
# Setting username
2010-09-07 13:11:20 +00:00
case " ${ LB_MODE } " in
2009-04-15 20:07:26 +00:00
ubuntu)
2010-09-07 13:11:20 +00:00
LB_USERNAME = " ${ LB_USERNAME :- ubuntu } "
2009-04-15 20:07:26 +00:00
; ;
*)
2010-09-07 13:11:20 +00:00
LB_USERNAME = " ${ LB_USERNAME :- user } "
2009-04-15 20:07:26 +00:00
; ;
esac
2007-09-23 08:05:10 +00:00
## config/source
2007-09-23 08:04:46 +00:00
# Setting source option
2010-09-07 13:11:20 +00:00
LB_SOURCE = " ${ LB_SOURCE :- false } "
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# Setting image type
2010-09-07 13:11:20 +00:00
LB_SOURCE_IMAGES = " ${ LB_SOURCE_IMAGES :- tar } "
2007-11-10 16:39:49 -01:00
# Setting fakeroot/fakechroot
2010-09-07 13:11:20 +00:00
LB_USE_FAKEROOT = " ${ LB_USE_FAKEROOT :- false } "
2007-09-23 08:04:46 +00:00
}
2007-11-11 12:14:25 -01:00
Check_defaults ( )
{
2010-09-07 13:11:20 +00:00
if [ " ${ LB_CONFIG_VERSION } " ]
2009-10-30 10:29:05 -01:00
then
# We're only checking when we're actually running the checks
# that's why the check for emptyness of the version;
2010-09-07 13:11:20 +00:00
# however, as live-build always declares LB_CONFIG_VERSION
2009-10-30 10:29:05 -01:00
# internally, this is safe assumption (no cases where it's unset,
# except when bootstrapping the functions/defaults etc.).
2010-09-07 13:11:20 +00:00
CURRENT_CONFIG_VERSION = " $( echo ${ LB_CONFIG_VERSION } | awk -F. '{ print $1 }' ) "
2009-10-30 10:29:05 -01:00
2010-09-26 14:14:06 +00:00
if [ ${ CURRENT_CONFIG_VERSION } -ge 4 ]
2009-10-30 10:29:05 -01:00
then
2010-09-02 11:22:22 +00:00
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-10-30 10:29:05 -01:00
2009-11-16 06:28:06 -01:00
exit 1
2010-09-26 14:14:06 +00:00
elif [ ${ CURRENT_CONFIG_VERSION } -eq 2 ]
2009-11-16 06:28:06 -01:00
then
2010-09-02 11:22:22 +00:00
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."
2009-10-30 10:29:05 -01:00
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."
2009-11-01 09:43:32 -01:00
Echo_warning "Continuing build, but it could lead to errors or different results. Please repopulate the config tree."
2009-10-30 10:29:05 -01:00
fi
fi
2010-11-23 10:31:15 -01:00
if echo ${ LB_PACKAGE_LISTS } | grep -qs -E "(stripped|minimal)\b"
2007-12-22 07:10:25 -01:00
then
2009-01-14 18:26:34 -01:00
# aptitude + stripped|minimal
2010-09-07 13:11:20 +00:00
if [ " ${ LB_APT } " = "aptitude" ]
2007-12-22 07:10:25 -01:00
then
2010-11-23 10:31:15 -01:00
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. "
2007-12-22 07:10:25 -01:00
fi
fi
2008-08-07 19:06:39 +00:00
2010-09-07 13:11:20 +00:00
if [ " ${ LB_DEBIAN_INSTALLER } " != "false" ]
2008-08-07 19:06:39 +00:00
then
2009-12-13 19:17:45 -01:00
# d-i true, no caching
2010-09-07 13:11:20 +00:00
if ! echo ${ LB_CACHE_STAGES } | grep -qs "bootstrap\b" || [ " ${ LB_CACHE } " != "true" ] || [ " ${ LB_CACHE_PACKAGES } " != "true" ]
2008-08-07 19:06:39 +00:00
then
2010-09-07 13:11:20 +00:00
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."
2008-08-07 19:06:39 +00:00
fi
fi
2008-09-07 14:41:36 +00:00
2010-09-07 13:11:20 +00:00
if [ " ${ LB_BOOTLOADER } " = "syslinux" ]
2008-09-07 14:41:36 +00:00
then
2009-01-14 18:26:34 -01:00
# syslinux + fat
2010-09-07 13:11:20 +00:00
case " ${ LB_BINARY_FILESYSTEM } " in
2008-09-07 14:41:36 +00:00
fat*)
; ;
*)
2010-09-07 13:11:20 +00:00
Echo_warning "You have selected values of LB_BOOTLOADER and LB_BINARY_FILESYSTEM which are incompatible - syslinux only supports FAT filesystems."
2008-09-07 14:41:36 +00:00
; ;
esac
fi
2009-01-14 18:30:21 -01:00
2010-09-07 13:11:20 +00:00
case " ${ LB_BINARY_IMAGES } " in
2010-02-18 15:12:59 -01:00
usb*)
# grub or yaboot + usb
2010-09-07 13:11:20 +00:00
case " ${ LB_BOOTLOADER } " in
2010-02-18 15:12:59 -01:00
grub| yaboot)
2010-09-02 11:22:22 +00:00
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."
2010-02-18 15:12:59 -01:00
exit 1
; ;
esac
; ;
esac
2009-02-18 17:21:49 -01:00
2010-09-07 13:11:20 +00:00
if [ " $( echo ${ LB_ISO_APPLICATION } | wc -c) " -gt 128 ]
2009-02-18 17:21:49 -01:00
then
2010-09-07 13:11:20 +00:00
Echo_warning "You have specified a value of LB_ISO_APPLICATION that is too long; the maximum length is 128 characters."
2009-02-18 17:21:49 -01:00
fi
2010-09-07 13:11:20 +00:00
if [ " $( echo ${ LB_ISO_PREPARER } | wc -c) " -gt 128 ]
2009-02-18 17:21:49 -01:00
then
2010-09-07 13:11:20 +00:00
Echo_warning "You have specified a value of LB_ISO_PREPARER that is too long; the maximum length is 128 characters."
2009-02-18 17:21:49 -01:00
fi
2010-09-07 13:11:20 +00:00
if [ " $( echo ${ LB_ISO_PUBLISHER } | wc -c) " -gt 128 ]
2009-02-18 17:21:49 -01:00
then
2010-09-07 13:11:20 +00:00
Echo_warning "You have specified a value of LB_ISO_PUBLISHER that is too long; the maximum length is 128 characters."
2009-02-18 17:21:49 -01:00
fi
2010-09-07 13:11:20 +00:00
if [ " $( eval " echo ${ LB_ISO_VOLUME } " | wc -c) " -gt 32 ]
2009-02-18 17:21:49 -01:00
then
2010-09-07 13:11:20 +00:00
Echo_warning "You have specified a value of LB_ISO_VOLUME that is too long; the maximum length is 32 characters."
2009-02-18 17:21:49 -01:00
fi
2009-05-09 21:36:30 +00:00
2010-11-23 10:31:15 -01:00
if echo ${ LB_PACKAGE_LISTS } | grep -qs -E "(stripped|minimal)\b"
2009-05-09 21:36:30 +00:00
then
2010-11-21 15:17:48 -01:00
if [ " ${ LB_APT_INDICES } " = "true" ]
2009-05-09 21:36:30 +00:00
then
2010-11-21 15:17:48 -01:00
Echo_warning "You have selected hook to minimise image size but you are still including package indices with your value of LB_APT_INDICES."
2009-05-09 21:36:30 +00:00
fi
fi
2007-11-11 12:14:25 -01:00
}