2007-09-23 08:04:40 +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
set -e
2010-04-18 12:43:23 +00:00
# Including common functions
2012-08-27 13:52:29 +00:00
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
2010-04-18 12:43:23 +00:00
2007-09-23 08:05:11 +00:00
# Setting static variables
2011-07-26 12:49:29 +00:00
PROGRAM="lb config"
2015-02-05 02:30:47 -01:00
DESCRIPTION="Create configuration for live-build(7)"
2020-03-28 11:01:03 -01:00
USAGE="${PROGRAM} [--apt apt|apt-get|aptitude]\n\
2007-09-23 08:05:19 +00:00
\t [--apt-ftp-proxy URL]\n\
\t [--apt-http-proxy URL]\n\
2013-02-19 07:08:16 -01:00
\t [--apt-indices true|false]\n\
2008-02-21 18:03:57 -01:00
\t [--apt-options OPTION|\"OPTIONS\"]\n\
2010-12-06 10:16:36 -01:00
\t [--apt-pipeline DEPTH]\n\
2009-12-13 19:17:45 -01:00
\t [--apt-recommends true|false]\n\
\t [--apt-secure true|false]\n\
2011-08-24 21:30:22 +00:00
\t [--apt-source-archives true|false]\n\
2019-06-16 11:12:06 +00:00
\t [--aptitude-options OPTION|\"OPTIONS\"]\n\
2020-02-28 20:01:30 -01:00
\t [-a|--architecture ARCHITECTURE]\n\
2019-06-16 11:12:06 +00:00
\t [--archive-areas ARCHIVE_AREA|\"ARCHIVE_AREAS\"]\n\
\t [--backports true|false]\n\
2012-07-18 20:27:30 +00:00
\t [--binary-filesystem fat16|fat32|ext2|ext3|ext4|ntfs]\n\
2020-03-28 04:13:11 -01:00
\t [-b|--binary-image iso|iso-hybrid|netboot|tar|hdd]\n\
2007-09-23 12:05:12 +00:00
\t [--bootappend-install PARAMETER|\"PARAMETERS\"]\n\
2007-09-23 12:05:11 +00:00
\t [--bootappend-live PARAMETER|\"PARAMETERS\"]\n\
2012-10-08 17:51:23 +00:00
\t [--bootappend-live-failsafe PARAMETER|\"PARAMETERS\"]\n\
2020-03-28 02:10:14 -01:00
\t [--bootloaders grub-legacy|grub-pc|syslinux|grub-efi|\"BOOTLOADERS\"]\n\
2019-06-16 10:40:04 +00:00
\t [--bootstrap-qemu-arch ARCH]\n\
2020-03-28 02:19:38 -01:00
\t [--bootstrap-qemu-exclude PACKAGE|\"PACKAGES\"]\n\
2019-06-16 10:40:04 +00:00
\t [--bootstrap-qemu-static PATH]\n\
2019-05-31 09:17:48 +00:00
\t [--breakpoints]\n\
2019-06-16 11:12:06 +00:00
\t [--build-with-chroot true|false]\n\
2009-12-13 19:17:45 -01:00
\t [--cache true|false]\n\
\t [--cache-indices true|false]\n\
\t [--cache-packages true|false]\n\
2007-09-23 08:05:19 +00:00
\t [--cache-stages STAGE|\"STAGES\"]\n\
2019-06-12 09:33:03 +00:00
\t [--checksums md5|sha1|sha224|sha256|sha384|sha512|none]\n\
2011-09-28 09:17:47 +00:00
\t [--chroot-filesystem ext2|ext3|ext4|squashfs|jffs2|none]\n\
2019-05-31 09:18:32 +00:00
\t [--clean]\n\
2019-06-16 11:12:06 +00:00
\t [--color]\n\
\t [--compression bzip2|gzip|lzip|xz|none]\n\
2010-12-06 10:16:36 -01:00
\t [-c|--conffile FILE]\n\
2019-06-16 11:12:06 +00:00
\t [--config GIT_URL::GIT_BRANCH]\n\
2007-09-23 08:05:19 +00:00
\t [--debconf-frontend dialog|editor|noninteractive|readline]\n\
\t [--debconf-priority low|medium|high|critical]\n\
2015-01-05 15:53:53 -01:00
\t [--debian-installer cdrom|netinst|netboot|businesscard|live|none]\n\
2010-12-06 10:16:36 -01:00
\t [--debian-installer-distribution daily|CODENAME]\n\
2009-12-13 19:17:45 -01:00
\t [--debian-installer-gui true|false]\n\
2019-06-16 11:12:06 +00:00
\t [--debian-installer-preseedfile FILE|URL]\n\
2020-03-28 02:19:38 -01:00
\t [--debootstrap-options OPTION|\"OPTIONS\"]\n\
2016-11-28 14:43:50 -01:00
\t [--debootstrap-script SCRIPT]\n\
2007-09-23 08:05:19 +00:00
\t [--debug]\n\
\t [-d|--distribution CODENAME]\n\
2019-12-19 16:18:44 -01:00
\t [--distribution-binary CODENAME]\n\
\t [--distribution-chroot CODENAME]\n\
2009-01-23 14:45:27 -01:00
\t [--dump]\n\
2019-06-16 09:55:37 +00:00
\t [--firmware-binary true|false]\n\
\t [--firmware-chroot true|false]\n\
2007-09-23 08:05:19 +00:00
\t [--force]\n\
2009-09-11 07:39:13 +00:00
\t [--gzip-options OPTION|\"OPTIONS\"]\n\
2019-06-16 11:12:06 +00:00
\t [--hdd-label LABEL]\n\
\t [--hdd-partition-start START]\n\
\t [--hdd-size SIZE]\n\
2008-07-09 03:55:10 +00:00
\t [--ignore-system-defaults]\n\
2019-06-16 09:05:45 +00:00
\t [--image-name NAME]\n\
2019-06-12 11:55:10 +00:00
\t [--initramfs none|live-boot]\n\
2011-06-13 18:38:44 +00:00
\t [--initramfs-compression bzip2|gzip|lzma]\n\
2015-05-03 14:12:28 +00:00
\t [--initsystem sysvinit|systemd|none]\n\
2020-03-28 02:51:42 -01:00
\t [--interactive true|shell|x11|xnest|false]\n\
2007-09-23 08:05:19 +00:00
\t [--iso-application NAME]\n\
\t [--iso-preparer NAME]\n\
\t [--iso-publisher NAME]\n\
\t [--iso-volume NAME]\n\
2008-03-01 11:19:54 -01:00
\t [--jffs2-eraseblock SIZE]\n\
2007-09-23 08:05:19 +00:00
\t [--keyring-packages PACKAGE|\"PACKAGES\"]\n\
\t [-k|--linux-flavours FLAVOUR|\"FLAVOURS\"]\n\
2020-03-28 02:19:38 -01:00
\t [--linux-packages PACKAGE|\"PACKAGES\"]\n\
2019-06-16 10:21:39 +00:00
\t [--loadlin true|false]\n\
2010-12-06 10:16:36 -01:00
\t [--memtest memtest86+|memtest86|none]\n\
2019-06-19 11:07:10 +00:00
\t [--mirror-binary URL]\n\
\t [--mirror-binary-security URL]\n\
2011-02-14 11:48:45 -01:00
\t [--mirror-bootstrap URL]\n\
\t [--mirror-chroot URL]\n\
\t [--mirror-chroot-security URL]\n\
\t [--mirror-debian-installer URL]\n\
2020-03-18 23:19:26 -01:00
\t [--mode debian]\n\
2019-06-16 11:12:06 +00:00
\t [--net-root-path PATH]\n\
2011-01-01 22:36:20 -01:00
\t [--net-tarball true|false]\n\
2020-03-11 20:30:58 -01:00
\t [--no-color]\n\
2018-03-16 18:30:50 -01:00
\t [--onie true|false]\n\
2020-03-28 02:19:38 -01:00
\t [--onie-kernel-cmdline OPTION|\"OPTIONS\"]\n\
2011-03-24 18:25:34 -01:00
\t [--parent-archive-areas ARCHIVE_AREA|\"ARCHIVE_AREAS\"]\n\
2019-06-16 11:12:06 +00:00
\t [--parent-debian-installer-distribution CODENAME]\n\
\t [--parent-distribution CODENAME]\n\
2019-12-19 16:18:44 -01:00
\t [--parent-distribution-binary CODENAME]\n\
\t [--parent-distribution-chroot CODENAME]\n\
2019-06-16 11:12:06 +00:00
\t [--parent-mirror-binary URL]\n\
\t [--parent-mirror-binary-security URL]\n\
\t [-m|--parent-mirror-bootstrap URL]\n\
\t [--parent-mirror-chroot URL]\n\
\t [--parent-mirror-chroot-security URL]\n\
\t [--parent-mirror-debian-installer URL]\n\
\t [--quiet]\n\
2009-12-13 19:17:45 -01:00
\t [--security true|false]\n\
\t [--source true|false]\n\
2012-07-18 17:11:55 +00:00
\t [-s|--source-images iso|netboot|tar|hdd]\n\
2011-06-08 10:30:29 +00:00
\t [--swap-file-path PATH]\n\
\t [--swap-file-size MB]\n\
2019-06-16 11:12:06 +00:00
\t [--system live|normal]\n\
2018-02-27 18:28:33 -01:00
\t [--uefi-secure-boot auto|enable|disable]\n\
2012-09-20 14:53:03 +00:00
\t [--updates true|false]\n\
2020-03-28 05:11:15 -01:00
\t [--validate]\n\
2008-08-15 22:07:51 +00:00
\t [--verbose]\n\
2019-06-16 11:12:06 +00:00
\t [--win32-loader true|false]\n\
\t [--zsync true|false]"
2011-09-30 22:24:08 +00:00
2007-09-23 08:04:48 +00:00
2007-09-23 08:05:17 +00:00
Local_arguments ()
{
2020-02-20 05:58:11 -01:00
local LONG_OPTIONS
2020-03-28 05:32:14 -01:00
LONG_OPTIONS="
apt:,apt-ftp-proxy:,apt-http-proxy:,apt-indices:,aptitude-options:,
apt-options:,apt-pipeline:,apt-recommends:,apt-secure:,
apt-source-archives:,architecture:,architectures:,archive-areas:,
backports:,binary-filesystem:,binary-image:,binary-images:,
bootappend-install:,bootappend-live:,bootappend-live-failsafe:,
bootloader:,bootloaders:,bootstrap-qemu-arch:,bootstrap-qemu-exclude:,
bootstrap-qemu-static:,breakpoints,build-with-chroot:,
cache:,cache-indices:,cache-packages:,cache-stages:,checksums:,
chroot-filesystem:,clean,color,compression:,conffile:,config:,
debconf-frontend:,debconf-priority:,debian-installer:,
debian-installer-distribution:,debian-installer-gui:,
debian-installer-preseedfile:,debootstrap-options:,debootstrap-script:,
debug,distribution:,distribution-binary:,distribution-chroot:,dump,
fdisk:,firmware-binary:,firmware-chroot:,force,
grub-splash:,gzip-options:,
hdd-label:,hdd-partition-start:,hdd-size:,help,
ignore-system-defaults,image-name:,initramfs:,initramfs-compression:,
initsystem:,interactive:,iso-application:,isohybrid-options:,
iso-preparer:,iso-publisher:,iso-volume:,
jffs2-eraseblock:,
keyring-packages:,
linux-flavours:,linux-packages:,loadlin:,losetup:,
memtest:,mirror-binary:,mirror-binary-security:,mirror-bootstrap:,
mirror-chroot:,mirror-chroot-security:,mirror-debian-installer:,mode:,
net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:,
net-cow-server:,net-root-filesystem:,net-root-mountoptions:,
net-root-path:,net-root-server:,net-tarball:,no-color,
onie:,onie-kernel-cmdline:,
parent-archive-areas:,parent-debian-installer-distribution:,
parent-distribution:,parent-distribution-binary:,
parent-distribution-chroot:,parent-mirror-binary:,
parent-mirror-binary-security:,parent-mirror-bootstrap:,
parent-mirror-chroot:,parent-mirror-chroot-security:,
parent-mirror-debian-installer:,
quiet,
security:,source:,source-images:,swap-file-path:,swap-file-size:,system:,
tasksel:,
uefi-secure-boot:,updates:,usage,
validate,verbose,version,
win32-loader:,
zsync:"
2008-08-26 07:44:30 +00:00
# Remove spaces added by indentation
LONG_OPTIONS="$(echo ${LONG_OPTIONS} | tr -d ' ')"
2007-09-23 08:04:48 +00:00
2020-02-20 05:58:11 -01:00
local ARGUMENTS
2020-03-06 22:16:26 -01:00
local ERR=0
ARGUMENTS="$(getopt --longoptions ${LONG_OPTIONS} --name="${PROGRAM}" --options a:d:m:k:b:s:c:huv --shell sh -- "${@}")" || ERR=$?
if [ $ERR -eq 1 ]; then
2020-03-18 00:51:53 -01:00
Echo_error "Invalid argument(s)"
2020-03-06 22:16:26 -01:00
exit 1
elif [ $ERR -ne 0 ]; then
2020-03-18 00:09:11 -01:00
Echo_error "getopt failure"
2007-09-23 08:05:17 +00:00
exit 1
2007-09-23 08:04:50 +00:00
fi
2007-09-23 08:05:17 +00:00
eval set -- "${ARGUMENTS}"
while true
do
case "${1}" in
2020-03-28 06:08:37 -01:00
# Config script specific options
--clean)
_CLEAN="true"
shift
;;
--config)
_CONFIG="${2}"
shift 2
;;
-c|--conffile)
_CONFFILE="${2}"
shift 2
;;
2008-10-23 11:11:34 +00:00
--dump)
# Dump version
2020-04-02 11:12:54 +00:00
Echo "This is live-build version %s" "${VERSION}"
if [ $(which dpkg-query) ]; then
Echo "Installed version reported by dpkg is %s" "$(dpkg-query -f='${Version}' --show live-build)"
2008-10-27 04:25:25 -01:00
fi
2008-10-23 11:11:34 +00:00
# Dump conffile contents
2015-02-05 02:30:47 -01:00
Print_conffiles $(Common_config_files)
2008-10-23 11:11:34 +00:00
# Dump contents of directories that contain text files
2020-02-20 05:58:11 -01:00
local DIRECTORY
2012-10-22 18:41:40 +00:00
for DIRECTORY in config/package-lists config/apt config/preseed config/rootfs
2008-10-23 11:11:34 +00:00
do
if Find_files "${DIRECTORY}"
then
Echo_file "${DIRECTORY}"/*
fi
done
# Dump directory listings of all directories under config/
2009-01-01 20:34:35 -01:00
for DIRECTORY in $(find config/ -mindepth 1 -maxdepth 1 -type d)
2008-10-23 11:11:34 +00:00
do
if Find_files "${DIRECTORY}"
then
ls -lR "${DIRECTORY}" | while read LINE
do
echo "${DIRECTORY}: ${LINE}"
done
fi
done
exit 0
;;
2020-03-28 06:08:37 -01:00
--ignore-system-defaults)
shift
;;
2020-03-28 05:11:15 -01:00
--validate)
_VALIDATE_MODE="true"
shift
;;
2020-03-28 06:08:37 -01:00
# General options
--breakpoints)
_BREAKPOINTS="true"
shift
;;
--color)
_COLOR="true"
shift
;;
--debug)
_DEBUG="true"
shift
;;
--force)
_FORCE="true"
shift
;;
-h|--help)
Help
shift
;;
--no-color)
_COLOR="false"
shift
;;
--quiet)
_QUIET="true"
shift
;;
-u|--usage)
2020-04-23 14:38:59 +00:00
Usage --exit
2020-03-28 06:08:37 -01:00
shift
;;
--verbose)
_VERBOSE="true"
2010-09-07 14:25:58 +00:00
shift
2009-02-03 08:41:26 -01:00
;;
2020-03-28 06:08:37 -01:00
-v|--version)
echo "${VERSION}"
exit 0
;;
# Build config options
2007-09-23 08:05:17 +00:00
--apt)
2010-09-07 13:11:20 +00:00
LB_APT="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--apt-ftp-proxy)
2010-09-07 13:11:20 +00:00
LB_APT_FTP_PROXY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--apt-http-proxy)
2010-09-07 13:11:20 +00:00
LB_APT_HTTP_PROXY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2010-11-21 15:17:48 -01:00
--apt-indices)
LB_APT_INDICES="${2}"
shift 2
;;
2008-02-21 18:03:57 -01:00
--apt-options)
APT_OPTIONS="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
--apt-pipeline)
2010-09-07 13:11:20 +00:00
LB_APT_PIPELINE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--apt-recommends)
2010-09-07 13:11:20 +00:00
LB_APT_RECOMMENDS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--apt-secure)
2010-09-07 13:11:20 +00:00
LB_APT_SECURE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2011-08-24 21:30:22 +00:00
--apt-source-archives)
LB_APT_SOURCE_ARCHIVES="${2}"
2011-08-24 18:34:01 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--aptitude-options)
APTITUDE_OPTIONS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
-a|--architecture|--architectures)
2020-04-01 09:58:47 +00:00
LB_ARCHITECTURE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--archive-areas)
LB_ARCHIVE_AREAS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--backports)
LB_BACKPORTS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--binary-filesystem)
LB_BINARY_FILESYSTEM="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
-b|--binary-image|--binary-images)
LIVE_IMAGE_TYPE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--bootappend-install)
LB_BOOTAPPEND_INSTALL="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--bootappend-live)
LB_BOOTAPPEND_LIVE="${2}"
2011-06-13 18:38:44 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--bootappend-live-failsafe)
LB_BOOTAPPEND_LIVE_FAILSAFE="${2}"
2011-02-09 09:37:21 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--bootloaders|--bootloader)
LB_BOOTLOADERS="${2}"
2007-11-12 20:43:28 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--bootstrap-qemu-arch)
2020-04-01 10:25:56 +00:00
LB_BOOTSTRAP_QEMU_ARCHITECTURE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--bootstrap-qemu-exclude)
LB_BOOTSTRAP_QEMU_EXCLUDE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--bootstrap-qemu-static)
LB_BOOTSTRAP_QEMU_STATIC="${2}"
2011-09-29 22:56:49 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--build-with-chroot)
LB_BUILD_WITH_CHROOT="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--cache)
LB_CACHE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--cache-indices)
LB_CACHE_INDICES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--cache-packages)
LB_CACHE_PACKAGES="${2}"
2011-01-07 19:56:33 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--cache-stages)
LB_CACHE_STAGES="${2}"
2019-12-19 16:18:44 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--checksums)
LB_CHECKSUMS="${2}"
2019-12-19 16:18:44 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--chroot-filesystem)
LB_CHROOT_FILESYSTEM="${2}"
2019-12-19 16:18:44 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--compression)
LB_COMPRESSION="${2}"
2019-12-19 16:18:44 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--debconf-frontend)
LB_DEBCONF_FRONTEND="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--debconf-priority)
LB_DEBCONF_PRIORITY="${2}"
2008-02-21 18:52:37 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--debian-installer)
LB_DEBIAN_INSTALLER="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--debian-installer-distribution)
LB_DEBIAN_INSTALLER_DISTRIBUTION="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--debian-installer-gui)
LB_DEBIAN_INSTALLER_GUI="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--debian-installer-preseedfile)
LB_DEBIAN_INSTALLER_PRESEEDFILE="${2}"
2010-03-04 11:22:15 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--debootstrap-options)
DEBOOTSTRAP_OPTIONS="${2}"
2011-02-14 11:48:45 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--debootstrap-script)
DEBOOTSTRAP_SCRIPT="${2}"
2011-02-14 11:48:45 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
-d|--distribution)
LB_DISTRIBUTION="${2}"
2011-02-14 11:48:45 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--distribution-binary)
LB_DISTRIBUTION_BINARY="${2}"
2011-02-14 11:48:45 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--distribution-chroot)
LB_DISTRIBUTION_CHROOT="${2}"
2011-02-14 11:48:45 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--fdisk)
Echo_warning "--fdisk is an obsolete option"
2011-02-14 11:48:45 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--firmware-binary)
LB_FIRMWARE_BINARY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--firmware-chroot)
LB_FIRMWARE_CHROOT="${2}"
2011-03-24 18:25:34 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--grub-splash)
Echo_warning "--grub-splash is an obsolete option"
2007-09-23 08:05:17 +00:00
shift 2
;;
2009-09-11 07:39:13 +00:00
--gzip-options)
GZIP_OPTIONS="${2}"
shift 2
;;
2020-03-28 06:08:37 -01:00
--hdd-label)
LB_HDD_LABEL="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--hdd-partition-start)
LB_HDD_PARTITION_START="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--hdd-size)
LB_HDD_SIZE="${2}"
2010-03-06 15:23:59 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--image-name)
LIVE_IMAGE_NAME="${2}"
2010-09-16 12:15:30 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--initramfs)
LB_INITRAMFS="${2}"
2007-11-16 21:01:03 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--initramfs-compression)
LB_INITRAMFS_COMPRESSION="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--initsystem)
LB_INITSYSTEM="${2}"
2007-09-23 12:05:12 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--interactive)
LB_INTERACTIVE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--iso-application)
LB_ISO_APPLICATION="${2}"
2012-04-27 18:31:49 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--iso-preparer)
LB_ISO_PREPARER="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--iso-publisher)
LB_ISO_PUBLISHER="${2}"
2007-11-12 21:00:48 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--iso-volume)
LB_ISO_VOLUME="${2}"
2011-01-01 22:36:20 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--isohybrid-options)
2020-03-28 11:22:26 -01:00
Echo_warning "--isohybrid-options is an obsolete option"
2012-07-28 17:17:53 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--jffs2-eraseblock)
LB_JFFS2_ERASEBLOCK="${2}"
2012-07-18 17:09:16 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--keyring-packages)
LB_KEYRING_PACKAGES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
-k|--linux-flavours)
LB_LINUX_FLAVOURS_WITH_ARCH="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--linux-packages)
LB_LINUX_PACKAGES="${2}"
2008-08-10 00:38:06 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--loadlin)
LB_LOADLIN="${2}"
2011-02-14 11:48:45 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--losetup)
Echo_warning "--losetup is an obsolete option"
2008-08-12 20:04:25 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--memtest)
LB_MEMTEST="${2}"
2009-09-02 05:39:13 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--mirror-binary)
LB_MIRROR_BINARY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--mirror-binary-security)
LB_MIRROR_BINARY_SECURITY="${2}"
2010-05-21 05:31:16 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--mirror-bootstrap)
LB_MIRROR_BOOTSTRAP="${2}"
2011-09-12 07:19:30 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--mirror-chroot)
LB_MIRROR_CHROOT="${2}"
2011-09-28 09:37:56 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--mirror-chroot-security)
LB_MIRROR_CHROOT_SECURITY="${2}"
2015-07-16 07:58:46 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--mirror-debian-installer)
LB_MIRROR_DEBIAN_INSTALLER="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--mode)
LB_MODE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--net-cow-filesystem)
2020-03-28 11:25:34 -01:00
Echo_warning "--net-cow-filesystem is an obsolete option"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--net-cow-mountoptions)
2020-03-28 11:25:34 -01:00
Echo_warning "--net-cow-mountoptions is an obsolete option"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--net-cow-path)
2020-03-28 11:25:34 -01:00
Echo_warning "--net-cow-path is an obsolete option"
2008-03-01 11:19:54 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--net-cow-server)
2020-03-28 11:25:34 -01:00
Echo_warning "--net-cow-server is an obsolete option"
2007-09-23 08:05:17 +00:00
shift 2
;;
2007-10-30 17:17:16 -01:00
--net-root-filesystem)
2020-03-28 11:35:26 -01:00
Echo_warning "--net-root-filesystem is an obsolete option"
2007-09-23 08:05:17 +00:00
shift 2
;;
2007-10-30 17:17:16 -01:00
--net-root-mountoptions)
2020-03-28 11:35:26 -01:00
Echo_warning "--net-root-mountoptions is an obsolete option"
2007-09-23 08:05:17 +00:00
shift 2
;;
2007-10-30 17:17:16 -01:00
--net-root-path)
2020-04-23 13:44:17 +00:00
Echo_warning "--net-root-path is an obsolete option"
2007-09-23 08:05:17 +00:00
shift 2
;;
2007-10-30 17:17:16 -01:00
--net-root-server)
2020-03-28 11:35:26 -01:00
Echo_warning "--net-root-server is an obsolete option"
2007-10-30 17:17:16 -01:00
shift 2
;;
2008-02-26 17:57:41 -01:00
--net-tarball)
2010-09-07 13:11:20 +00:00
LB_NET_TARBALL="${2}"
2008-02-26 17:57:41 -01:00
shift 2
;;
2018-03-16 18:30:50 -01:00
--onie)
LB_ONIE="${2}"
shift 2
;;
--onie-kernel-cmdline)
LB_ONIE_KERNEL_CMDLINE="${2}"
shift 2
;;
2020-03-28 06:08:37 -01:00
--parent-archive-areas)
LB_PARENT_ARCHIVE_AREAS="${2}"
2012-04-26 17:52:15 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--parent-debian-installer-distribution)
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${2}"
2012-04-26 20:27:56 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--parent-distribution)
LB_PARENT_DISTRIBUTION="${2}"
2011-06-08 10:30:29 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--parent-distribution-binary)
LB_PARENT_DISTRIBUTION_BINARY="${2}"
2011-06-08 10:30:29 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--parent-distribution-chroot)
LB_PARENT_DISTRIBUTION_CHROOT="${2}"
2018-02-27 18:28:33 -01:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--parent-mirror-binary)
LB_PARENT_MIRROR_BINARY="${2}"
2012-09-29 11:20:21 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--parent-mirror-binary-security)
LB_PARENT_MIRROR_BINARY_SECURITY="${2}"
2008-08-14 19:33:56 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
-m|--parent-mirror-bootstrap)
LB_PARENT_MIRROR_BOOTSTRAP="${2}"
2011-09-30 22:24:08 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--parent-mirror-chroot)
LB_PARENT_MIRROR_CHROOT="${2}"
2011-09-30 22:24:08 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--parent-mirror-chroot-security)
LB_PARENT_MIRROR_CHROOT_SECURITY="${2}"
2011-09-30 22:24:08 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--parent-mirror-debian-installer)
LB_PARENT_MIRROR_DEBIAN_INSTALLER="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--security)
LB_SECURITY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
--source)
LB_SOURCE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
2020-03-28 06:08:37 -01:00
-s|--source-images)
LB_SOURCE_IMAGES="${2}"
shift 2
2008-11-01 14:31:26 -01:00
;;
2020-03-28 06:08:37 -01:00
--swap-file-path)
LB_SWAP_FILE_PATH="${2}"
shift 2
2020-03-11 20:30:58 -01:00
;;
2020-03-28 06:08:37 -01:00
--swap-file-size)
LB_SWAP_FILE_SIZE="${2}"
shift 2
2007-09-23 08:05:17 +00:00
;;
2020-03-28 06:08:37 -01:00
--system)
LB_SYSTEM="${2}"
shift 2
2007-09-23 08:05:17 +00:00
;;
2020-03-28 06:08:37 -01:00
--tasksel)
2020-03-28 11:55:53 -01:00
Echo_warning "--tasksel is an obsolete option"
2020-03-28 06:08:37 -01:00
shift 2
2007-09-23 08:05:17 +00:00
;;
2020-03-28 06:08:37 -01:00
--uefi-secure-boot)
LB_UEFI_SECURE_BOOT="${2}"
shift 2
2008-07-08 23:13:09 +00:00
;;
2020-03-28 06:08:37 -01:00
--updates)
LB_UPDATES="${2}"
shift 2
2007-09-23 08:05:17 +00:00
;;
2020-03-28 06:08:37 -01:00
--win32-loader)
LB_WIN32_LOADER="${2}"
shift 2
2007-09-23 08:05:17 +00:00
;;
2020-03-28 06:08:37 -01:00
--zsync)
LB_ZSYNC="${2}"
shift 2
2007-09-23 08:05:17 +00:00
;;
2020-03-28 06:08:37 -01:00
# Other
2007-09-23 08:05:17 +00:00
--)
shift
break
;;
*)
2020-03-28 06:09:53 -01:00
Echo_error "Internal error, unhandled option: %s" "${1}"
2007-09-23 08:05:17 +00:00
exit 1
;;
esac
done
}
2020-02-25 10:41:25 -01:00
# Processing args such that we have a value for --config if given
# We can thus momentarily print an appropriate message that we are ignoring it under certain circumstances
2012-07-28 17:23:23 +00:00
Local_arguments "${@}"
2020-02-25 10:41:25 -01:00
# Ignoring --config if CWD is already a git repo
# Only print warning from direct execution, not when run from auto script redirection, to avoid repetition
2012-07-28 18:37:19 +00:00
if [ -e .git ] && [ -n "${_CONFIG}" ]
2012-07-28 17:23:23 +00:00
then
2012-07-29 23:16:29 +00:00
if [ "${1}" != "noauto" ]
then
Echo_message "Ignoring --config ${_CONFIG}: ${PWD} is already a git repository"
fi
2012-07-28 17:23:23 +00:00
_CONFIG=""
fi
2020-02-25 10:41:25 -01:00
# Ignoring --config if CWD already has a config
# Only print warning from direct execution, not when run from auto script redirection, to avoid repetition
2012-12-13 17:04:14 -01:00
if [ -e .build/config ] && [ -n "${_CONFIG}" ]
then
if [ "${1}" != "noauto" ]
then
Echo_message "Ignoring --config ${_CONFIG}: ${PWD} is already a live-build configuration tree"
fi
_CONFIG=""
fi
2020-02-25 10:41:25 -01:00
# Otherwise, handling --config request, copying specified config
2013-05-06 12:48:46 +00:00
if [ -n "${_CONFIG}" ]
2012-12-13 17:04:14 -01:00
then
2012-12-13 16:51:54 -01:00
if [ -e "${_CONFIG}" ] || [ -e "/usr/share/live/images/${_CONFIG}" ]
2012-07-29 21:26:15 +00:00
then
2012-12-13 16:51:54 -01:00
if [ ! -e "${_CONFIG}" ] && [ -e "/usr/share/live/images/${_CONFIG}" ]
then
_CONFIG="/usr/share/live/images/${_CONFIG}"
fi
Echo_message "Copying ${_CONFIG}"
tar -C "${_CONFIG}" -c . | tar -C ./ -x
else
_GIT_REPOSITORY="$(echo ${_CONFIG} | sed -e 's|::.*$||')"
Echo_message "Cloning ${_GIT_REPOSITORY}"
git clone ${_GIT_REPOSITORY} ./
if [ "${_GIT_REPOSITORY}" != "${_CONFIG}" ]
then
_GIT_BRANCH="$(echo ${_CONFIG} | awk -F\:\: '{ print $NF }')"
Echo_message "Checking out ${_GIT_BRANCH}"
git checkout ${_GIT_BRANCH}
fi
2012-07-29 21:26:15 +00:00
fi
2012-07-29 22:33:33 +00:00
if [ -e auto/config ]
then
_EXTRA_OPTIONS="$(echo ${@} | sed -e "s|--config ${_GIT_REPOSITORY}::${_GIT_BRANCH}||g" -e "s|--config ${_GIT_REPOSITORY}||g")"
Echo_message "The following extra options specified to lb config are going to be added to auto/config: ${_EXTRA_OPTIONS}"
sed -i -e "s|\"\${@}\"|${_EXTRA_OPTIONS} \"\${@}\"|" auto/config
fi
2012-07-28 17:23:23 +00:00
fi
2020-02-25 10:41:25 -01:00
# "Auto" script redirection.
# Re-run via "auto" script to pick up saved command-line arguments, if not already redirected.
# See the documentation of the Maybe_auto_redirect function for more details.
2020-02-22 01:46:28 -01:00
if [ "${1}" = "noauto" ]; then
2012-07-28 17:23:23 +00:00
shift
2020-02-22 01:46:28 -01:00
else
Maybe_auto_redirect config
2012-07-28 17:23:23 +00:00
fi
2020-02-25 10:41:25 -01:00
# Reading config defaults configured at system level
2013-02-19 08:00:45 -01:00
if ls /etc/live/build.conf > /dev/null 2>&1 || ls /etc/live/build/* > /dev/null 2>&1
2008-06-10 17:04:23 +00:00
then
2013-02-19 08:00:45 -01:00
if In_list "--ignore-system-defaults" "${@}"
then
Echo_message "Ignoring defaults in %s" "/etc/live/build.conf"
else
Echo_message "Using defaults in %s" "/etc/live/build.conf"
2010-09-07 14:22:59 +00:00
2013-02-19 08:00:45 -01:00
Read_conffiles /etc/live/build.conf /etc/live/build/*
fi
2008-06-10 17:04:23 +00:00
fi
2020-02-25 10:41:25 -01:00
# Reading existing saved configuration
2015-02-05 02:30:47 -01:00
Read_conffiles $(Common_config_files)
2007-09-23 08:04:47 +00:00
2020-02-25 10:41:25 -01:00
# Processing arguments again to overwrite just-read previously saved settings as necessary
2009-01-30 19:17:00 -01:00
Local_arguments "${@}"
2008-08-10 19:13:33 +00:00
2020-02-25 10:41:25 -01:00
# Loading user specified saved config file if specified
2008-11-02 15:22:56 -01:00
if [ -n "${_CONFFILE}" ]
2007-09-23 08:05:17 +00:00
then
2008-11-02 15:22:56 -01:00
Read_conffiles "${_CONFFILE}"
2007-09-23 08:05:17 +00:00
fi
2020-03-28 04:37:14 -01:00
# Setting and validating config
2020-03-28 04:42:34 -01:00
Prepare_config
2020-03-28 04:37:14 -01:00
Validate_config
2007-11-11 12:14:25 -01:00
2020-03-28 05:11:15 -01:00
if [ "${_VALIDATE_MODE}" = "true" ]; then
Echo_message "Validation check complete! Please address any problem notices given above."
exit 0
fi
2020-02-25 10:41:25 -01:00
# Creating or updating saved config
2009-11-13 12:52:43 -01:00
if [ ! -e config ]
then
2020-04-01 09:58:47 +00:00
Echo_message "Creating config tree for a ${LB_MODE}/${LB_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE} system"
2014-08-27 21:14:12 +00:00
mkdir config
2009-11-13 12:52:43 -01:00
else
2020-04-01 09:58:47 +00:00
Echo_message "Updating config tree for a ${LB_MODE}/${LB_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE} system"
2009-11-13 12:52:43 -01:00
fi
2009-10-20 19:02:14 +00:00
2010-09-02 11:22:22 +00:00
# Creating live-build configuration
2007-09-23 08:05:17 +00:00
cat > config/common << EOF
2010-09-02 11:22:22 +00:00
# config/common - common options for live-build(7)
2007-09-23 08:04:49 +00:00
config: revert partial format conversion
back in v4.0~a6-1 a transition process was started to move the live-build
config to a new format. the new format was INI style, and required
parsing functions to read/write values, compared to the existing format
which was just shell script code setting variables.
this partial transition is the explanation for the existence of the
`New_configuration()` function, and understanding this is important to
understanding the purpose of it - it is not in fact intended for creating
a new configuration, it is just related to the new config format
transition.
the positives of the new format were that it was somewhat cleaner looking,
while the negative was the terrible relative efficiency.
the file `config/build` was created to hold options in this new format.
the transition was only ever completed for a handful of config options:
- architecture
- archive areas and parent archive areas
- live image name
- live image type
a 'configuration version' attribute was also saved, which is not used by
anything.
the bootstrap-mirror and parent-bootstrap-mirror attributes are pointlessly
stored in it seemingly resulting from work done in v4.0~a17-1. (they are
also stored in another config file from which the value is actually used).
it in fact seems to have been a source of confusion for Raphaël in
authoring 44b9b0a6501476de594ce3783cea5df0c141478c, since the new
`[parent]-distribution-{chroot|binary}` options it introduced were stored
both in `config/bootstrap` and in `config/build`, while only used from the
former. i expect, understandably, that he thought that `config/build` was
just an information file.
Gbp-Dch: Short
2020-04-06 15:49:08 +00:00
# \$LIVE_CONFIGURATION_VERSION: version of live-build used to build config (config format version)
LIVE_CONFIGURATION_VERSION="${LIVE_CONFIGURATION_VERSION}"
2010-09-07 13:11:20 +00:00
# \$LB_APT: set package manager
LB_APT="${LB_APT}"
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_APT_FTP_PROXY: set apt/aptitude ftp proxy
LB_APT_FTP_PROXY="${LB_APT_FTP_PROXY}"
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_APT_HTTP_PROXY: set apt/aptitude http proxy
LB_APT_HTTP_PROXY="${LB_APT_HTTP_PROXY}"
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_APT_PIPELINE: set apt/aptitude pipeline depth
LB_APT_PIPELINE="${LB_APT_PIPELINE}"
2007-09-23 08:05:11 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_APT_RECOMMENDS: set apt/aptitude recommends
LB_APT_RECOMMENDS="${LB_APT_RECOMMENDS}"
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_APT_SECURE: set apt/aptitude security
LB_APT_SECURE="${LB_APT_SECURE}"
2007-09-23 08:04:48 +00:00
2011-08-24 21:30:22 +00:00
# \$LB_APT_SOURCE_ARCHIVES: set apt/aptitude source entries in sources.list
LB_APT_SOURCE_ARCHIVES="${LB_APT_SOURCE_ARCHIVES}"
2011-08-24 18:34:01 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_CACHE: control cache
LB_CACHE="${LB_CACHE}"
2007-09-23 08:05:17 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_CACHE_INDICES: control if downloaded package indices should be cached
LB_CACHE_INDICES="${LB_CACHE_INDICES}"
2007-09-23 08:04:52 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_CACHE_PACKAGES: control if downloaded packages files should be cached
LB_CACHE_PACKAGES="${LB_CACHE_PACKAGES}"
2007-09-23 08:04:52 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_CACHE_STAGES: control if completed stages should be cached
LB_CACHE_STAGES="${LB_CACHE_STAGES}"
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_DEBCONF_FRONTEND: set debconf(1) frontend to use
LB_DEBCONF_FRONTEND="${LB_DEBCONF_FRONTEND}"
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_DEBCONF_PRIORITY: set debconf(1) priority to use
LB_DEBCONF_PRIORITY="${LB_DEBCONF_PRIORITY}"
2007-09-23 08:05:10 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_INITRAMFS: set initramfs hook
LB_INITRAMFS="${LB_INITRAMFS}"
2007-09-23 08:05:10 +00:00
2011-06-13 18:38:44 +00:00
# \$LB_INITRAMFS_COMPRESSION: set initramfs compression
LB_INITRAMFS_COMPRESSION="${LB_INITRAMFS_COMPRESSION}"
2011-02-09 09:37:21 -01:00
# \$LB_INITSYSTEM: set init system
LB_INITSYSTEM="${LB_INITSYSTEM}"
2010-09-07 13:11:20 +00:00
# \$LB_MODE: set distribution mode
LB_MODE="${LB_MODE}"
2007-09-23 08:05:10 +00:00
2011-09-29 22:56:49 +00:00
# \$LB_SYSTEM: set system type
LB_SYSTEM="${LB_SYSTEM}"
config: revert partial format conversion
back in v4.0~a6-1 a transition process was started to move the live-build
config to a new format. the new format was INI style, and required
parsing functions to read/write values, compared to the existing format
which was just shell script code setting variables.
this partial transition is the explanation for the existence of the
`New_configuration()` function, and understanding this is important to
understanding the purpose of it - it is not in fact intended for creating
a new configuration, it is just related to the new config format
transition.
the positives of the new format were that it was somewhat cleaner looking,
while the negative was the terrible relative efficiency.
the file `config/build` was created to hold options in this new format.
the transition was only ever completed for a handful of config options:
- architecture
- archive areas and parent archive areas
- live image name
- live image type
a 'configuration version' attribute was also saved, which is not used by
anything.
the bootstrap-mirror and parent-bootstrap-mirror attributes are pointlessly
stored in it seemingly resulting from work done in v4.0~a17-1. (they are
also stored in another config file from which the value is actually used).
it in fact seems to have been a source of confusion for Raphaël in
authoring 44b9b0a6501476de594ce3783cea5df0c141478c, since the new
`[parent]-distribution-{chroot|binary}` options it introduced were stored
both in `config/bootstrap` and in `config/build`, while only used from the
former. i expect, understandably, that he thought that `config/build` was
just an information file.
Gbp-Dch: Short
2020-04-06 15:49:08 +00:00
# \$LIVE_IMAGE_NAME: set base name of the image
LIVE_IMAGE_NAME="${LIVE_IMAGE_NAME}"
2010-09-02 12:40:28 +00:00
# live-build options
2007-09-23 08:04:49 +00:00
2008-11-01 13:10:34 -01:00
# \$_BREAKPOINTS: enable breakpoints
2019-05-29 12:32:27 +00:00
# If set here, overrides the command line option
2008-11-01 13:10:34 -01:00
#_BREAKPOINTS="${_BREAKPOINTS}"
2007-09-23 08:04:49 +00:00
2008-11-01 12:57:17 -01:00
# \$_DEBUG: enable debug
2019-05-29 12:32:27 +00:00
# If set here, overrides the command line option
2008-11-01 12:57:17 -01:00
#_DEBUG="${_DEBUG}"
2007-09-23 08:04:49 +00:00
2008-11-01 14:31:26 -01:00
# \$_COLOR: enable color
2019-05-29 12:32:27 +00:00
# If set here, overrides the command line option
2008-11-01 14:31:26 -01:00
#_COLOR="${_COLOR}"
2008-11-01 12:55:27 -01:00
# \$_FORCE: enable force
2019-05-29 12:32:27 +00:00
# If set here, overrides the command line option
2008-11-01 12:55:27 -01:00
#_FORCE="${_FORCE}"
2007-09-23 08:04:49 +00:00
2008-11-01 12:59:51 -01:00
# \$_QUIET: enable quiet
2019-05-29 12:32:27 +00:00
# If set here, overrides the command line option
#_QUIET="${_QUIET}"
2007-09-23 08:04:49 +00:00
2008-11-01 13:01:33 -01:00
# \$_VERBOSE: enable verbose
2019-05-29 12:32:27 +00:00
# If set here, overrides the command line option
2008-11-01 13:01:33 -01:00
#_VERBOSE="${_VERBOSE}"
2008-02-21 18:03:57 -01:00
# Internal stuff (FIXME)
APT_OPTIONS="${APT_OPTIONS}"
APTITUDE_OPTIONS="${APTITUDE_OPTIONS}"
2012-08-27 12:47:10 +00:00
DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS}"
2016-11-28 14:43:50 -01:00
DEBOOTSTRAP_SCRIPT="${DEBOOTSTRAP_SCRIPT}"
2009-09-11 07:39:13 +00:00
GZIP_OPTIONS="${GZIP_OPTIONS}"
2007-09-23 08:04:46 +00:00
EOF
2010-11-23 08:36:48 -01:00
# Creating lb_bootstrap_* configuration
2007-09-23 08:05:17 +00:00
cat > config/bootstrap << EOF
2010-09-02 11:22:22 +00:00
# config/bootstrap - options for live-build(7), bootstrap stage
2007-09-23 08:05:10 +00:00
config: revert partial format conversion
back in v4.0~a6-1 a transition process was started to move the live-build
config to a new format. the new format was INI style, and required
parsing functions to read/write values, compared to the existing format
which was just shell script code setting variables.
this partial transition is the explanation for the existence of the
`New_configuration()` function, and understanding this is important to
understanding the purpose of it - it is not in fact intended for creating
a new configuration, it is just related to the new config format
transition.
the positives of the new format were that it was somewhat cleaner looking,
while the negative was the terrible relative efficiency.
the file `config/build` was created to hold options in this new format.
the transition was only ever completed for a handful of config options:
- architecture
- archive areas and parent archive areas
- live image name
- live image type
a 'configuration version' attribute was also saved, which is not used by
anything.
the bootstrap-mirror and parent-bootstrap-mirror attributes are pointlessly
stored in it seemingly resulting from work done in v4.0~a17-1. (they are
also stored in another config file from which the value is actually used).
it in fact seems to have been a source of confusion for Raphaël in
authoring 44b9b0a6501476de594ce3783cea5df0c141478c, since the new
`[parent]-distribution-{chroot|binary}` options it introduced were stored
both in `config/bootstrap` and in `config/build`, while only used from the
former. i expect, understandably, that he thought that `config/build` was
just an information file.
Gbp-Dch: Short
2020-04-06 15:49:08 +00:00
# \$LB_ARCHITECTURE: select architecture to use
LB_ARCHITECTURE="${LB_ARCHITECTURE}"
2010-09-07 13:11:20 +00:00
# \$LB_DISTRIBUTION: select distribution to use
LB_DISTRIBUTION="${LB_DISTRIBUTION}"
2007-09-23 08:05:11 +00:00
2011-01-07 19:56:33 -01:00
# \$LB_PARENT_DISTRIBUTION: select parent distribution to use
LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION}"
2019-12-19 16:18:44 -01:00
# \$LB_DISTRIBUTION_CHROOT: select distribution to use in the chroot
LB_DISTRIBUTION_CHROOT="${LB_DISTRIBUTION_CHROOT}"
# \$LB_PARENT_DISTRIBUTION_CHROOT: select parent distribution to use in the chroot
LB_PARENT_DISTRIBUTION_CHROOT="${LB_PARENT_DISTRIBUTION_CHROOT}"
# \$LB_DISTRIBUTION_BINARY: select distribution to use in the final image
LB_DISTRIBUTION_BINARY="${LB_DISTRIBUTION_BINARY}"
# \$LB_PARENT_DISTRIBUTION_BINARY: select parent distribution to use in the final image
LB_PARENT_DISTRIBUTION_BINARY="${LB_PARENT_DISTRIBUTION_BINARY}"
2011-02-14 10:29:25 -01:00
# \$LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION: select parent distribution for debian-installer to use
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}"
config: revert partial format conversion
back in v4.0~a6-1 a transition process was started to move the live-build
config to a new format. the new format was INI style, and required
parsing functions to read/write values, compared to the existing format
which was just shell script code setting variables.
this partial transition is the explanation for the existence of the
`New_configuration()` function, and understanding this is important to
understanding the purpose of it - it is not in fact intended for creating
a new configuration, it is just related to the new config format
transition.
the positives of the new format were that it was somewhat cleaner looking,
while the negative was the terrible relative efficiency.
the file `config/build` was created to hold options in this new format.
the transition was only ever completed for a handful of config options:
- architecture
- archive areas and parent archive areas
- live image name
- live image type
a 'configuration version' attribute was also saved, which is not used by
anything.
the bootstrap-mirror and parent-bootstrap-mirror attributes are pointlessly
stored in it seemingly resulting from work done in v4.0~a17-1. (they are
also stored in another config file from which the value is actually used).
it in fact seems to have been a source of confusion for Raphaël in
authoring 44b9b0a6501476de594ce3783cea5df0c141478c, since the new
`[parent]-distribution-{chroot|binary}` options it introduced were stored
both in `config/bootstrap` and in `config/build`, while only used from the
former. i expect, understandably, that he thought that `config/build` was
just an information file.
Gbp-Dch: Short
2020-04-06 15:49:08 +00:00
# \$LB_ARCHIVE_AREAS: select archive areas to use
LB_ARCHIVE_AREAS="${LB_ARCHIVE_AREAS}"
# \$LB_PARENT_ARCHIVE_AREAS: select parent archive areas to use
LB_PARENT_ARCHIVE_AREAS="${LB_PARENT_ARCHIVE_AREAS}"
2011-02-14 11:11:26 -01:00
# \$LB_PARENT_MIRROR_BOOTSTRAP: set parent mirror to bootstrap from
LB_PARENT_MIRROR_BOOTSTRAP="${LB_PARENT_MIRROR_BOOTSTRAP}"
2007-09-23 08:05:10 +00:00
2011-02-14 11:11:26 -01:00
# \$LB_PARENT_MIRROR_CHROOT: set parent mirror to fetch packages from
LB_PARENT_MIRROR_CHROOT="${LB_PARENT_MIRROR_CHROOT}"
2008-02-21 18:52:37 -01:00
2011-02-14 11:11:26 -01:00
# \$LB_PARENT_MIRROR_CHROOT_SECURITY: set security parent mirror to fetch packages from
LB_PARENT_MIRROR_CHROOT_SECURITY="${LB_PARENT_MIRROR_CHROOT_SECURITY}"
2007-09-23 08:05:10 +00:00
2011-02-14 11:11:26 -01:00
# \$LB_PARENT_MIRROR_BINARY: set parent mirror which ends up in the image
LB_PARENT_MIRROR_BINARY="${LB_PARENT_MIRROR_BINARY}"
2007-09-23 08:05:10 +00:00
2011-02-14 11:11:26 -01:00
# \$LB_PARENT_MIRROR_BINARY_SECURITY: set security parent mirror which ends up in the image
LB_PARENT_MIRROR_BINARY_SECURITY="${LB_PARENT_MIRROR_BINARY_SECURITY}"
2007-09-23 08:05:10 +00:00
2011-02-14 11:11:26 -01:00
# \$LB_PARENT_MIRROR_DEBIAN_INSTALLER: set debian-installer parent mirror
LB_PARENT_MIRROR_DEBIAN_INSTALLER="${LB_PARENT_MIRROR_DEBIAN_INSTALLER}"
2010-03-04 11:22:15 -01:00
2011-02-14 11:48:45 -01:00
# \$LB_MIRROR_BOOTSTRAP: set mirror to bootstrap from
LB_MIRROR_BOOTSTRAP="${LB_MIRROR_BOOTSTRAP}"
# \$LB_MIRROR_CHROOT: set mirror to fetch packages from
LB_MIRROR_CHROOT="${LB_MIRROR_CHROOT}"
# \$LB_MIRROR_CHROOT_SECURITY: set security mirror to fetch packages from
LB_MIRROR_CHROOT_SECURITY="${LB_MIRROR_CHROOT_SECURITY}"
# \$LB_MIRROR_BINARY: set mirror which ends up in the image
LB_MIRROR_BINARY="${LB_MIRROR_BINARY}"
# \$LB_MIRROR_BINARY_SECURITY: set security mirror which ends up in the image
LB_MIRROR_BINARY_SECURITY="${LB_MIRROR_BINARY_SECURITY}"
# \$LB_MIRROR_DEBIAN_INSTALLER: set debian-installer mirror
LB_MIRROR_DEBIAN_INSTALLER="${LB_MIRROR_DEBIAN_INSTALLER}"
2020-04-01 10:25:56 +00:00
# \$LB_BOOTSTRAP_QEMU_ARCHITECTURE: architectures to use foreign bootstrap
LB_BOOTSTRAP_QEMU_ARCHITECTURE="${LB_BOOTSTRAP_QEMU_ARCHITECTURE}"
2011-09-30 22:24:08 +00:00
# \$LB_BOOTSTRAP_QEMU_EXCLUDE: packages to exclude during foreign bootstrap
LB_BOOTSTRAP_QEMU_EXCLUDE="${LB_BOOTSTRAP_QEMU_EXCLUDE}"
# \$LB_BOOTSTRAP_QEMU_STATIC: static qemu binary for foreign bootstrap
LB_BOOTSTRAP_QEMU_STATIC="${LB_BOOTSTRAP_QEMU_STATIC}"
2007-09-23 08:05:10 +00:00
EOF
2010-11-23 08:36:48 -01:00
# Creating lb_chroot_* configuration
2011-06-17 09:25:52 +00:00
mkdir -p config/archives
2012-10-22 18:27:13 +00:00
mkdir -p config/apt
2011-09-07 15:33:53 +00:00
mkdir -p config/packages
2011-09-07 13:59:48 +00:00
mkdir -p config/packages.chroot
2011-06-15 19:37:10 +00:00
mkdir -p config/package-lists
2011-09-28 07:53:58 +00:00
mkdir -p config/preseed
2007-09-23 08:05:10 +00:00
2007-09-23 08:05:17 +00:00
cat > config/chroot << EOF
2010-09-02 11:22:22 +00:00
# config/chroot - options for live-build(7), chroot stage
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_CHROOT_FILESYSTEM: set chroot filesystem
LB_CHROOT_FILESYSTEM="${LB_CHROOT_FILESYSTEM}"
2007-09-23 08:05:09 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_UNION_FILESYSTEM: set union filesystem
LB_UNION_FILESYSTEM="${LB_UNION_FILESYSTEM}"
2007-09-23 08:05:13 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_INTERACTIVE: set interactive build
LB_INTERACTIVE="${LB_INTERACTIVE}"
2007-09-23 08:05:09 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_KEYRING_PACKAGES: set keyring packages
LB_KEYRING_PACKAGES="${LB_KEYRING_PACKAGES}"
2007-09-23 08:04:49 +00:00
2017-12-15 16:22:57 -01:00
# \$LB_LINUX_FLAVOURS_WITH_ARCH: set kernel flavour to use (with arch)
LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS_WITH_ARCH}"
2007-09-23 08:05:10 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_LINUX_PACKAGES: set kernel packages to use
LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES}"
2007-09-23 08:05:10 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_SECURITY: enable security updates
LB_SECURITY="${LB_SECURITY}"
2007-09-23 08:04:46 +00:00
2012-09-20 14:53:03 +00:00
# \$LB_UPDATES: enable updates updates
LB_UPDATES="${LB_UPDATES}"
2010-03-06 15:23:59 -01:00
2010-09-16 12:15:30 +00:00
# \$LB_BACKPORTS: enable backports updates
LB_BACKPORTS="${LB_BACKPORTS}"
2007-09-23 08:04:46 +00:00
EOF
2010-11-23 08:36:48 -01:00
# Creating lb_binary_* configuration
2012-10-22 18:30:41 +00:00
mkdir -p config/debian-installer
2013-06-24 12:27:48 +00:00
mkdir -p config/includes.installer
2011-09-07 14:41:40 +00:00
mkdir -p config/packages.binary
2011-06-15 19:37:10 +00:00
mkdir -p config/package-lists
2012-10-22 18:41:40 +00:00
mkdir -p config/rootfs
2020-03-27 02:47:35 -01:00
mkdir -p config/bootloaders
2007-09-23 08:05:17 +00:00
cat > config/binary << EOF
2010-09-02 11:22:22 +00:00
# config/binary - options for live-build(7), binary stage
2007-09-23 08:05:10 +00:00
config: revert partial format conversion
back in v4.0~a6-1 a transition process was started to move the live-build
config to a new format. the new format was INI style, and required
parsing functions to read/write values, compared to the existing format
which was just shell script code setting variables.
this partial transition is the explanation for the existence of the
`New_configuration()` function, and understanding this is important to
understanding the purpose of it - it is not in fact intended for creating
a new configuration, it is just related to the new config format
transition.
the positives of the new format were that it was somewhat cleaner looking,
while the negative was the terrible relative efficiency.
the file `config/build` was created to hold options in this new format.
the transition was only ever completed for a handful of config options:
- architecture
- archive areas and parent archive areas
- live image name
- live image type
a 'configuration version' attribute was also saved, which is not used by
anything.
the bootstrap-mirror and parent-bootstrap-mirror attributes are pointlessly
stored in it seemingly resulting from work done in v4.0~a17-1. (they are
also stored in another config file from which the value is actually used).
it in fact seems to have been a source of confusion for Raphaël in
authoring 44b9b0a6501476de594ce3783cea5df0c141478c, since the new
`[parent]-distribution-{chroot|binary}` options it introduced were stored
both in `config/bootstrap` and in `config/build`, while only used from the
former. i expect, understandably, that he thought that `config/build` was
just an information file.
Gbp-Dch: Short
2020-04-06 15:49:08 +00:00
# \$LIVE_IMAGE_TYPE: set image type
LIVE_IMAGE_TYPE="${LIVE_IMAGE_TYPE}"
2010-09-07 13:11:20 +00:00
# \$LB_BINARY_FILESYSTEM: set image filesystem
LB_BINARY_FILESYSTEM="${LB_BINARY_FILESYSTEM}"
2007-11-16 21:01:03 -01:00
2010-11-21 15:17:48 -01:00
# \$LB_APT_INDICES: set apt/aptitude generic indices
LB_APT_INDICES="${LB_APT_INDICES}"
2007-09-23 08:05:09 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_BOOTAPPEND_LIVE: set boot parameters
LB_BOOTAPPEND_LIVE="${LB_BOOTAPPEND_LIVE}"
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_BOOTAPPEND_INSTALL: set boot parameters
LB_BOOTAPPEND_INSTALL="${LB_BOOTAPPEND_INSTALL}"
2007-09-23 12:05:13 +00:00
2012-10-08 17:51:23 +00:00
# \$LB_BOOTAPPEND_LIVE_FAILSAFE: set boot parameters
LB_BOOTAPPEND_LIVE_FAILSAFE="${LB_BOOTAPPEND_LIVE_FAILSAFE}"
2012-04-27 18:31:49 +00:00
2015-08-21 21:54:46 +00:00
# \$LB_BOOTLOADERS: set bootloaders
LB_BOOTLOADERS="${LB_BOOTLOADERS}"
2007-09-23 08:05:10 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_CHECKSUMS: set checksums
LB_CHECKSUMS="${LB_CHECKSUMS}"
2007-11-12 21:00:48 -01:00
2011-01-01 22:36:20 -01:00
# \$LB_COMPRESSION: set compression
LB_COMPRESSION="${LB_COMPRESSION}"
2012-07-18 17:09:16 +00:00
# \$LB_ZSYNC: set zsync
LB_ZSYNC="${LB_ZSYNC}"
2010-09-07 13:11:20 +00:00
# \${LB_BUILD_WITH_CHROOT: control if we build binary images chrooted
2009-12-13 19:17:45 -01:00
# DO NEVER, *NEVER*, *N*E*V*E*R* SET THIS OPTION to false.
2010-09-07 13:11:20 +00:00
LB_BUILD_WITH_CHROOT="${LB_BUILD_WITH_CHROOT}"
2007-09-23 08:05:15 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_DEBIAN_INSTALLER: set debian-installer
LB_DEBIAN_INSTALLER="${LB_DEBIAN_INSTALLER}"
2007-09-23 08:05:10 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_DEBIAN_INSTALLER_DISTRIBUTION: set debian-installer suite
LB_DEBIAN_INSTALLER_DISTRIBUTION="${LB_DEBIAN_INSTALLER_DISTRIBUTION}"
2008-08-10 00:38:06 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_DEBIAN_INSTALLER_PRESEEDFILE: set debian-installer preseed filename/url
LB_DEBIAN_INSTALLER_PRESEEDFILE="${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
2008-08-12 20:04:25 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_DEBIAN_INSTALLER_GUI: toggle use of GUI debian-installer
LB_DEBIAN_INSTALLER_GUI="${LB_DEBIAN_INSTALLER_GUI}"
2009-09-02 05:39:13 +00:00
2011-09-12 07:19:30 +00:00
# \$LB_HDD_LABEL: set hdd label
LB_HDD_LABEL="${LB_HDD_LABEL}"
2011-09-28 09:37:56 +00:00
# \$LB_HDD_SIZE: set hdd filesystem size
LB_HDD_SIZE="${LB_HDD_SIZE}"
2011-09-12 07:19:30 +00:00
2015-07-16 07:58:46 +00:00
# \$LB_HDD_PARTITION_START: set start of partition for the hdd target for BIOSes that expect a specific boot partition start (e.g. "63s"). If empty, use optimal layout.
LB_HDD_PARTITION_START="${LB_HDD_PARTITION_START}"
2010-09-07 13:11:20 +00:00
# \$LB_ISO_APPLICATION: set iso author
LB_ISO_APPLICATION="${LB_ISO_APPLICATION}"
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_ISO_PREPARER: set iso preparer
LB_ISO_PREPARER="${LB_ISO_PREPARER}"
2007-09-23 08:05:10 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_ISO_PUBLISHER: set iso publisher
LB_ISO_PUBLISHER="${LB_ISO_PUBLISHER}"
2007-09-23 08:04:52 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_ISO_VOLUME: set iso volume (max 32 chars)
LB_ISO_VOLUME="${LB_ISO_VOLUME}"
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_JFFS2_ERASEBLOCK: set jffs2 eraseblock size
LB_JFFS2_ERASEBLOCK=""
2008-03-01 11:19:54 -01:00
2010-09-07 13:11:20 +00:00
# \$LB_MEMTEST: set memtest
LB_MEMTEST="${LB_MEMTEST}"
2007-09-23 08:04:46 +00:00
2012-09-29 11:20:21 +00:00
# \$LB_LOADLIN: set loadlin
LB_LOADLIN="${LB_LOADLIN}"
2010-09-07 13:11:20 +00:00
# \$LB_WIN32_LOADER: set win32-loader
LB_WIN32_LOADER="${LB_WIN32_LOADER}"
2008-08-14 19:33:56 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_NET_TARBALL: set net tarball
LB_NET_TARBALL="${LB_NET_TARBALL}"
2008-02-26 17:57:41 -01:00
2018-03-16 18:30:50 -01:00
# \$LB_ONIE: set onie
LB_ONIE="${LB_ONIE}"
# \$LB_ONIE_KERNEL_CMDLINE: set onie additional kernel cmdline options
LB_ONIE_KERNEL_CMDLINE="${LB_ONIE_KERNEL_CMDLINE}"
2012-04-26 17:52:15 +00:00
# \$LB_FIRMWARE_BINARY: include firmware packages in debian-installer
LB_FIRMWARE_BINARY="${LB_FIRMWARE_BINARY}"
2020-02-25 09:29:28 -01:00
# \$LB_FIRMWARE_CHROOT: include firmware packages in the live image
2012-04-26 20:27:56 +00:00
LB_FIRMWARE_CHROOT="${LB_FIRMWARE_CHROOT}"
2011-06-08 10:30:29 +00:00
# \$LB_SWAP_FILE_PATH: set swap file path
LB_SWAP_FILE_PATH="${LB_SWAP_FILE_PATH}"
# \$LB_SWAP_FILE_SIZE: set swap file size
LB_SWAP_FILE_SIZE="${LB_SWAP_FILE_SIZE}"
2018-02-27 18:28:33 -01:00
# \$LB_UEFI_SECURE_BOOT: enable/disable UEFI secure boot
LB_UEFI_SECURE_BOOT="${LB_UEFI_SECURE_BOOT}"
2007-09-23 08:04:52 +00:00
EOF
2010-11-23 08:36:48 -01:00
# Creating lb_source_* configuration
2007-09-23 08:05:17 +00:00
cat > config/source << EOF
2010-09-02 11:22:22 +00:00
# config/source - options for live-build(7), source stage
2007-09-23 08:04:52 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_SOURCE: set source option
LB_SOURCE="${LB_SOURCE}"
2007-09-23 08:04:46 +00:00
2010-09-07 13:11:20 +00:00
# \$LB_SOURCE_IMAGES: set image type
LB_SOURCE_IMAGES="${LB_SOURCE_IMAGES}"
2007-09-23 08:04:46 +00:00
EOF
2007-09-23 08:05:12 +00:00
2012-06-04 08:56:37 +00:00
mkdir -p auto
2012-10-22 17:20:12 +00:00
mkdir -p local/bin
2008-09-17 09:07:44 +00:00
2010-09-07 14:25:58 +00:00
if [ "${_CLEAN}" = "true" ]
then
# Remove empty directories in config tree
2012-09-30 13:13:42 +00:00
rmdir --ignore-fail-on-non-empty auto > /dev/null 2>&1 || true
2010-09-16 22:47:25 +00:00
rmdir --ignore-fail-on-non-empty config/*/ > /dev/null 2>&1 || true
rmdir --ignore-fail-on-non-empty config > /dev/null 2>&1 || true
2012-09-30 13:13:42 +00:00
rmdir --ignore-fail-on-non-empty local/*/ > /dev/null 2>&1 || true
2012-06-04 08:56:37 +00:00
rmdir --ignore-fail-on-non-empty local > /dev/null 2>&1 || true
2010-09-07 14:25:58 +00:00
fi
2015-05-20 06:19:39 +00:00
mkdir -p config/hooks/normal config/hooks/live
2014-08-27 21:14:12 +00:00
mkdir -p config/includes config/includes.bootstrap config/includes.chroot config/includes.binary config/includes.source
Echo_message "Symlinking hooks..."
2015-06-05 19:35:59 +00:00
for _HOOK in "${LIVE_BUILD}"/share/hooks/normal/*.hook* /usr/share/live/build/hooks/normal/*.hook*
2015-05-20 06:19:39 +00:00
do
if [ -e "${_HOOK}" ] && [ ! -e "config/hooks/normal/$(basename ${_HOOK})" ]
then
ln -s "${_HOOK}" "config/hooks/normal/$(basename ${_HOOK})"
fi
done
2015-05-02 13:41:54 +00:00
for _HOOK in "${LIVE_BUILD}"/share/hooks/live/*.hook* /usr/share/live/build/hooks/live/*.hook*
2014-08-27 21:14:12 +00:00
do
2015-05-02 13:41:54 +00:00
if [ -e "${_HOOK}" ] && [ ! -e "config/hooks/live/$(basename ${_HOOK})" ]
2014-08-27 21:14:12 +00:00
then
2015-05-02 13:41:54 +00:00
ln -s "${_HOOK}" "config/hooks/live/$(basename ${_HOOK})"
2014-08-27 21:14:12 +00:00
fi
done
2014-09-04 02:49:05 +00:00
if [ ! -e config/package-lists/live.list.chroot ]
then
2014-12-10 05:45:14 -01:00
mkdir -p config/package-lists
2014-09-04 02:49:05 +00:00
2014-12-10 06:19:46 -01:00
case "${LB_INITRAMFS}" in
live-boot)
echo "live-boot" > config/package-lists/live.list.chroot
echo "live-config" >> config/package-lists/live.list.chroot
2014-12-10 06:38:42 -01:00
case "${LB_INITSYSTEM}" in
none)
# do nothing
2014-12-10 06:19:46 -01:00
;;
2014-12-10 06:38:42 -01:00
systemd)
echo "live-config-systemd" >> config/package-lists/live.list.chroot
;;
2015-05-03 14:12:28 +00:00
sysvinit)
2014-12-10 06:38:42 -01:00
echo "live-config-${LB_INITSYSTEM}" >> config/package-lists/live.list.chroot
echo "sysvinit-core" >> config/package-lists/live.list.chroot
2014-12-10 06:19:46 -01:00
;;
esac
;;
*)
;;
2014-09-09 18:54:25 +00:00
esac
2014-09-04 02:49:05 +00:00
fi
2008-10-14 19:32:50 +00:00
# Creating stage file
2020-03-13 16:11:53 -01:00
Create_stagefile