3 ## live-build(7) - System Build Scripts
4 ## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
6 ## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7 ## This is free software, and you are welcome to redistribute it
8 ## under certain conditions; see COPYING for details.
16 if [ -x "/usr/bin/dpkg" ]
18 CURRENT_IMAGE_ARCHITECTURE
="$(dpkg --print-architecture)"
22 CURRENT_IMAGE_ARCHITECTURE
="amd64"
26 CURRENT_IMAGE_ARCHITECTURE
="i386"
30 Echo_warning
"Unable to determine current architecture, using ${CURRENT_IMAGE_ARCHITECTURE}"
38 # Configuration-Version
39 LIVE_CONFIGURATION_VERSION
="${LIVE_CONFIGURATION_VERSION:-$(Get_configuration config/build Configuration-Version)}"
40 LIVE_CONFIGURATION_VERSION
="${LIVE_CONFIGURATION_VERSION:-${LIVE_BUILD_VERSION}}"
41 export LIVE_CONFIGURATION_VERSION
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
48 # Image: Architecture (FIXME: Support and default to 'any')
49 LB_ARCHITECTURES
="${LB_ARCHITECTURES:-$(Get_configuration config/build Architecture)}"
50 LB_ARCHITECTURES
="${LB_ARCHITECTURES:-${CURRENT_IMAGE_ARCHITECTURE}}"
51 export LB_ARCHITECTURES
53 # Image: Archive Areas
54 LB_ARCHIVE_AREAS
="${LB_ARCHIVE_AREAS:-$(Get_configuration config/build Archive-Areas)}"
58 LB_ARCHIVE_AREAS
="${LB_ARCHIVE_AREAS:-main contrib non-free}"
62 LB_ARCHIVE_AREAS
="${LB_ARCHIVE_AREAS:-main restricted}"
66 LB_ARCHIVE_AREAS
="${LB_ARCHIVE_AREAS:-main}"
70 export LB_ARCHIVE_AREAS
72 # Image: Archive Areas
73 LB_PARENT_ARCHIVE_AREAS
="${LB_PARENT_ARCHIVE_AREAS:-$(Get_configuration config/build Parent-Archive-Areas)}"
74 LB_PARENT_ARCHIVE_AREAS
="${LB_PARENT_ARCHIVE_AREAS:-${LB_ARCHIVE_AREAS}}"
75 export LB_PARENT_ARCHIVE_AREAS
78 LIVE_IMAGE_TYPE
="${LIVE_IMAGE_TYPE:-$(Get_configuration config/build Type)}"
79 LIVE_IMAGE_TYPE
="${LIVE_IMAGE_TYPE:-iso-hybrid}"
80 export LIVE_IMAGE_TYPE
90 if [ -e local
/live-build
]
92 LIVE_BUILD
="${LIVE_BUILD:-${PWD}/local/live-build}"
97 LB_SYSTEM
="${LB_SYSTEM:-live}"
99 # Setting mode (currently: debian, progress-linux, and ubuntu)
100 if [ -x /usr
/bin
/lsb_release
]
102 _DISTRIBUTOR
="$(lsb_release -is | tr "[A-Z
]" "[a-z
]")"
104 case "${_DISTRIBUTOR}" in
105 debian|progress-linux|ubuntu
)
106 LB_MODE
="${LB_MODE:-${_DISTRIBUTOR}}"
110 LB_MODE
="${LB_MODE:-debian}"
114 if [ -e /etc
/progress-linux_version
]
116 LB_MODE
="${LB_MODE:-progress-linux}"
117 elif [ -e /etc
/ubuntu_version
]
119 LB_MODE
="${LB_MODE:-ubuntu}"
121 LB_MODE
="${LB_MODE:-debian}"
125 # Setting distribution name
128 LB_DISTRIBUTION
="${LB_DISTRIBUTION:-cairon}"
130 LB_DERIVATIVE_IS_BASED_ON
="debian"
134 LB_DISTRIBUTION
="${LB_DISTRIBUTION:-quantal}"
135 LB_DERIVATIVE
="false"
139 LB_DISTRIBUTION
="${LB_DISTRIBUTION:-stretch}"
140 LB_DERIVATIVE
="false"
146 case "${LB_DISTRIBUTION}" in
147 baureo|baureo-backports
)
148 LB_PARENT_DISTRIBUTION
="${LB_PARENT_DISTRIBUTION:-wheezy}"
149 LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION
="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}"
152 cairon|cairon-backports
)
153 LB_PARENT_DISTRIBUTION
="${LB_PARENT_DISTRIBUTION:-sid}"
154 LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION
="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}"
158 LB_BACKPORTS
="${LB_BACKPORTS:-true}"
162 LB_PARENT_DISTRIBUTION
="${LB_PARENT_DISTRIBUTION:-${LB_DISTRIBUTION}}"
163 LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION
="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}"
165 LB_BACKPORTS
="${LB_BACKPORTS:-false}"
169 # Setting package manager
170 LB_APT
="${LB_APT:-apt}"
172 # Setting apt ftp proxy
173 LB_APT_FTP_PROXY
="${LB_APT_FTP_PROXY}"
175 # Setting apt http proxy
176 LB_APT_HTTP_PROXY
="${LB_APT_HTTP_PROXY}"
178 # Setting apt pipeline
181 APT_OPTIONS
="${APT_OPTIONS:---yes}"
182 APTITUDE_OPTIONS
="${APTITUDE_OPTIONS:---assume-yes}"
184 BZIP2_OPTIONS
="${BZIP2_OPTIONS:--6}"
186 GZIP_OPTIONS
="${GZIP_OPTIONS:--6}"
188 if gzip --help |
grep -qs "\-\-rsyncable"
190 GZIP_OPTIONS
="$(echo ${GZIP_OPTIONS} | sed -e 's|--rsyncable||') --rsyncable"
193 LZIP_OPTIONS
="${LZIP_OPTIONS:--6}"
195 LZMA_OPTIONS
="${LZMA_OPTIONS:--6}"
197 XZ_OPTIONS
="${XZ_OPTIONS:--6}"
199 # Setting apt recommends
202 LB_APT_RECOMMENDS
="${LB_APT_RECOMMENDS:-false}"
206 LB_APT_RECOMMENDS
="${LB_APT_RECOMMENDS:-true}"
211 LB_APT_SECURE
="${LB_APT_SECURE:-true}"
216 LB_APT_SOURCE_ARCHIVES
="${LB_APT_SOURCE_ARCHIVES:-false}"
220 LB_APT_SOURCE_ARCHIVES
="${LB_APT_SOURCE_ARCHIVES:-true}"
224 # Setting cache option
225 LB_CACHE
="${LB_CACHE:-true}"
226 LB_CACHE_INDICES
="${LB_CACHE_INDICES:-false}"
227 LB_CACHE_PACKAGES
="${LB_CACHE_PACKAGES:-true}"
228 LB_CACHE_STAGES
="${LB_CACHE_STAGES:-bootstrap}"
230 # Setting debconf frontend
231 LB_DEBCONF_FRONTEND
="${LB_DEBCONF_FRONTEND:-noninteractive}"
232 LB_DEBCONF_PRIORITY
="${LB_DEBCONF_PRIORITY:-critical}"
234 # Setting initramfs hook
235 case "${LB_SYSTEM}" in
237 LB_INITRAMFS
="${LB_INITRAMFS:-live-boot}"
241 LB_INITRAMFS
="${LB_INITRAMFS:-none}"
245 LB_INITRAMFS_COMPRESSION
="${LB_INITRAMFS_COMPRESSION:-gzip}"
250 case "${LB_INITRAMFS}" in
252 LB_INITSYSTEM
="${LB_INITSYSTEM:-upstart}"
258 case "${LB_DISTRIBUTION}" in
260 LB_INITSYSTEM
="${LB_INITSYSTEM:-systemd}"
264 LB_INITSYSTEM
="${LB_INITSYSTEM:-sysvinit}"
270 case "${LB_SYSTEM}" in
272 LB_INITSYSTEM
="${LB_INITSYSTEM:-systemd}"
276 LB_INITSYSTEM
="${LB_INITSYSTEM:-none}"
283 if [ -z "${LB_FDISK}" ] ||
[ ! -x "${LB_FDISK}" ]
285 # Workaround for gnu-fdisk divertion
286 # (gnu-fdisk is buggy, #445304).
287 if [ -x /sbin
/fdisk.distrib
]
289 LB_FDISK
="fdisk.distrib"
290 elif [ -x /sbin
/fdisk
]
294 Echo_error
"Can't process file /sbin/fdisk"
299 if [ -z "${LB_LOSETUP}" ] ||
[ "${LB_LOSETUP}" != "/sbin/losetup.orig" ]
301 # Workaround for loop-aes-utils divertion
302 # (loop-aes-utils' losetup lacks features).
303 if [ -x /sbin
/losetup.orig
]
305 LB_LOSETUP
="losetup.orig"
306 elif [ -x /sbin
/losetup
]
310 Echo_error
"Can't process file /sbin/losetup"
314 if [ "${LB_ARCHITECTURES}" = "i386" ] && [ "${CURRENT_IMAGE_ARCHITECTURE}" = "amd64" ]
316 # Use linux32 when building amd64 images on i386
323 LB_TASKSEL
="${LB_TASKSEL:-apt}"
325 # Setting root directory
328 LB_ROOT
="${LB_ROOT:-progress-linux}"
332 LB_ROOT
="${LB_ROOT:-${LB_MODE}-live}"
336 # Setting live build options
337 _BREAKPOINTS
="${_BREAKPOINTS:-false}"
338 _COLOR
="${_COLOR:-false}"
339 _DEBUG
="${_DEBUG:-false}"
340 _FORCE
="${_FORCE:-false}"
341 _QUIET
="${_QUIET:-false}"
342 _VERBOSE
="${_VERBOSE:-false}"
346 # Setting mirror to fetch packages from
349 LB_MIRROR_BOOTSTRAP
="${LB_MIRROR_BOOTSTRAP:-http://ftp.debian.org/debian/}"
350 LB_PARENT_MIRROR_BOOTSTRAP
="${LB_PARENT_MIRROR_BOOTSTRAP:-${LB_MIRROR_BOOTSTRAP}}"
354 LB_PARENT_MIRROR_BOOTSTRAP
="${LB_PARENT_MIRROR_BOOTSTRAP:-http://ftp.debian.org/debian/}"
355 LB_MIRROR_BOOTSTRAP
="${LB_MIRROR_BOOTSTRAP:-http://cdn.archive.progress-linux.org/packages/}"
359 case "${LB_ARCHITECTURES}" in
361 LB_MIRROR_BOOTSTRAP
="${LB_MIRROR_BOOTSTRAP:-http://archive.ubuntu.com/ubuntu/}"
365 LB_MIRROR_BOOTSTRAP
="${LB_MIRROR_BOOTSTRAP:-http://ports.ubuntu.com/ubuntu-ports/}"
369 LB_PARENT_MIRROR_BOOTSTRAP
="${LB_PARENT_MIRROR_BOOTSTRAP:-${LB_MIRROR_BOOTSTRAP}}"
373 LB_PARENT_MIRROR_CHROOT
="${LB_PARENT_MIRROR_CHROOT:-${LB_PARENT_MIRROR_BOOTSTRAP}}"
374 LB_MIRROR_CHROOT
="${LB_MIRROR_CHROOT:-${LB_MIRROR_BOOTSTRAP}}"
376 # Setting security mirror to fetch packages from
379 LB_MIRROR_CHROOT_SECURITY
="${LB_MIRROR_CHROOT_SECURITY:-http://security.debian.org/}"
380 LB_PARENT_MIRROR_CHROOT_SECURITY
="${LB_PARENT_MIRROR_CHROOT_SECURITY:-${LB_MIRROR_CHROOT_SECURITY}}"
384 LB_PARENT_MIRROR_CHROOT_SECURITY
="${LB_PARENT_MIRROR_CHROOT_SECURITY:-http://security.debian.org/}"
385 LB_MIRROR_CHROOT_SECURITY
="${LB_MIRROR_CHROOT_SECURITY:-${LB_MIRROR_CHROOT}}"
389 case "${LB_ARCHITECTURES}" in
391 LB_MIRROR_CHROOT_SECURITY
="${LB_MIRROR_CHROOT_SECURITY:-http://security.ubuntu.com/ubuntu/}"
395 LB_MIRROR_CHROOT_SECURITY
="${LB_MIRROR_CHROOT_SECURITY:-http://ports.ubuntu.com/ubuntu-ports/}"
399 LB_PARENT_MIRROR_CHROOT_SECURITY
="${LB_PARENT_MIRROR_CHROOT_SECURITY:-${LB_MIRROR_CHROOT_SECURITY}}"
403 # Setting mirror which ends up in the image
406 LB_MIRROR_BINARY
="${LB_MIRROR_BINARY:-http://http.debian.net/debian/}"
407 LB_PARENT_MIRROR_BINARY
="${LB_PARENT_MIRROR_BINARY:-${LB_MIRROR_BINARY}}"
411 LB_PARENT_MIRROR_BINARY
="${LB_PARENT_MIRROR_BINARY:-http://ftp.debian.org/debian/}"
412 LB_MIRROR_BINARY
="${LB_MIRROR_BINARY:-${LB_MIRROR_CHROOT}}"
416 case "${LB_ARCHITECTURES}" in
418 LB_MIRROR_BINARY
="${LB_MIRROR_BINARY:-http://archive.ubuntu.com/ubuntu/}"
422 LB_MIRROR_BINARY
="${LB_MIRROR_BINARY:-http://ports.ubuntu.com/ubuntu-ports/}"
426 LB_PARENT_MIRROR_BINARY
="${LB_PARENT_MIRROR_BINARY:-${LB_MIRROR_BINARY}}"
430 # Setting security mirror which ends up in the image
433 LB_MIRROR_BINARY_SECURITY
="${LB_MIRROR_BINARY_SECURITY:-http://security.debian.org/}"
434 LB_PARENT_MIRROR_BINARY_SECURITY
="${LB_PARENT_MIRROR_BINARY_SECURITY:-${LB_MIRROR_BINARY_SECURITY}}"
438 LB_PARENT_MIRROR_BINARY_SECURITY
="${LB_PARENT_MIRROR_BINARY_SECURITY:-http://security.debian.org/}"
439 LB_MIRROR_BINARY_SECURITY
="${LB_MIRROR_BINARY_SECURITY:-${LB_MIRROR_CHROOT}}"
443 case "${LB_ARCHITECTURES}" in
445 LB_MIRROR_BINARY_SECURITY
="${LB_MIRROR_BINARY_SECURITY:-http://security.ubuntu.com/ubuntu/}"
449 LB_MIRROR_BINARY_SECURITY
="${LB_MIRROR_BINARY_SECURITY:-http://ports.ubuntu.com/ubuntu-ports/}"
453 LB_PARENT_MIRROR_BINARY_SECURITY
="${LB_PARENT_MIRROR_BINARY_SECURITY:-${LB_MIRROR_BINARY_SECURITY}}"
459 LB_PARENT_MIRROR_DEBIAN_INSTALLER
="${LB_PARENT_MIRROR_DEBIAN_INSTALLER:-${LB_MIRROR_CHROOT}}"
460 LB_MIRROR_DEBIAN_INSTALLER
="${LB_MIRROR_DEBIAN_INSTALLER:-${LB_MIRROR_CHROOT}}"
464 LB_MIRROR_DEBIAN_INSTALLER
="${LB_MIRROR_DEBIAN_INSTALLER:-${LB_MIRROR_CHROOT}}"
465 LB_PARENT_MIRROR_DEBIAN_INSTALLER
="${LB_PARENT_MIRROR_DEBIAN_INSTALLER:-${LB_PARENT_MIRROR_CHROOT}}"
471 # Setting chroot filesystem
472 LB_CHROOT_FILESYSTEM
="${LB_CHROOT_FILESYSTEM:-squashfs}"
474 # Setting union filesystem
475 LB_UNION_FILESYSTEM
="${LB_UNION_FILESYSTEM:-aufs}"
477 # Setting interactive shell/X11/Xnest
478 LB_INTERACTIVE
="${LB_INTERACTIVE:-false}"
480 # Setting keyring packages
483 LB_KEYRING_PACKAGES
="${LB_KEYRING_PACKAGES:-ubuntu-keyring}"
487 LB_KEYRING_PACKAGES
="${LB_KEYRING_PACKAGES:-debian-archive-keyring}"
491 # Setting linux flavour string
492 case "${LB_ARCHITECTURES}" in
496 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-generic}"
500 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-arm64}"
508 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-omap}"
511 # armel will have special images: one rootfs image and many additional kernel images.
512 # therefore we default to all available armel flavours
513 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-ixp4xx kirkwood orion5x versatile}"
521 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-generic}"
525 # armhf will have special images: one rootfs image and many additional kernel images.
526 # therefore we default to all available armhf flavours
527 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-armmp armmp-lpae}"
535 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-generic}"
539 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-amd64}"
547 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-686-pae}"
551 case "${LB_DISTRIBUTION}" in
553 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-generic-pae}"
557 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-generic}"
563 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-586}"
571 Echo_error
"Architecture ${LB_ARCHITECTURES} not supported in the ${LB_MODE} mode."
576 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-itanium}"
584 Echo_error
"Architecture ${LB_ARCHITECTURES} not supported in the ${LB_MODE} mode."
589 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-powerpc-smp powerpc64-smp e500 powerpc-e500mc}"
593 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-powerpc64 powerpc}"
600 progress-linux|ubuntu
)
601 Echo_error
"Architecture ${LB_ARCHITECTURES} not supported in the ${LB_MODE} mode."
606 LB_LINUX_FLAVOURS
="${LB_LINUX_FLAVOURS:-s390x}"
612 Echo_error
"Architecture(s) ${LB_ARCHITECTURES} not yet supported (FIXME)"
620 LB_LINUX_PACKAGES
="${LB_LINUX_PACKAGES:-linux}"
624 LB_LINUX_PACKAGES
="${LB_LINUX_PACKAGES:-linux-image}"
628 # Setting security updates option
629 case "${LB_PARENT_DISTRIBUTION}" in
631 LB_SECURITY
="${LB_SECURITY:-false}"
635 LB_SECURITY
="${LB_SECURITY:-true}"
639 # Setting updates updates option
640 case "${LB_PARENT_DISTRIBUTION}" in
642 LB_UPDATES
="${LB_UPDATES:-false}"
646 LB_UPDATES
="${LB_UPDATES:-true}"
652 # Setting image filesystem
653 LB_BINARY_FILESYSTEM
="${LB_BINARY_FILESYSTEM:-fat32}"
656 case "${LB_ARCHITECTURES}" in
658 LIVE_IMAGE_TYPE
="${LIVE_IMAGE_TYPE:-iso-hybrid}"
662 LIVE_IMAGE_TYPE
="${LIVE_IMAGE_TYPE:-iso}"
666 # Setting apt indices
669 LB_APT_INDICES
="${LB_APT_INDICES:-false}"
673 LB_APT_INDICES
="${LB_APT_INDICES:-true}"
678 if [ -z "${LB_BOOTLOADER}" ]
680 case "${LB_ARCHITECTURES}" in
682 LB_BOOTLOADER
="syslinux"
690 LB_CHECKSUMS
="${LB_CHECKSUMS:-sha256}"
694 LB_CHECKSUMS
="${LB_CHECKSUMS:-md5}"
698 # Setting compression
699 LB_COMPRESSION
="${LB_COMPRESSION:-none}"
702 LB_ZSYNC
="${LB_ZSYNC:-true}"
704 # Setting chroot option
705 LB_BUILD_WITH_CHROOT
="${LB_BUILD_WITH_CHROOT:-true}"
707 LB_BUILD_WITH_TMPFS
="${LB_BUILD_WITH_TMPFS:-false}"
709 # Setting debian-installer option
710 LB_DEBIAN_INSTALLER
="${LB_DEBIAN_INSTALLER:-false}"
712 LB_DEBIAN_INSTALLER_DISTRIBUTION
="${LB_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_DISTRIBUTION}}"
714 # Setting debian-installer-gui
716 debian|progress-linux
)
717 LB_DEBIAN_INSTALLER_GUI
="${LB_DEBIAN_INSTALLER_GUI:-true}"
721 LB_DEBIAN_INSTALLER_GUI
="${LB_DEBIAN_INSTALLER_GUI:-false}"
725 # Setting debian-installer preseed filename
726 if [ -z "${LB_DEBIAN_INSTALLER_PRESEEDFILE}" ]
728 if Find_files config
/debian-installer
/preseed.cfg
730 LB_DEBIAN_INSTALLER_PRESEEDFILE
="/preseed.cfg"
733 if Find_files config
/debian-installer
/*.cfg
&& [ ! -e config
/debian-installer
/preseed.cfg
]
735 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."
739 # Setting boot parameters
740 case "${LB_INITRAMFS}" in
742 LB_BOOTAPPEND_LIVE
="${LB_BOOTAPPEND_LIVE:-boot=live components quiet splash}"
743 LB_BOOTAPPEND_LIVE_FAILSAFE
="${LB_BOOTAPPEND_LIVE_FAILSAFE:-boot=live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal}"
747 LB_BOOTAPPEND_LIVE
="${LB_BOOTAPPEND_LIVE:-quiet splash}"
748 LB_BOOTAPPEND_LIVE_FAILSAFE
="${LB_BOOTAPPEND_LIVE_FAILSAFE:-memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal}"
752 if [ -n "${LB_DEBIAN_INSTALLER_PRESEEDFILE}" ]
754 case "${LIVE_IMAGE_TYPE}" in
756 _LB_BOOTAPPEND_PRESEED
="file=/cdrom/install/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
762 if [ "${LB_DEBIAN_INSTALLER}" = "live" ]
764 _LB_BOOTAPPEND_PRESEED
="file=/cdrom/install/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
766 _LB_BOOTAPPEND_PRESEED
="file=/hd-media/install/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
771 _LB_BOOTAPPEND_PRESEED
="file=/hd-media/install/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
777 case "${LB_DEBIAN_INSTALLER_PRESEEDFILE}" in
779 _LB_BOOTAPPEND_PRESEED
="file=${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
783 _LB_BOOTAPPEND_PRESEED
="file=/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
790 if [ -n ${_LB_BOOTAPPEND_PRESEED} ]
792 LB_BOOTAPPEND_INSTALL
="${LB_BOOTAPPEND_INSTALL} ${_LB_BOOTAPPEND_PRESEED}"
795 LB_BOOTAPPEND_INSTALL
="$(echo ${LB_BOOTAPPEND_INSTALL} | sed -e 's/[ \t]*$//')"
797 # Setting grub splash
803 LB_ISO_APPLICATION
="${LB_ISO_APPLICATION:-Debian Live}"
807 LB_ISO_APPLICATION
="${LB_ISO_APPLICATION:-Progress Linux}"
811 LB_ISO_APPLICATION
="${LB_ISO_APPLICATION:-Ubuntu Live}"
816 LB_ISO_PREPARER
="${LB_ISO_PREPARER:-live-build \$VERSION; http://live-systems.org/devel/live-build}"
821 LB_ISO_PUBLISHER
="${LB_ISO_PUBLISHER:-Progress Linux; http://www.progress-linux.org/; progress-project@lists.progress-linux.org}"
825 LB_ISO_PUBLISHER
="${LB_ISO_PUBLISHER:-Live Systems project; http://live-systems.org/; debian-live@lists.debian.org}"
829 # Setting hdd options
832 LB_HDD_LABEL
="${LB_HDD_LABEL:-DEBIAN_LIVE}"
836 LB_HDD_LABEL
="${LB_HDD_LABEL:-PROGRESS_$(echo ${LB_DISTRIBUTION} | tr "[a-z]" "[A-Z]")}"
840 LB_HDD_LABEL
="${LB_HDD_LABEL:-UBUNTU}"
845 LB_HDD_SIZE
="${LB_HDD_SIZE:-auto}"
850 LB_ISO_VOLUME
="${LB_ISO_VOLUME:-Debian ${LB_DISTRIBUTION} \$(date +%Y%m%d-%H:%M)}"
854 LB_ISO_VOLUME
="${LB_ISO_VOLUME:-Progress ${LB_DISTRIBUTION}}"
858 LB_ISO_VOLUME
="${LB_ISO_VOLUME:-Ubuntu ${LB_DISTRIBUTION} \$(date +%Y%m%d-%H:%M)}"
862 # Setting memtest option
863 LB_MEMTEST
="${LB_MEMTEST:-none}"
865 # Setting loadlin option
867 progress-linux|ubuntu
)
872 case "${LB_ARCHITECTURES}" in
874 if [ "${LB_DEBIAN_INSTALLER}" != "false" ]
876 LB_LOADLIN
="${LB_LOADLIN:-true}"
878 LB_LOADLIN
="${LB_LOADLIN:-false}"
883 LB_LOADLIN
="${LB_LOADLIN:-false}"
889 # Setting win32-loader option
891 progress-linux|ubuntu
)
896 case "${LB_ARCHITECTURES}" in
898 if [ "${LB_DEBIAN_INSTALLER}" != "false" ]
900 LB_WIN32_LOADER
="${LB_WIN32_LOADER:-true}"
902 LB_WIN32_LOADER
="${LB_WIN32_LOADER:-false}"
907 LB_WIN32_LOADER
="${LB_WIN32_LOADER:-false}"
913 # Setting netboot filesystem
914 LB_NET_ROOT_FILESYSTEM
="${LB_NET_ROOT_FILESYSTEM:-nfs}"
916 # Setting netboot server path
919 LB_NET_ROOT_PATH
="${LB_NET_ROOT_PATH:-/srv/progress-linux}"
923 LB_NET_ROOT_PATH
="${LB_NET_ROOT_PATH:-/srv/${LB_MODE}-live}"
927 # Setting netboot server address
928 LB_NET_ROOT_SERVER
="${LB_NET_ROOT_SERVER:-192.168.1.1}"
930 # Setting net cow filesystem
931 LB_NET_COW_FILESYSTEM
="${LB_NET_COW_FILESYSTEM:-nfs}"
933 # Setting net tarball
934 LB_NET_TARBALL
="${LB_NET_TARBALL:-true}"
936 # Setting firmware option
939 LB_FIRMWARE_CHROOT
="${LB_FIRMWARE_CHROOT:-false}"
940 LB_FIRMWARE_BINARY
="${LB_FIRMWARE_BINARY:-false}"
944 LB_FIRMWARE_CHROOT
="${LB_FIRMWARE_CHROOT:-true}"
945 LB_FIRMWARE_BINARY
="${LB_FIRMWARE_BINARY:-true}"
950 LB_SWAP_FILE_SIZE
="${LB_SWAP_FILE_SIZE:-512}"
954 # Setting source option
955 LB_SOURCE
="${LB_SOURCE:-false}"
958 LB_SOURCE_IMAGES
="${LB_SOURCE_IMAGES:-tar}"
963 if [ -n "${LIVE_BUILD_VERSION}" ]
965 # We're only checking when we're actually running the checks
966 # that's why the check for emptyness of the version;
967 # however, as live-build always declares LIVE_BUILD_VERSION
968 # internally, this is safe assumption (no cases where it's unset,
969 # except when bootstrapping the functions/defaults etc.).
971 CURRENT_CONFIGURATION_VERSION
="$(echo ${LIVE_CONFIGURATION_VERSION} | awk -F. ' { print $1 }')"
973 if [ -n "${CURRENT_CONFIGURATION_VERSION}" ]
975 CORRECT_VERSION
="$(echo ${LIVE_BUILD_VERSION} | awk -F. '{ print $1 }')"
976 TOO_NEW_VERSION
="$((${CORRECT_VERSION} + 1))"
977 TOO_OLD_VERSION
="$((${CORRECT_VERSION} - 1))"
979 if [ ${CURRENT_CONFIGURATION_VERSION} -ne ${CORRECT_VERSION} ]
981 if [ ${CURRENT_CONFIGURATION_VERSION} -ge ${TOO_NEW_VERSION} ]
983 Echo_error
"This config tree is too new for live-build (${VERSION})."
984 Echo_error
"Aborting build, please update live-build."
987 elif [ ${CURRENT_CONFIGURATION_VERSION} -le ${TOO_OLD_VERSION} ]
989 Echo_error
"This config tree is too old for live-build (${VERSION})."
990 Echo_error
"Aborting build, please update the configuration."
994 Echo_warning
"This configuration does not specify a version or has a unknown version."
995 Echo_warning
"Continuing build, please correct the configuration."
1001 case "${LB_BINARY_FILESYSTEM}" in
1003 if [ ! -x "$(which ntfs-3g 2>/dev/null)" ]
1005 Echo_error
"Using ntfs as the binary filesystem is currently only supported"
1006 Echo_error
"if ntfs-3g is installed on the host system."
1013 if echo ${LB_HDD_LABEL} |
grep -qs ' '
1015 Echo_error
"There are currently no whitespaces supported in hdd labels."
1020 if [ "${LB_DEBIAN_INSTALLER}" != "false" ]
1022 # d-i true, no caching
1023 if ! echo ${LB_CACHE_STAGES} | grep -qs "bootstrap\b" || [ "${LB_CACHE}" != "true" ] || [ "${LB_CACHE_PACKAGES}" != "true
" ]
1025 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.
"
1029 if [ "${LB_BOOTLOADER}" = "syslinux
" ]
1031 # syslinux + fat or ntfs, or extlinux + ext[234] or btrfs
1032 case "${LB_BINARY_FILESYSTEM}" in
1033 fat*|ntfs|ext[234]|btrfs)
1036 Echo_warning "You have selected values of LB_BOOTLOADER and LB_BINARY_FILESYSTEM
which are incompatible
- the syslinux family only support FAT
, NTFS
, ext
[234] or btrfs filesystems.
"
1041 case "${LIVE_IMAGE_TYPE}" in
1043 case "${LB_BOOTLOADER}" in
1045 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.
"
1052 if [ "$
(echo \"${LB_ISO_APPLICATION}\" |
wc -c)" -gt 128 ]
1054 Echo_warning "You have specified a value of LB_ISO_APPLICATION that is too long
; the maximum length is
128 characters.
"
1057 if [ "$
(echo \"${LB_ISO_PREPARER}\" |
wc -c)" -gt 128 ]
1059 Echo_warning "You have specified a value of LB_ISO_PREPARER that is too long
; the maximum length is
128 characters.
"
1062 if [ "$
(echo \"${LB_ISO_PUBLISHER}\" |
wc -c)" -gt 128 ]
1064 Echo_warning "You have specified a value of LB_ISO_PUBLISHER that is too long
; the maximum length is
128 characters.
"
1067 if [ "$
(eval "echo \"${LB_ISO_VOLUME}\"" |
wc -c)" -gt 32 ]
1069 Echo_warning "You have specified a value of LB_ISO_VOLUME that is too long
; the maximum length is
32 characters.
"
1072 # Architectures to use foreign bootstrap for
1073 LB_BOOTSTRAP_QEMU_ARCHITECTURES="${LB_BOOTSTRAP_QEMU_ARCHITECTURES:-}"
1075 # Packages to exclude for the foreign/ports bootstrapping
1076 LB_BOOTSTRAP_QEMU_EXCLUDE="${LB_BOOTSTRAP_QEMU_EXCLUDE:-}"
1078 # Ports using foreign bootstrap need a working qemu-*-system. This is the location it
1079 LB_BOOTSTRAP_QEMU_STATIC="${LB_BOOTSTRAP_QEMU_STATIC:-}"