2007-09-23 08:04:46 +00:00
#!/bin/sh
2010-09-02 11:12:37 +00:00
## live-build(7) - System Build Scripts
2020-03-11 09:07:21 -01:00
## Copyright (C) 2016-2020 The Debian Live team
2015-01-04 18:05:39 -01:00
## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
2010-09-02 11:12:37 +00:00
##
2012-07-29 23:59:00 +00:00
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
2010-09-02 11:12:37 +00:00
## 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
2012-12-19 09:21:28 -01:00
New_configuration ( )
{
2012-12-19 10:04:36 -01:00
## Runtime
2012-12-19 09:21:28 -01:00
2020-03-12 11:32:06 -01:00
if [ $( which dpkg) ]
2012-12-19 09:21:28 -01:00
then
2012-12-19 10:04:36 -01:00
CURRENT_IMAGE_ARCHITECTURE = " $( dpkg --print-architecture) "
else
case " $( uname -m) " in
x86_64)
CURRENT_IMAGE_ARCHITECTURE = "amd64"
; ;
2012-12-19 09:21:28 -01:00
2012-12-19 10:04:36 -01:00
i?86)
CURRENT_IMAGE_ARCHITECTURE = "i386"
; ;
*)
Echo_warning " Unable to determine current architecture, using ${ CURRENT_IMAGE_ARCHITECTURE } "
; ;
esac
fi
2012-12-19 10:07:10 -01:00
## Configuration
2013-04-06 08:46:04 +00:00
LIVE_CONFIGURATION_VERSION = " ${ LIVE_CONFIGURATION_VERSION :- $( Get_configuration config/build Configuration-Version) } "
2012-12-19 10:07:10 -01:00
LIVE_CONFIGURATION_VERSION = " ${ LIVE_CONFIGURATION_VERSION :- ${ LIVE_BUILD_VERSION } } "
export LIVE_CONFIGURATION_VERSION
2013-04-06 08:46:04 +00:00
LIVE_IMAGE_NAME = " ${ LIVE_IMAGE_NAME :- $( Get_configuration config/build Name) } "
2012-12-19 11:03:52 -01:00
LIVE_IMAGE_NAME = " ${ LIVE_IMAGE_NAME :- live -image } "
2012-12-19 10:21:09 -01:00
export LIVE_IMAGE_NAME
2012-12-19 10:07:10 -01:00
2020-03-28 08:49:19 -01:00
# (FIXME: Support and default to 'any')
2014-12-10 05:39:58 -01:00
LB_ARCHITECTURES = " ${ LB_ARCHITECTURES :- $( Get_configuration config/build Architecture) } "
LB_ARCHITECTURES = " ${ LB_ARCHITECTURES :- ${ CURRENT_IMAGE_ARCHITECTURE } } "
export LB_ARCHITECTURES
2012-12-19 10:07:10 -01:00
2014-12-10 05:41:29 -01:00
LB_ARCHIVE_AREAS = " ${ LB_ARCHIVE_AREAS :- $( Get_configuration config/build Archive-Areas) } "
2020-03-18 23:19:26 -01:00
LB_ARCHIVE_AREAS = " ${ LB_ARCHIVE_AREAS :- main } "
2020-03-28 02:36:55 -01:00
LB_ARCHIVE_AREAS = " $( echo " ${ LB_ARCHIVE_AREAS } " | tr "," " " ) "
2014-12-10 05:41:29 -01:00
export LB_ARCHIVE_AREAS
2012-12-19 19:41:25 -01:00
2014-12-10 07:19:07 -01:00
LB_PARENT_ARCHIVE_AREAS = " ${ LB_PARENT_ARCHIVE_AREAS :- $( Get_configuration config/build Parent-Archive-Areas) } "
LB_PARENT_ARCHIVE_AREAS = " ${ LB_PARENT_ARCHIVE_AREAS :- ${ LB_ARCHIVE_AREAS } } "
2020-03-28 02:36:55 -01:00
LB_PARENT_ARCHIVE_AREAS = " $( echo " ${ LB_PARENT_ARCHIVE_AREAS } " | tr "," " " ) "
2014-12-10 07:19:07 -01:00
export LB_PARENT_ARCHIVE_AREAS
2012-12-19 19:48:49 -01:00
2013-04-06 08:46:04 +00:00
LIVE_IMAGE_TYPE = " ${ LIVE_IMAGE_TYPE :- $( Get_configuration config/build Type) } "
2012-12-19 10:07:10 -01:00
LIVE_IMAGE_TYPE = " ${ LIVE_IMAGE_TYPE :- iso -hybrid } "
export LIVE_IMAGE_TYPE
2012-12-19 09:21:28 -01:00
}
2020-03-28 04:42:34 -01:00
# Prepare config for use, filling in defaults where no value provided for instance
Prepare_config ( )
2007-09-23 08:04:46 +00:00
{
2012-12-19 09:21:28 -01:00
# FIXME
New_configuration
2020-03-28 09:06:50 -01:00
# Colouring is re-evaluated here just incase a hard coded override was given in the saved config
case " ${ _COLOR } " in
true )
_COLOR_OUT = "true"
_COLOR_ERR = "true"
; ;
false )
_COLOR_OUT = "false"
_COLOR_ERR = "false"
; ;
auto)
; ;
esac
_BREAKPOINTS = " ${ _BREAKPOINTS :- false } "
_DEBUG = " ${ _DEBUG :- false } "
_FORCE = " ${ _FORCE :- false } "
_QUIET = " ${ _QUIET :- false } "
_VERBOSE = " ${ _VERBOSE :- false } "
2011-10-13 17:50:48 +00:00
LB_SYSTEM = " ${ LB_SYSTEM :- live } "
2011-09-29 22:56:49 +00:00
2020-03-12 11:32:06 -01:00
if [ $( which lsb_release) ]
2012-01-23 11:42:47 -01:00
then
2020-02-20 05:58:11 -01:00
local _DISTRIBUTOR
2013-03-22 12:06:30 -01:00
_DISTRIBUTOR = " $( lsb_release -is | tr "[A-Z]" "[a-z]" ) "
2012-01-23 11:42:47 -01:00
case " ${ _DISTRIBUTOR } " in
2020-03-18 23:19:26 -01:00
debian)
2012-01-23 11:42:47 -01:00
LB_MODE = " ${ LB_MODE :- ${ _DISTRIBUTOR } } "
; ;
*)
LB_MODE = " ${ LB_MODE :- debian } "
; ;
esac
else
2020-03-18 23:19:26 -01:00
LB_MODE = " ${ LB_MODE :- debian } "
2012-01-23 11:42:47 -01:00
fi
2007-09-23 08:04:49 +00:00
2020-03-18 23:19:26 -01:00
LB_DERIVATIVE = "false"
LB_DISTRIBUTION = " ${ LB_DISTRIBUTION :- buster } "
2019-12-19 16:18:44 -01:00
LB_DISTRIBUTION_CHROOT = " ${ LB_DISTRIBUTION_CHROOT :- ${ LB_DISTRIBUTION } } "
LB_DISTRIBUTION_BINARY = " ${ LB_DISTRIBUTION_BINARY :- ${ LB_DISTRIBUTION_CHROOT } } "
2020-03-18 23:19:26 -01:00
LB_BACKPORTS = " ${ LB_BACKPORTS :- false } "
2019-12-19 16:18:44 -01:00
if [ -n " $LB_PARENT_DISTRIBUTION " ] ; then
LB_PARENT_DISTRIBUTION_CHROOT = " ${ LB_PARENT_DISTRIBUTION_CHROOT :- ${ LB_PARENT_DISTRIBUTION } } "
LB_PARENT_DISTRIBUTION_BINARY = " ${ LB_PARENT_DISTRIBUTION_BINARY :- ${ LB_PARENT_DISTRIBUTION } } "
else
LB_PARENT_DISTRIBUTION_CHROOT = " ${ LB_PARENT_DISTRIBUTION_CHROOT :- ${ LB_DISTRIBUTION_CHROOT } } "
LB_PARENT_DISTRIBUTION_BINARY = " ${ LB_PARENT_DISTRIBUTION_BINARY :- ${ LB_DISTRIBUTION_BINARY } } "
fi
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION = " ${ LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION :- ${ LB_PARENT_DISTRIBUTION_CHROOT } } "
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
LB_APT = " ${ LB_APT :- apt } "
2012-05-31 11:12:13 +00:00
LB_APT_FTP_PROXY = " ${ LB_APT_FTP_PROXY } "
LB_APT_HTTP_PROXY = " ${ LB_APT_HTTP_PROXY } "
2020-03-28 09:06:50 -01:00
LB_APT_RECOMMENDS = " ${ LB_APT_RECOMMENDS :- true } "
LB_APT_SECURE = " ${ LB_APT_SECURE :- true } "
LB_APT_SOURCE_ARCHIVES = " ${ LB_APT_SOURCE_ARCHIVES :- true } "
LB_APT_INDICES = " ${ LB_APT_INDICES :- true } "
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 } "
2020-03-28 09:06:50 -01:00
# Apt v2.0.1 introduced color support, but it needs to be explicitly enabled
if [ " ${ _COLOR_OUT } " = "true" ] && [ " ${ _COLOR_ERR } " = "true" ] ; then
APT_OPTIONS = " ${ APT_OPTIONS } -o APT::Color=true "
APTITUDE_OPTIONS = " ${ APTITUDE_OPTIONS } -o APT::Color=true "
else
APT_OPTIONS = " ${ APT_OPTIONS } -o APT::Color=false "
APTITUDE_OPTIONS = " ${ APTITUDE_OPTIONS } -o APT::Color=false "
fi
LB_TASKSEL = " ${ LB_TASKSEL :- apt } "
2011-07-21 15:48:17 +00:00
BZIP2_OPTIONS = " ${ BZIP2_OPTIONS :- -6 } "
GZIP_OPTIONS = " ${ GZIP_OPTIONS :- -6 } "
2020-03-28 09:06:50 -01:00
LZIP_OPTIONS = " ${ LZIP_OPTIONS :- -6 } "
LZMA_OPTIONS = " ${ LZMA_OPTIONS :- -6 } "
XZ_OPTIONS = " ${ XZ_OPTIONS :- -6 } "
2009-09-11 07:39:13 +00:00
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
2010-09-07 13:11:20 +00:00
LB_CACHE = " ${ LB_CACHE :- true } "
2015-01-07 20:42:39 -01:00
if [ " ${ LB_CACHE } " = "false" ]
then
LB_CACHE_INDICES = "false"
LB_CACHE_PACKAGES = "false"
LB_CACHE_STAGES = "bootstrap" #bootstrap caching currently required for process to work
else
LB_CACHE_INDICES = " ${ LB_CACHE_INDICES :- false } "
LB_CACHE_PACKAGES = " ${ LB_CACHE_PACKAGES :- true } "
LB_CACHE_STAGES = " ${ LB_CACHE_STAGES :- bootstrap } "
fi
2020-03-28 02:31:15 -01:00
LB_CACHE_STAGES = " $( echo " ${ LB_CACHE_STAGES } " | tr "," " " ) "
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
LB_DEBCONF_FRONTEND = " ${ LB_DEBCONF_FRONTEND :- noninteractive } "
LB_DEBCONF_PRIORITY = " ${ LB_DEBCONF_PRIORITY :- critical } "
2007-09-23 08:04:50 +00:00
2012-10-08 18:00:41 +00:00
case " ${ LB_SYSTEM } " in
live)
2015-05-03 13:49:57 +00:00
LB_INITRAMFS = " ${ LB_INITRAMFS :- live -boot } "
2010-12-27 16:12:36 -01:00
; ;
2012-10-08 18:00:41 +00:00
normal)
LB_INITRAMFS = " ${ LB_INITRAMFS :- none } "
2010-12-27 16:12:36 -01:00
; ;
esac
2007-09-23 08:05:10 +00:00
2011-06-13 18:38:44 +00:00
LB_INITRAMFS_COMPRESSION = " ${ LB_INITRAMFS_COMPRESSION :- gzip } "
2020-03-18 23:19:26 -01:00
case " ${ LB_SYSTEM } " in
live)
LB_INITSYSTEM = " ${ LB_INITSYSTEM :- systemd } "
2012-10-28 09:42:57 -01:00
; ;
2020-03-18 23:19:26 -01:00
normal)
LB_INITSYSTEM = " ${ LB_INITSYSTEM :- none } "
2011-02-14 14:04:16 -01:00
; ;
2011-02-10 21:31:21 -01:00
esac
2011-02-09 09:37:21 -01:00
2014-12-10 05:39:58 -01:00
if [ " ${ LB_ARCHITECTURES } " = "i386" ] && [ " ${ CURRENT_IMAGE_ARCHITECTURE } " = "amd64" ]
2011-07-20 06:54:54 +00:00
then
2012-12-19 10:04:36 -01:00
# Use linux32 when building amd64 images on i386
2011-07-20 16:10:39 +00:00
_LINUX32 = "linux32"
else
_LINUX32 = ""
2011-07-20 06:54:54 +00:00
fi
2020-03-28 08:49:19 -01:00
# Mirrors:
2020-03-19 00:37:59 -01:00
# *_MIRROR_CHROOT: to fetch packages from
# *_MIRROR_BOOTSTRAP: to fetch packages from
# *_MIRROR_CHROOT_SECURITY: security mirror to fetch packages from
# *_MIRROR_BINARY: mirror which ends up in the image
# *_MIRROR_BINARY_SECURITY: security mirror which ends up in the image
# *_MIRROR_DEBIAN_INSTALLER: to fetch installer from
2011-02-14 11:48:45 -01:00
LB_MIRROR_CHROOT = " ${ LB_MIRROR_CHROOT :- ${ LB_MIRROR_BOOTSTRAP } } "
2020-03-19 00:37:59 -01:00
LB_PARENT_MIRROR_CHROOT = " ${ LB_PARENT_MIRROR_CHROOT :- ${ LB_PARENT_MIRROR_BOOTSTRAP } } "
if [ " ${ LB_MODE } " = "debian" ] ; then
LB_MIRROR_BOOTSTRAP = " ${ LB_MIRROR_BOOTSTRAP :- http : //deb.debian.org/debian/ } "
LB_PARENT_MIRROR_BOOTSTRAP = " ${ LB_PARENT_MIRROR_BOOTSTRAP :- ${ LB_MIRROR_BOOTSTRAP } } "
2008-02-21 18:52:37 -01:00
2020-03-19 00:37:59 -01:00
LB_MIRROR_CHROOT_SECURITY = " ${ LB_MIRROR_CHROOT_SECURITY :- http : //security.debian.org/ } "
LB_PARENT_MIRROR_CHROOT_SECURITY = " ${ LB_PARENT_MIRROR_CHROOT_SECURITY :- ${ LB_MIRROR_CHROOT_SECURITY } } "
2007-09-23 08:04:46 +00:00
2020-03-19 00:37:59 -01:00
LB_MIRROR_BINARY = " ${ LB_MIRROR_BINARY :- http : //deb.debian.org/debian/ } "
LB_PARENT_MIRROR_BINARY = " ${ LB_PARENT_MIRROR_BINARY :- ${ LB_MIRROR_BINARY } } "
2007-09-23 08:04:46 +00:00
2020-03-19 00:37:59 -01:00
LB_MIRROR_BINARY_SECURITY = " ${ LB_MIRROR_BINARY_SECURITY :- http : //security.debian.org/ } "
LB_PARENT_MIRROR_BINARY_SECURITY = " ${ LB_PARENT_MIRROR_BINARY_SECURITY :- ${ LB_MIRROR_BINARY_SECURITY } } "
fi
2020-03-18 23:19:26 -01:00
LB_MIRROR_DEBIAN_INSTALLER = " ${ LB_MIRROR_DEBIAN_INSTALLER :- ${ LB_MIRROR_CHROOT } } "
LB_PARENT_MIRROR_DEBIAN_INSTALLER = " ${ LB_PARENT_MIRROR_DEBIAN_INSTALLER :- ${ LB_PARENT_MIRROR_CHROOT } } "
2010-03-04 11:22:15 -01:00
2010-09-07 13:11:20 +00:00
LB_CHROOT_FILESYSTEM = " ${ LB_CHROOT_FILESYSTEM :- squashfs } "
2007-09-23 08:05:10 +00:00
2016-12-02 13:10:19 -01:00
LB_UNION_FILESYSTEM = " ${ LB_UNION_FILESYSTEM :- overlay } "
2007-09-23 08:05:13 +00:00
2010-09-07 13:11:20 +00:00
LB_INTERACTIVE = " ${ LB_INTERACTIVE :- false } "
2007-09-23 08:04:48 +00:00
2015-05-03 13:53:27 +00:00
LB_KEYRING_PACKAGES = " ${ LB_KEYRING_PACKAGES :- debian -archive-keyring } "
2007-09-23 08:05:10 +00:00
2014-12-10 05:39:58 -01:00
case " ${ LB_ARCHITECTURES } " in
2015-02-03 19:22:30 -01:00
arm64)
2017-12-15 16:22:57 -01:00
LB_LINUX_FLAVOURS_WITH_ARCH = " ${ LB_LINUX_FLAVOURS_WITH_ARCH :- arm64 } "
2015-02-03 19:22:30 -01:00
; ;
2010-12-27 16:12:36 -01:00
armel)
2015-05-03 13:53:27 +00:00
# armel will have special images: one rootfs image and many additional kernel images.
# therefore we default to all available armel flavours
2017-12-15 16:22:57 -01:00
LB_LINUX_FLAVOURS_WITH_ARCH = " ${ LB_LINUX_FLAVOURS_WITH_ARCH :- marvell } "
2010-12-27 16:12:36 -01:00
; ;
2010-02-17 12:57:12 -01:00
2012-01-12 09:42:09 -01:00
armhf)
2015-05-03 13:53:27 +00:00
# armhf will have special images: one rootfs image and many additional kernel images.
# therefore we default to all available armhf flavours
2017-12-15 16:22:57 -01:00
LB_LINUX_FLAVOURS_WITH_ARCH = " ${ LB_LINUX_FLAVOURS_WITH_ARCH :- armmp armmp-lpae } "
2012-01-12 09:42:09 -01:00
; ;
2010-12-27 16:12:36 -01:00
amd64)
2017-12-15 16:22:57 -01:00
LB_LINUX_FLAVOURS_WITH_ARCH = " ${ LB_LINUX_FLAVOURS_WITH_ARCH :- amd64 } "
2010-12-27 16:12:36 -01:00
; ;
2007-09-23 08:04:46 +00:00
2010-12-27 16:12:36 -01:00
i386)
2020-02-10 14:48:49 -01:00
LB_LINUX_FLAVOURS_WITH_ARCH = " ${ LB_LINUX_FLAVOURS_WITH_ARCH :- 686 -pae } "
2010-12-27 16:12:36 -01:00
; ;
2007-09-23 08:04:46 +00:00
2010-12-27 16:12:36 -01:00
ia64)
2020-03-18 23:19:26 -01:00
LB_LINUX_FLAVOURS_WITH_ARCH = " ${ LB_LINUX_FLAVOURS_WITH_ARCH :- itanium } "
2010-12-27 16:12:36 -01:00
; ;
2008-09-03 09:02:30 +00:00
2010-12-27 16:12:36 -01:00
powerpc)
2020-03-18 23:19:26 -01:00
LB_LINUX_FLAVOURS_WITH_ARCH = " ${ LB_LINUX_FLAVOURS_WITH_ARCH :- powerpc64 powerpc } "
2010-12-27 16:12:36 -01:00
; ;
2009-04-15 20:07:26 +00:00
2013-10-15 10:20:42 +00:00
s390x)
2020-03-18 23:19:26 -01:00
LB_LINUX_FLAVOURS_WITH_ARCH = " ${ LB_LINUX_FLAVOURS_WITH_ARCH :- s390x } "
2010-12-27 16:12:36 -01:00
; ;
2007-09-23 08:04:46 +00:00
2010-12-27 16:12:36 -01:00
*)
2014-12-10 05:39:58 -01:00
Echo_error " Architecture(s) ${ LB_ARCHITECTURES } not yet supported (FIXME) "
2010-12-27 16:12:36 -01:00
exit 1
; ;
esac
2007-09-23 08:04:46 +00:00
2017-12-15 16:22:57 -01:00
LB_LINUX_FLAVOURS = ""
for FLAVOUR in ${ LB_LINUX_FLAVOURS_WITH_ARCH }
do
ARCH_FILTERED_FLAVOUR = " $( echo ${ FLAVOUR } | awk -F':' '{print $1}' ) "
2020-01-22 13:00:06 -01:00
LB_LINUX_FLAVOURS = " ${ LB_LINUX_FLAVOURS : + $LB_LINUX_FLAVOURS } ${ ARCH_FILTERED_FLAVOUR } "
2017-12-15 16:22:57 -01:00
done
2015-05-03 13:53:27 +00:00
LB_LINUX_PACKAGES = " ${ LB_LINUX_PACKAGES :- linux -image } "
2007-09-23 08:04:46 +00:00
2020-03-28 09:06:50 -01:00
LB_BINARY_FILESYSTEM = " ${ LB_BINARY_FILESYSTEM :- fat32 } "
2019-12-19 16:18:44 -01:00
case " ${ LB_PARENT_DISTRIBUTION_BINARY } " in
2015-01-25 08:04:13 -01:00
sid)
2011-03-21 18:36:50 -01:00
LB_SECURITY = " ${ LB_SECURITY :- false } "
; ;
*)
LB_SECURITY = " ${ LB_SECURITY :- true } "
; ;
esac
2007-09-23 08:04:46 +00:00
2019-12-19 16:18:44 -01:00
case " ${ LB_PARENT_DISTRIBUTION_BINARY } " in
2015-01-25 08:04:13 -01:00
sid)
2012-09-20 14:53:03 +00:00
LB_UPDATES = " ${ LB_UPDATES :- false } "
2011-03-21 18:36:50 -01:00
; ;
*)
2012-09-20 14:53:03 +00:00
LB_UPDATES = " ${ LB_UPDATES :- true } "
2011-03-21 18:36:50 -01:00
; ;
esac
2010-03-06 15:23:59 -01:00
2014-12-10 05:39:58 -01:00
case " ${ LB_ARCHITECTURES } " in
2010-12-27 16:12:36 -01:00
amd64| i386)
2012-12-19 08:52:13 -01:00
LIVE_IMAGE_TYPE = " ${ LIVE_IMAGE_TYPE :- iso -hybrid } "
2010-02-18 15:34:29 -01:00
; ;
*)
2012-12-19 08:52:13 -01:00
LIVE_IMAGE_TYPE = " ${ LIVE_IMAGE_TYPE :- iso } "
2010-02-18 15:34:29 -01:00
; ;
esac
2007-09-23 08:05:10 +00:00
2015-08-21 21:54:46 +00:00
if [ -z " ${ LB_BOOTLOADERS } " ]
2007-09-23 08:05:10 +00:00
then
2014-12-10 05:39:58 -01:00
case " ${ LB_ARCHITECTURES } " in
2009-12-09 19:54:41 -01:00
amd64| i386)
2020-03-12 05:37:53 -01:00
case " ${ LIVE_IMAGE_TYPE } " in
2020-03-28 04:13:11 -01:00
hdd| netboot)
2020-03-12 05:37:53 -01:00
LB_BOOTLOADERS = "syslinux"
; ;
*)
LB_BOOTLOADERS = "syslinux,grub-efi"
; ;
esac
2007-09-23 08:05:10 +00:00
; ;
esac
fi
2020-03-28 01:21:36 -01:00
LB_BOOTLOADERS = " $( echo " ${ LB_BOOTLOADERS } " | tr "," " " ) "
2007-09-23 08:05:10 +00:00
2020-03-28 01:21:36 -01:00
LB_FIRST_BOOTLOADER = $( echo " ${ LB_BOOTLOADERS } " | awk '{ print $1 }' )
2016-01-18 02:04:00 -01:00
2020-03-18 13:46:58 -01:00
LB_CHECKSUMS = " ${ LB_CHECKSUMS :- sha256 } "
2007-11-12 21:00:48 -01:00
2012-10-04 18:13:25 +00:00
LB_COMPRESSION = " ${ LB_COMPRESSION :- none } "
2011-01-01 22:36:20 -01:00
2012-07-18 17:09:16 +00:00
LB_ZSYNC = " ${ LB_ZSYNC :- true } "
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 } "
2015-01-05 15:53:53 -01:00
LB_DEBIAN_INSTALLER = " ${ LB_DEBIAN_INSTALLER :- none } "
if [ " ${ LB_DEBIAN_INSTALLER } " = "false" ]
then
LB_DEBIAN_INSTALLER = "none"
Echo_warning "A value of 'false' for option LB_DEBIAN_INSTALLER is deprecated, please use 'none' in future."
fi
if [ " ${ LB_DEBIAN_INSTALLER } " = "true" ]
then
LB_DEBIAN_INSTALLER = "netinst"
Echo_warning "A value of 'true' for option LB_DEBIAN_INSTALLER is deprecated, please use 'netinst' in future."
fi
2007-09-23 08:04:48 +00:00
2011-02-14 10:29:25 -01:00
LB_DEBIAN_INSTALLER_DISTRIBUTION = " ${ LB_DEBIAN_INSTALLER_DISTRIBUTION :- ${ LB_DISTRIBUTION } } "
2020-03-19 00:40:22 -01:00
LB_DEBIAN_INSTALLER_GUI = " ${ LB_DEBIAN_INSTALLER_GUI :- true } "
2009-09-02 05:39:13 +00:00
2010-09-07 13:11:20 +00:00
if [ -z " ${ LB_DEBIAN_INSTALLER_PRESEEDFILE } " ]
2008-08-12 20:04:25 +00:00
then
2012-10-22 18:30:41 +00:00
if Find_files config/debian-installer/preseed.cfg
2008-08-12 20:04:25 +00:00
then
2010-09-07 13:11:20 +00:00
LB_DEBIAN_INSTALLER_PRESEEDFILE = "/preseed.cfg"
2008-08-12 20:04:25 +00:00
fi
2012-10-22 18:30:41 +00:00
if Find_files config/debian-installer/*.cfg && [ ! -e config/debian-installer/preseed.cfg ]
2008-08-12 20:04:25 +00:00
then
2012-10-22 18:30:41 +00:00
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."
2008-08-12 20:04:25 +00:00
fi
fi
2012-10-04 12:26:44 +00:00
case " ${ LB_INITRAMFS } " in
live-boot)
2014-04-30 05:16:32 +00:00
LB_BOOTAPPEND_LIVE = " ${ LB_BOOTAPPEND_LIVE :- boot =live components quiet splash } "
2015-01-28 03:23:09 -01:00
LB_BOOTAPPEND_LIVE_FAILSAFE = " ${ LB_BOOTAPPEND_LIVE_FAILSAFE :- boot =live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=788 } "
2012-10-04 12:26:44 +00:00
; ;
2012-10-08 18:00:41 +00:00
none)
2012-10-08 18:01:30 +00:00
LB_BOOTAPPEND_LIVE = " ${ LB_BOOTAPPEND_LIVE :- quiet splash } "
2015-01-28 03:23:09 -01:00
LB_BOOTAPPEND_LIVE_FAILSAFE = " ${ LB_BOOTAPPEND_LIVE_FAILSAFE :- memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=788 } "
2012-10-04 12:24:36 +00:00
; ;
esac
2020-02-20 05:58:11 -01:00
local _LB_BOOTAPPEND_PRESEED
2010-09-07 13:11:20 +00:00
if [ -n " ${ LB_DEBIAN_INSTALLER_PRESEEDFILE } " ]
2008-08-12 20:04:25 +00:00
then
2012-12-19 08:52:13 -01:00
case " ${ LIVE_IMAGE_TYPE } " in
2020-03-28 04:13:11 -01:00
iso| iso-hybrid)
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
; ;
2020-03-28 04:13:11 -01:00
hdd)
2015-05-03 13:53:27 +00:00
_LB_BOOTAPPEND_PRESEED = " file=/hd-media/install/ ${ LB_DEBIAN_INSTALLER_PRESEEDFILE } "
2008-08-12 20:11:18 +00:00
; ;
2012-07-18 17:11:55 +00:00
netboot)
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
; ;
2020-03-28 04:13:11 -01:00
tar)
; ;
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
2020-03-19 00:39:28 -01:00
LB_ISO_APPLICATION = " ${ LB_ISO_APPLICATION :- Debian Live } "
2019-04-17 19:27:04 +00:00
LB_ISO_PREPARER = " ${ LB_ISO_PREPARER :- live -build \$ VERSION ; https : //salsa.debian.org/live-team/live-build } "
2020-03-18 23:19:26 -01:00
LB_ISO_PUBLISHER = " ${ LB_ISO_PUBLISHER :- Debian Live project; https : //wiki.debian.org/DebianLive; debian-live@lists.debian.org } "
2020-03-28 09:06:50 -01:00
LB_ISO_VOLUME = " ${ LB_ISO_VOLUME :- Debian ${ LB_DISTRIBUTION } \$ (date +%Y%m%d-%H : %M) } "
2007-09-23 08:04:52 +00:00
2020-03-19 00:39:28 -01:00
LB_HDD_LABEL = " ${ LB_HDD_LABEL :- DEBIAN_LIVE } "
2013-04-02 11:59:38 +00:00
LB_HDD_SIZE = " ${ LB_HDD_SIZE :- auto } "
2011-09-28 09:37:56 +00:00
2013-03-13 19:28:12 -01:00
LB_MEMTEST = " ${ LB_MEMTEST :- none } "
2020-02-20 07:25:26 -01:00
if [ " ${ LB_MEMTEST } " = "false" ] ; then
LB_MEMTEST = "none"
fi
2007-09-23 08:04:46 +00:00
2020-03-18 23:19:26 -01:00
case " ${ LB_ARCHITECTURES } " in
amd64| i386)
2020-03-28 09:06:50 -01:00
if [ " ${ LB_DEBIAN_INSTALLER } " != "none" ] ; then
2020-03-18 23:19:26 -01:00
LB_LOADLIN = " ${ LB_LOADLIN :- true } "
else
LB_LOADLIN = " ${ LB_LOADLIN :- false } "
fi
2012-09-29 11:20:21 +00:00
; ;
*)
2020-03-18 23:19:26 -01:00
LB_LOADLIN = " ${ LB_LOADLIN :- false } "
2012-09-29 11:20:21 +00:00
; ;
esac
2020-03-18 23:19:26 -01:00
case " ${ LB_ARCHITECTURES } " in
amd64| i386)
2020-03-28 09:06:50 -01:00
if [ " ${ LB_DEBIAN_INSTALLER } " != "none" ] ; then
2020-03-18 23:19:26 -01:00
LB_WIN32_LOADER = " ${ LB_WIN32_LOADER :- true } "
else
LB_WIN32_LOADER = " ${ LB_WIN32_LOADER :- false } "
fi
2010-12-27 16:12:36 -01:00
; ;
2008-08-14 19:33:56 +00:00
2010-12-27 16:12:36 -01:00
*)
2020-03-18 23:19:26 -01:00
LB_WIN32_LOADER = " ${ LB_WIN32_LOADER :- false } "
2010-12-27 16:12:36 -01:00
; ;
esac
2008-08-14 19:33:56 +00:00
2010-09-07 13:11:20 +00:00
LB_NET_ROOT_FILESYSTEM = " ${ LB_NET_ROOT_FILESYSTEM :- nfs } "
2020-03-18 23:19:26 -01:00
LB_NET_ROOT_PATH = " ${ LB_NET_ROOT_PATH :- /srv/ ${ LB_MODE } -live } "
2010-09-07 13:11:20 +00:00
LB_NET_ROOT_SERVER = " ${ LB_NET_ROOT_SERVER :- 192 .168.1.1 } "
LB_NET_COW_FILESYSTEM = " ${ LB_NET_COW_FILESYSTEM :- nfs } "
2011-01-01 22:36:20 -01:00
LB_NET_TARBALL = " ${ LB_NET_TARBALL :- true } "
2008-02-26 17:57:41 -01:00
2018-03-16 18:30:50 -01:00
LB_ONIE = " ${ LB_ONIE :- false } "
LB_ONIE_KERNEL_CMDLINE = " ${ LB_ONIE_KERNEL_CMDLINE :- } "
2015-05-03 13:53:27 +00:00
LB_FIRMWARE_CHROOT = " ${ LB_FIRMWARE_CHROOT :- true } "
LB_FIRMWARE_BINARY = " ${ LB_FIRMWARE_BINARY :- true } "
2012-04-26 17:52:15 +00:00
2011-06-08 10:30:29 +00:00
LB_SWAP_FILE_SIZE = " ${ LB_SWAP_FILE_SIZE :- 512 } "
2018-02-27 18:28:33 -01:00
LB_UEFI_SECURE_BOOT = " ${ LB_UEFI_SECURE_BOOT :- auto } "
2010-09-07 13:11:20 +00:00
LB_SOURCE = " ${ LB_SOURCE :- false } "
LB_SOURCE_IMAGES = " ${ LB_SOURCE_IMAGES :- tar } "
2020-03-28 03:37:17 -01:00
LB_SOURCE_IMAGES = " $( echo " ${ LB_SOURCE_IMAGES } " | tr "," " " ) "
2020-03-28 04:31:22 -01:00
2020-03-28 08:49:19 -01:00
# Foreign/port bootstrapping
2020-03-28 04:31:22 -01:00
LB_BOOTSTRAP_QEMU_ARCHITECTURES = " ${ LB_BOOTSTRAP_QEMU_ARCHITECTURES :- } "
LB_BOOTSTRAP_QEMU_EXCLUDE = " ${ LB_BOOTSTRAP_QEMU_EXCLUDE :- } "
LB_BOOTSTRAP_QEMU_STATIC = " ${ LB_BOOTSTRAP_QEMU_STATIC :- } "
2007-09-23 08:04:46 +00:00
}
2007-11-11 12:14:25 -01:00
2020-03-28 04:37:14 -01:00
Validate_config ( )
2007-11-11 12:14:25 -01:00
{
2020-03-28 07:46:40 -01:00
Validate_config_permitted_values
Validate_config_dependencies
}
# Check values are individually permitted, including:
# - value in list of available values
# - string lengths within permitted ranges
Validate_config_permitted_values ( )
{
2020-03-28 07:37:06 -01:00
if [ " ${ LB_APT_INDICES } " != "true" ] && [ " ${ LB_APT_INDICES } " != "false" ] ; then
Echo_error "Value for LB_APT_INDICES (--apt-indices) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_APT_RECOMMENDS } " != "true" ] && [ " ${ LB_APT_RECOMMENDS } " != "false" ] ; then
Echo_error "Value for LB_APT_RECOMMENDS (--apt-recommends) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_APT_SECURE } " != "true" ] && [ " ${ LB_APT_SECURE } " != "false" ] ; then
Echo_error "Value for LB_APT_SECURE (--apt-secure) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_APT_SOURCE_ARCHIVES } " != "true" ] && [ " ${ LB_APT_SOURCE_ARCHIVES } " != "false" ] ; then
Echo_error "Value for LB_APT_SOURCE_ARCHIVES (--apt-source-archives) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_BACKPORTS } " != "true" ] && [ " ${ LB_BACKPORTS } " != "false" ] ; then
Echo_error "Value for LB_BACKPORTS (--backports) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_BUILD_WITH_CHROOT } " != "true" ] && [ " ${ LB_BUILD_WITH_CHROOT } " != "false" ] ; then
Echo_error "Value for LB_BUILD_WITH_CHROOT (--build-with-chroot) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_CACHE } " != "true" ] && [ " ${ LB_CACHE } " != "false" ] ; then
Echo_error "Value for LB_CACHE (--cache) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_CACHE_INDICES } " != "true" ] && [ " ${ LB_CACHE_INDICES } " != "false" ] ; then
Echo_error "Value for LB_CACHE_INDICES (--cache-indices) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_CACHE_PACKAGES } " != "true" ] && [ " ${ LB_CACHE_PACKAGES } " != "false" ] ; then
Echo_error "Value for LB_CACHE_PACKAGES (--cache-packages) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_DEBIAN_INSTALLER_GUI } " != "true" ] && [ " ${ LB_DEBIAN_INSTALLER_GUI } " != "false" ] ; then
Echo_error "Value for LB_DEBIAN_INSTALLER_GUI (--debian-installer-gui) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_FIRMWARE_BINARY } " != "true" ] && [ " ${ LB_FIRMWARE_BINARY } " != "false" ] ; then
Echo_error "Value for LB_FIRMWARE_BINARY (--firmware-binary) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_FIRMWARE_CHROOT } " != "true" ] && [ " ${ LB_FIRMWARE_CHROOT } " != "false" ] ; then
Echo_error "Value for LB_FIRMWARE_CHROOT (--firmware-chroot) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_LOADLIN } " != "true" ] && [ " ${ LB_LOADLIN } " != "false" ] ; then
Echo_error "Value for LB_LOADLIN (--loadlin) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_NET_TARBALL } " != "true" ] && [ " ${ LB_NET_TARBALL } " != "false" ] ; then
Echo_error "Value for LB_NET_TARBALL (--net-tarball) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_ONIE } " != "true" ] && [ " ${ LB_ONIE } " != "false" ] ; then
Echo_error "Value for LB_ONIE (--onie) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_SECURITY } " != "true" ] && [ " ${ LB_SECURITY } " != "false" ] ; then
Echo_error "Value for LB_SECURITY (--security) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_SOURCE } " != "true" ] && [ " ${ LB_SOURCE } " != "false" ] ; then
Echo_error "Value for LB_SOURCE (--source) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_UPDATES } " != "true" ] && [ " ${ LB_UPDATES } " != "false" ] ; then
Echo_error "Value for LB_UPDATES (--updates) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_WIN32_LOADER } " != "true" ] && [ " ${ LB_WIN32_LOADER } " != "false" ] ; then
Echo_error "Value for LB_WIN32_LOADER (--win32-loader) can only be 'true' or 'false'!"
exit 1
fi
if [ " ${ LB_ZSYNC } " != "true" ] && [ " ${ LB_ZSYNC } " != "false" ] ; then
Echo_error "Value for LB_ZSYNC (--zsync) can only be 'true' or 'false'!"
exit 1
fi
if ! In_list " ${ LB_APT } " apt aptitude; then
Echo_error "You have specified an invalid value for LB_APT (--apt)."
exit 1
fi
if ! In_list " ${ LB_BINARY_FILESYSTEM } " fat16 fat32 ext2 ext3 ext4 ntfs; then
Echo_error "You have specified an invalid value for LB_BINARY_FILESYSTEM (--binary-filesystem)."
exit 1
fi
2020-03-28 07:46:40 -01:00
if ! In_list " ${ LIVE_IMAGE_TYPE } " iso iso-hybrid hdd tar netboot; then
Echo_error "You have specified an invalid value for --binary-image."
2020-03-28 07:08:11 -01:00
exit 1
fi
2013-03-13 20:15:47 -01:00
2020-03-28 07:37:06 -01:00
if [ -z " ${ LB_BOOTLOADERS } " ] ; then
Echo_warning "You have specified no bootloaders; I predict that you will experience some problems!"
else
local BOOTLOADER
for BOOTLOADER in ${ LB_BOOTLOADERS } ; do
if ! In_list " ${ BOOTLOADER } " grub-legacy grub-pc grub-efi syslinux; then
Echo_error "The following is not a valid bootloader: '%s'" " ${ BOOTLOADER } "
exit 1
fi
done
fi
local CACHE_STAGE
for CACHE_STAGE in ${ LB_CACHE_STAGES } ; do
if ! In_list " ${ CACHE_STAGE } " bootstrap chroot installer binary source; then
Echo_warning "The following is not a valid stage: '%s'" " ${ CACHE_STAGE } "
fi
done
if ! In_list " ${ LB_CHECKSUMS } " md5 sha1 sha224 sha256 sha384 sha512 none; then
Echo_error "You have specified an invalid value for LB_CHECKSUMS (--checksums)."
exit 1
fi
if ! In_list " ${ LB_CHROOT_FILESYSTEM } " ext2 ext3 ext4 squashfs jffs2 none; then
Echo_error "You have specified an invalid value for LB_CHROOT_FILESYSTEM (--chroot-filesystem)."
exit 1
fi
if ! In_list " ${ LB_COMPRESSION } " bzip2 gzip lzip xz none; then
Echo_error "You have specified an invalid value for LB_COMPRESSION (--compression)."
exit 1
fi
if ! In_list " ${ LB_DEBCONF_FRONTEND } " dialog editor noninteractive readline; then
Echo_error "You have specified an invalid value for LB_DEBCONF_FRONTEND (--debconf-frontend)."
exit 1
fi
if ! In_list " ${ LB_DEBCONF_PRIORITY } " low medium high critical; then
Echo_error "You have specified an invalid value for LB_DEBCONF_PRIORITY (--debconf-priority)."
exit 1
fi
if ! In_list " ${ LB_DEBIAN_INSTALLER } " cdrom netinst netboot businesscard live none; then
Echo_error "You have specified an invalid value for LB_DEBIAN_INSTALLER (--debian-installer)."
exit 1
fi
2020-03-28 07:08:11 -01:00
if echo ${ LB_HDD_LABEL } | grep -qs ' ' ; then
2020-03-28 07:37:06 -01:00
Echo_error "Whitespace is not currently supported in HDD labels (LB_HDD_LABEL; --hdd-label)."
exit 1
fi
if ! In_list " ${ LB_INITRAMFS } " none live-boot; then
Echo_error "You have specified an invalid value for LB_INITRAMFS (--initramfs)."
exit 1
fi
if ! In_list " ${ LB_INITRAMFS_COMPRESSION } " bzip2 gzip lzma; then
Echo_error "You have specified an invalid value for LB_INITRAMFS_COMPRESSION (--initramfs-compression)."
exit 1
fi
if ! In_list " ${ LB_INITSYSTEM } " sysvinit systemd none; then
Echo_error "You have specified an invalid value for LB_INITSYSTEM (--initsystem)."
exit 1
fi
if ! In_list " ${ LB_INTERACTIVE } " true shell x11 xnest false; then
Echo_error "You have specified an invalid value for LB_INTERACTIVE (--interactive)."
2020-03-28 07:46:40 -01:00
exit 1
fi
if [ " $( echo \" ${ LB_ISO_APPLICATION } \" | wc -c) " -gt 128 ] ; then
2020-03-28 07:37:06 -01:00
Echo_warning "You have specified a value of LB_ISO_APPLICATION (--iso-application) that is too long; the maximum length is 128 characters."
2020-03-28 07:46:40 -01:00
fi
if [ " $( echo \" ${ LB_ISO_PREPARER } \" | wc -c) " -gt 128 ] ; then
2020-03-28 07:37:06 -01:00
Echo_warning "You have specified a value of LB_ISO_PREPARER (--iso-preparer) that is too long; the maximum length is 128 characters."
2020-03-28 07:46:40 -01:00
fi
if [ " $( echo \" ${ LB_ISO_PUBLISHER } \" | wc -c) " -gt 128 ] ; then
2020-03-28 07:37:06 -01:00
Echo_warning "You have specified a value of LB_ISO_PUBLISHER (--iso-publisher) that is too long; the maximum length is 128 characters."
2020-03-28 07:46:40 -01:00
fi
if [ " $( eval " echo \" ${ LB_ISO_VOLUME } \" " | wc -c) " -gt 32 ] ; then
2020-03-28 07:37:06 -01:00
Echo_warning "You have specified a value of LB_ISO_VOLUME (--iso-volume) that is too long; the maximum length is 32 characters."
fi
if ! In_list " ${ LB_MEMTEST } " memtest86+ memtest86 none; then
Echo_error "You have specified an invalid value for LB_MEMTEST (--memtest)."
exit 1
fi
if ! In_list " ${ LB_NET_COW_FILESYSTEM } " nfs cfs; then
Echo_error "You have specified an invalid value for LB_NET_COW_FILESYSTEM (--net-cow-filesystem)."
exit 1
fi
if ! In_list " ${ LB_NET_ROOT_FILESYSTEM } " nfs cfs; then
Echo_error "You have specified an invalid value for LB_NET_ROOT_FILESYSTEM (--net-root-filesystem)."
exit 1
fi
if ! In_list " ${ LB_SOURCE_IMAGES } " iso netboot tar hdd; then
Echo_error "You have specified an invalid value for LB_SOURCE_IMAGES (--source-images)."
exit 1
fi
if ! In_list " ${ LB_SYSTEM } " live normal; then
Echo_error "You have specified an invalid value for LB_SYSTEM (--system)."
exit 1
fi
if ! In_list " ${ LB_TASKSEL } " apt aptitude tasksel; then
Echo_error "You have specified an invalid value for LB_TASKSEL (--tasksel)."
exit 1
fi
if ! In_list " ${ LB_UEFI_SECURE_BOOT } " auto enable disable; then
Echo_error "You have specified an invalid value for LB_UEFI_SECURE_BOOT (--uefi-secure-boot)."
exit 1
2020-03-28 07:46:40 -01:00
fi
}
# Check option combinations and other extra stuff
Validate_config_dependencies ( )
{
if [ " ${ LB_BINARY_FILESYSTEM } " = "ntfs" ] && [ ! $( which ntfs-3g) ] ; then
Echo_error "Using ntfs as the binary filesystem is currently only supported if ntfs-3g is installed on the host system."
2013-02-15 09:58:14 -01:00
exit 1
fi
2020-03-28 07:08:11 -01:00
if [ " ${ LB_DEBIAN_INSTALLER } " != "none" ] ; then
2009-12-13 19:17:45 -01:00
# d-i true, no caching
2020-03-28 02:31:15 -01:00
if ! In_list "bootstrap" ${ LB_CACHE_STAGES } || [ " ${ 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
2020-03-28 07:08:11 -01:00
if [ " ${ LB_FIRST_BOOTLOADER } " = "syslinux" ] ; then
2014-04-27 10:35:58 +00:00
# syslinux + fat or ntfs, or extlinux + ext[234] or btrfs
2020-03-28 07:08:11 -01:00
if ! In_list " ${ LB_BINARY_FILESYSTEM } " fat16 fat32 ntfs ext2 ext3 ext4 btrfs; then
Echo_warning "You have selected values of LB_BOOTLOADERS and LB_BINARY_FILESYSTEM which are incompatible - the syslinux family only support FAT, NTFS, ext[234] or btrfs filesystems."
fi
2008-09-07 14:41:36 +00:00
fi
2009-01-14 18:30:21 -01:00
2020-03-28 07:17:28 -01:00
if In_list "grub-pc" ${ LB_BOOTLOADERS } || In_list "grub-efi" ${ LB_BOOTLOADERS } || In_list "grub-legacy" ${ LB_BOOTLOADERS } ; then
if In_list " ${ LIVE_IMAGE_TYPE } " hdd netboot; then
Echo_error "You have selected an invalid combination of bootloaders and live image type; the grub-* bootloaders are not compatible with hdd and netboot types."
exit 1
fi
fi
2020-03-28 07:08:11 -01:00
if [ " ${ LIVE_IMAGE_TYPE } " = "hdd" ] && [ " ${ LB_FIRST_BOOTLOADER } " = "grub-legacy" ] ; then
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
fi
2007-11-11 12:14:25 -01:00
}
2020-03-28 06:58:31 -01:00
Get_configuration ( )
{
local CONFIGURATION_FILE = " ${ 1 } "
local FIELD_NAME = " ${ 2 } "
local FIELD_BODY
if [ -e " ${ CONFIGURATION_FILE } " ]
then
FIELD_BODY = " $( grep ^${ FIELD_NAME } : ${ CONFIGURATION_FILE } | awk '{ $1=""; print $0 }' | sed -e 's|^ ||' ) "
fi
echo ${ FIELD_BODY }
}
Set_configuration ( )
{
local CONFIGURATION_FILE = " ${ 1 } "
local FIELD_NAME = " ${ 2 } "
local FIELD_BODY = " ${ 3 } "
if grep -qs " ^ ${ FIELD_NAME } : " " ${ CONFIGURATION_FILE } "
then
# Update configuration
sed -i -e " s|^ ${ FIELD_NAME } :.* $| ${ FIELD_NAME } : ${ FIELD_BODY } | " " ${ CONFIGURATION_FILE } "
else
# Append configuration
echo " ${ FIELD_NAME } : ${ FIELD_BODY } " >> " ${ CONFIGURATION_FILE } "
fi
}