live-build/scripts/build/lb_config

1382 lines
32 KiB
Plaintext
Raw Normal View History

2007-09-23 08:04:40 +00:00
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
##
## live-build comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
2007-09-23 08:04:46 +00:00
set -e
# Including common functions
. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
# Read meta config
if [ "${1}" != "noauto" ] && [ -x auto/config ]
then
Echo_message "Executing auto/config script."
./auto/config ${@}
exit ${?}
fi
if [ "${1}" = "noauto" ]
then
shift
fi
2007-09-23 08:05:11 +00:00
# Setting static variables
DESCRIPTION="$(Echo 'create configuration for live-build(7)')"
2007-09-23 08:05:19 +00:00
USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--apt-ftp-proxy URL]\n\
\t [--apt-http-proxy URL]\n\
\t [--apt-pdiffs true|false]\n\
\t [--apt-options OPTION|\"OPTIONS\"]\n\
\t [--aptitude-options OPTION|\"OPTIONS\"]\n\
2007-09-23 08:05:19 +00:00
\t [--apt-pipeline FIXME]\n\
\t [--apt-recommends true|false]\n\
\t [--apt-secure true|false]\n\
2007-09-23 08:05:19 +00:00
\t [-a|--architecture ARCHITECTURE]\n\
\t [-b|--binary-images iso|net|tar|usb-hdd]\n\
\t [--binary-filesystem fat16|fat32]\n\
\t [--binary-indices true|false|none]\n\
2007-09-23 12:05:12 +00:00
\t [--bootappend-install PARAMETER|\"PARAMETERS\"]\n\
\t [--bootappend-live PARAMETER|\"PARAMETERS\"]\n\
2007-09-23 08:05:19 +00:00
\t [--bootloader grub|syslinux|yaboot]\n\
\t [--bootstrap cdebootstrap|cdebootstrap-static|debootstrap|copy]\n\
2007-09-23 08:05:19 +00:00
\t [--bootstrap-config FILE]\n\
\t [-f|--bootstrap-flavour minimal|standard]\n\
\t [--bootstrap-keyring PACKAGE]\n\
\t [--breakpoints]\n\
\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\
\t [--checksums md5|sha1|sha256|none]\n\
\t [--build-with-chroot true|false]\n\
\t [--chroot-filesystem ext2|ext3|squashfs|plain|jffs2]\n\
2007-09-23 08:05:19 +00:00
\t [-c|--conffile FILE]\n\
\t [--clean\n\
2007-09-23 08:05:19 +00:00
\t [--debconf-frontend dialog|editor|noninteractive|readline]\n\
\t [--debconf-nowarnings true|false]\n\
2007-09-23 08:05:19 +00:00
\t [--debconf-priority low|medium|high|critical]\n\
\t [--debian-installer true|cdrom|netinst|netboot|businesscard|live|false]\n\
\t [--debian-installer-distribution CODENAME|daily]\n\
\t [--debian-installer-preseedfile FILE|URL]\n\
\t [--debian-installer-gui true|false]\n\
2007-09-23 08:05:19 +00:00
\t [--debug]\n\
\t [-d|--distribution CODENAME]\n\
\t [--dump]\n\
\t [-e|--encryption false|aes128|aes192|aes256]\n\
\t [--fdisk fdisk|fdisk.dist]\n\
2007-09-23 08:05:19 +00:00
\t [--force]\n\
\t [--grub-splash FILE]\n\
\t [--gzip-options OPTION|\"OPTIONS\"]\n\
2007-09-23 08:05:19 +00:00
\t [--hooks FILE]\n\
\t [--hostname NAME]\n\
\t [--ignore-system-defaults]\n\
2007-09-23 08:05:19 +00:00
\t [--includes PATH]\n\
\t [--initramfs auto|live-initramfs|casper]\n\
\t [--interactive shell]\n\
\t [--isohybrid-options OPTION|\"OPTIONS\"]\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\
\t [--jffs2-eraseblock SIZE]\n\
2007-09-23 08:05:19 +00:00
\t [--keyring-packages PACKAGE|\"PACKAGES\"]\n\
\t [-l|--language LANGUAGE]\n\
\t [-k|--linux-flavours FLAVOUR|\"FLAVOURS\"]\n\
\t [--linux-packages \"PACKAGES\"]\n\
\t [--losetup losetup|losetup.orig]\n\
\t [--memtest memtest86+|memtest86]\n\
\t [-m|--mirror-bootstrap URL]\n\
2008-04-08 10:18:42 +00:00
\t [--mirror-chroot URL]\n\
\t [--mirror-chroot-security URL]\n\
\t [--mirror-chroot-volatile URL]\n\
\t [--mirror-chroot-backports URL]\n\
2008-04-08 10:18:42 +00:00
\t [--mirror-binary URL]\n\
\t [--mirror-binary-security URL]\n\
\t [--mirror-binary-volatile URL]\n\
\t [--mirror-binary-backports URL]\n\
\t [--mirror-debian-installer URL]\n\
\t [--mode debian|emdebian]\n\
\t [--net-root-filesystem nfs|cfs]\n\
\t [--net-root-mountoptions OPTIONS]\n\
\t [--net-root-path PATH]\n\
\t [--net-root-server IP|HOSTNAME]\n\
\t [--net-cow-filesystem nfs|cfs]\n\
\t [--net-cow-mountoptions OPTIONS]\n\
\t [--net-cow-path PATH]\n\
\t [--net-cow-server IP|HOSTNAME]\n\
\t [--net-tarball bzip2|gzip|tar|none]\n\
2007-09-23 08:05:19 +00:00
\t [-p|--packages-lists FILE]\n\
\t [--packages PACKAGE|\"PACKAGES\"]\n\
\t [--quiet]\n\
\t [-r|--repositories REPOSITORY|\"REPOSITORIES\"]\n\
2007-09-23 08:05:19 +00:00
\t [--root-command sudo]\n\
\t [--use-fakeroot true|false]\n\
2009-11-22 12:40:20 -01:00
\t [--archive-areas ARCHIVE_AREA|\"ARCHIVE_AREAS\"]\n\
\t [--security true|false]\n\
\t [--source true|false]\n\
2007-09-23 08:05:19 +00:00
\t [-s|--source-images iso|net|tar|usb-hdd]\n\
\t [--symlinks true|false]\n\
2007-09-23 08:05:19 +00:00
\t [--syslinux-splash FILE]\n\
\t [--syslinux-timeout SECONDS]\n\
\t [--syslinux-menu true|false]\n\
\t [--sysvinit true|false]\n\
2007-09-23 08:05:19 +00:00
\t [--tasksel aptitude|tasksel]\n\
\t [--tasks TASK]\n\
\t [--templates PATH]\n\
\t [--virtual-root-size MB]\n\
\t [--volatile true|false]\n\
\t [--backports true|false]\n\
\t [--exposed-root true|false]\n\
2007-09-23 08:05:19 +00:00
\t [--username NAME]\n\
\t [--verbose]\n\
\t [--win32-loader true|false]"
2007-09-23 08:04:48 +00:00
2007-09-23 08:05:17 +00:00
Local_arguments ()
{
LONG_OPTIONS="apt:,apt-ftp-proxy:,apt-http-proxy:,apt-pdiffs:,apt-options:,aptitute-options:,
apt-pipeline:,apt-recommends:,apt-secure:,bootstrap:,cache:,cache-indices:,cache-packages:,
cache-stages:,debconf-frontend:,debconf-nowarnings:,debconf-priority:,dump,
initramfs:,fdisk:,losetup:,mode:,repositories:,root-command:,use-fakeroot:,tasksel:,includes:,
templates:,architecture:,bootstrap-config:,bootstrap-flavour:,bootstrap-keyring:,clean,
distribution:,mirror-bootstrap:,mirror-chroot:,mirror-chroot-security:,mirror-chroot-volatile:,mirror-chroot-backports:,mirror-binary:,
mirror-binary-security:,mirror-binary-volatile:,mirror-binary-backports:,mirror-debian-installer:,archive-areas:,chroot-filesystem:,exposed-root:,virtual-root-size:,
gzip-options:,hooks:,interactive:,keyring-packages:,language:,linux-flavours:,linux-packages:,
packages:,packages-lists:,tasks:,security:,volatile:,backports:,symlinks:,sysvinit:,binary-filesystem:,binary-images:,
binary-indices:,bootappend-install:,bootappend-live:,bootloader:,checksums:,build-with-chroot:,
debian-installer:,debian-installer-distribution:,debian-installer-preseedfile:,debian-installer-gui:,
encryption:,grub-splash:,hostname:,isohybrid-options:,iso-application:,iso-preparer:,iso-publisher:,
iso-volume:,jffs2-eraseblock:,memtest:,net-root-filesystem:,net-root-mountoptions:,
net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:,
net-cow-server:,net-tarball:,syslinux-splash:,syslinux-timeout:,syslinux-menu:,
username:,win32-loader:,source:,source-images:,breakpoints,conffile:,debug,force,
help,ignore-system-defaults,quiet,usage,verbose,version"
# Remove spaces added by indentation
LONG_OPTIONS="$(echo ${LONG_OPTIONS} | tr -d ' ')"
ARGUMENTS="$(getopt --longoptions ${LONG_OPTIONS} --name=${PROGRAM} --options a:f:d:m:l:k:p:b:e:r:s:c:huv --shell sh -- "${@}")"
2007-09-23 08:04:48 +00:00
2007-09-23 08:05:17 +00:00
if [ "${?}" != "0" ]
2007-09-23 08:04:50 +00:00
then
2007-09-23 08:05:17 +00:00
Echo_error "terminating" >&2
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
--dump)
# Dump version
if [ -x "$(which dpkg-query 2>/dev/null)" ]
then
VERSION_DPKG="$(dpkg-query -f='${Version}' --show live-build)"
fi
Echo "%s: This is live-build version %s" "${0}" "${VERSION_DPKG:-${VERSION}}"
# Dump conffile contents
Print_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
# Dump contents of directories that contain text files
for DIRECTORY in config/binary_local-packageslists config/chroot_local-packageslists config/chroot_apt config/chroot_local-patches config/chroot_local-preseed config/binary_rootfs
do
if Find_files "${DIRECTORY}"
then
Echo_file "${DIRECTORY}"/*
fi
done
# Dump directory listings of all directories under config/
for DIRECTORY in $(find config/ -mindepth 1 -maxdepth 1 -type d)
do
if Find_files "${DIRECTORY}"
then
ls -lR "${DIRECTORY}" | while read LINE
do
echo "${DIRECTORY}: ${LINE}"
done
fi
done
exit 0
;;
--clean)
_CLEAN="true"
shift
;;
2007-09-23 08:05:17 +00:00
# config/common
--apt)
LB_APT="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--apt-ftp-proxy)
LB_APT_FTP_PROXY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--apt-http-proxy)
LB_APT_HTTP_PROXY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--apt-pdiffs)
LB_APT_PDIFFS="${2}"
shift 2
;;
--apt-options)
APT_OPTIONS="${2}"
shift 2
;;
--aptitude-options)
LB_APTITUDE_OPTIONS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--apt-pipeline)
LB_APT_PIPELINE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--apt-recommends)
LB_APT_RECOMMENDS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--apt-secure)
LB_APT_SECURE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--bootstrap)
LB_BOOTSTRAP="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--cache)
LB_CACHE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--cache-indices)
LB_CACHE_INDICES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--cache-packages)
LB_CACHE_PACKAGES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--cache-stages)
LB_CACHE_STAGES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--debconf-frontend)
LB_DEBCONF_FRONTEND="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--debconf-nowarnings)
LB_DEBCONF_NOWARNINGS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--debconf-priority)
LB_DEBCONF_PRIORITY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--initramfs)
LB_INITRAMFS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--fdisk)
LB_FDISK="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
--losetup)
LB_LOSETUP="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--mode)
LB_MODE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
-r|--repositories)
LB_REPOSITORIES="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
--root-command)
LB_ROOT_COMMAND="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--use-fakeroot)
LB_USE_FAKEROOT="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
--tasksel)
LB_TASKSEL="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--includes)
LB_INCLUDES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--templates)
LB_TEMPLATES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
-v|--version)
2008-06-08 22:17:10 +00:00
Version
2007-09-23 08:05:17 +00:00
shift
;;
# config/bootstrap
-a|--architecture)
LB_ARCHITECTURE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--bootstrap-config)
LB_BOOTSTRAP_CONFIG="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
-f|--bootstrap-flavour)
LB_BOOTSTRAP_FLAVOUR="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--bootstrap-keyring)
LB_BOOTSTRAP_KEYRING="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
-d|--distribution)
LB_DISTRIBUTION="${2}"
BACKPORTS="false"
2007-09-23 08:05:17 +00:00
shift 2
case "${LB_DISTRIBUTION}" in
lenny-backports)
LB_DISTRIBUTION="lenny"
BACKPORTS="true"
;;
esac
2007-09-23 08:05:17 +00:00
;;
-m|--mirror-bootstrap)
LB_MIRROR_BOOTSTRAP="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--mirror-chroot)
LB_MIRROR_CHROOT="${2}"
shift 2
;;
--mirror-chroot-security)
LB_MIRROR_CHROOT_SECURITY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--mirror-chroot-volatile)
LB_MIRROR_CHROOT_VOLATILE="${2}"
shift 2
;;
--mirror-chroot-backports)
LB_MIRROR_CHROOT_BACKPORTS="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
--mirror-binary)
LB_MIRROR_BINARY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--mirror-binary-security)
LB_MIRROR_BINARY_SECURITY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--mirror-binary-volatile)
LB_MIRROR_BINARY_VOLATILE="${2}"
shift 2
;;
--mirror-binary-backports)
LB_MIRROR_BINARY_BACKPORTS="${2}"
shift 2
;;
--mirror-debian-installer)
LB_MIRROR_DEBIAN_INSTALLER="${2}"
shift 2
;;
2009-11-22 12:40:20 -01:00
--archive-areas)
LB_ARCHIVE_AREAS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
# config/chroot
--chroot-filesystem)
LB_CHROOT_FILESYSTEM="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--virtual-root-size)
LB_VIRTUAL_ROOT_SIZE="${2}"
shift 2
;;
--exposed-root)
LB_EXPOSED_ROOT="${2}"
shift 2
;;
--gzip-options)
GZIP_OPTIONS="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
--hooks)
LB_HOOKS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--interactive)
LB_INTERACTIVE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--keyring-packages)
LB_KEYRING_PACKAGES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
-l|--language)
LB_LANGUAGE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
-k|--linux-flavours)
LB_LINUX_FLAVOURS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--linux-packages)
LB_LINUX_PACKAGES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--packages)
LB_PACKAGES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
-p|--packages-lists)
LB_PACKAGES_LISTS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--tasks)
LB_TASKS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--security)
LB_SECURITY="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--volatile)
LB_VOLATILE="${2}"
shift 2
;;
--backports)
LB_BACKPORTS="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
--symlinks)
LB_SYMLINKS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--sysvinit)
LB_SYSVINIT="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
# config/binary
--binary-filesystem)
LB_BINARY_FILESYSTEM="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
-b|--binary-images)
LB_BINARY_IMAGES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--binary-indices)
LB_BINARY_INDICES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--bootappend-live)
LB_BOOTAPPEND_LIVE="${2}"
2007-09-23 12:05:12 +00:00
shift 2
;;
--bootappend-install)
LB_BOOTAPPEND_INSTALL="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--bootloader)
LB_BOOTLOADER="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--checksums)
LB_CHECKSUMS="${2}"
shift 2
;;
--build-with-chroot)
LB_BUILD_WITH_CHROOT="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--debian-installer)
LB_DEBIAN_INSTALLER="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--debian-installer-distribution)
LB_DEBIAN_INSTALLER_DISTRIBUTION="${2}"
shift 2
;;
--debian-installer-preseedfile)
LB_DEBIAN_INSTALLER_PRESEEDFILE="${2}"
shift 2
;;
--debian-installer-gui)
LB_DEBIAN_INSTALLER_GUI="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
-e|--encryption)
LB_ENCRYPTION="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--grub-splash)
LB_GRUB_SPLASH="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--hostname)
LB_HOSTNAME="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--isohybrid-options)
LB_ISOHYBRID_OPTIONS="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
--iso-application)
LB_ISO_APPLICATION="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--iso-preparer)
LB_ISO_PREPARER="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--iso-publisher)
LB_ISO_PUBLISHER="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--iso-volume)
LB_ISO_VOLUME="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--jffs2-eraseblock)
LB_JFFS2_ERASEBLOCK="${2}"
shift 2
;;
2007-10-09 20:50:35 +00:00
--memtest)
LB_MEMTEST="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--net-root-filesystem)
LB_NET_ROOT_FILESYSTEM="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--net-root-mountoptions)
LB_NET_ROOT_MOUNTOPTIONS="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--net-root-path)
LB_NET_ROOT_PATH="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--net-root-server)
LB_NET_ROOT_SERVER="${2}"
shift 2
;;
--net-cow-filesystem)
LB_NET_COW_FILESYSTEM="${2}"
shift 2
;;
--net-cow-mountoptions)
LB_NET_COW_MOUNTOPTIONS="${2}"
shift 2
;;
--net-cow-path)
LB_NET_COW_PATH="${2}"
shift 2
;;
--net-cow-server)
LB_NET_COW_SERVER="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--net-tarball)
LB_NET_TARBALL="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
--syslinux-splash)
LB_SYSLINUX_SPLASH="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--syslinux-timeout)
LB_SYSLINUX_TIMEOUT="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--syslinux-menu)
LB_SYSLINUX_MENU="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
--username)
LB_USERNAME="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--win32-loader)
LB_WIN32_LOADER="${2}"
shift 2
;;
2007-09-23 08:05:17 +00:00
# config/source
--source)
LB_SOURCE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
-s|--source-images)
LB_SOURCE_IMAGES="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
# other
--breakpoints)
_BREAKPOINTS="true"
2007-09-23 08:05:17 +00:00
shift
;;
-c|--conffile)
_CONFFILE="${2}"
2007-09-23 08:05:17 +00:00
shift 2
;;
--color)
_COLOR="true"
shift
;;
2007-09-23 08:05:17 +00:00
--debug)
_DEBUG="true"
2007-09-23 08:05:17 +00:00
shift
;;
--force)
_FORCE="true"
2007-09-23 08:05:17 +00:00
shift
;;
-h|--help)
Help
shift
;;
--ignore-system-defaults)
shift
;;
2007-09-23 08:05:17 +00:00
--quiet)
_QUIET="true"
2007-09-23 08:05:17 +00:00
shift
;;
-u|--usage)
Usage
shift
;;
--verbose)
_VERBOSE="true"
2007-09-23 08:05:17 +00:00
shift
;;
-v|--version)
Version
shift
;;
--)
shift
break
;;
*)
Echo_error "internal error %s" "${0}"
2007-09-23 08:05:17 +00:00
exit 1
;;
esac
done
}
# Reading system configuration
if ! In_list "--ignore-system-defaults" "${@}"
then
Echo_message "Considering defaults defined in %s" "/etc/live/build.conf"
Read_conffiles /etc/live/build.conf /etc/live/build.d/*
fi
2007-09-23 08:05:17 +00:00
# Reading existing configuration
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
2007-09-23 08:04:47 +00:00
Local_arguments "${@}"
if [ -n "${_CONFFILE}" ]
2007-09-23 08:05:17 +00:00
then
Read_conffiles "${_CONFFILE}"
2007-09-23 08:05:17 +00:00
fi
# Setting defaults
Set_defaults
# Checking defaults
Check_defaults
if [ ! -e config ]
then
Echo_message "Creating config tree"
else
Echo_message "Updating config tree"
fi
2007-09-23 08:05:10 +00:00
# Creating bootstrap configuration
2007-09-23 08:05:17 +00:00
mkdir -p config
mkdir -p config/includes
mkdir -p config/templates
2007-09-23 08:04:46 +00:00
# Creating live-build configuration
2007-09-23 08:05:17 +00:00
cat > config/common << EOF
# config/common - common options for live-build(7)
2007-09-23 08:04:49 +00:00
# LB_CONFIG_VERSION: internal version of the configuration file format
LB_CONFIG_VERSION="${CONFIG_VERSION}"
# \$LB_APT: set package manager
# (Default: ${LB_APT})
LB_APT="${LB_APT}"
2007-09-23 08:04:46 +00:00
# \$LB_APT_FTP_PROXY: set apt/aptitude ftp proxy
2007-09-23 08:04:46 +00:00
# (Default: autodetected or empty)
LB_APT_FTP_PROXY="${LB_APT_FTP_PROXY}"
2007-09-23 08:04:46 +00:00
# \$LB_APT_HTTP_PROXY: set apt/aptitude http proxy
2007-09-23 08:04:46 +00:00
# (Default: autodetected or empty)
LB_APT_HTTP_PROXY="${LB_APT_HTTP_PROXY}"
2007-09-23 08:04:46 +00:00
# \$LB_APT_PDIFFS: set apt/aptitude pdiff indices
# (Default: ${LB_APT_PDIFFS})
LB_APT_PDIFFS="${LB_APT_PDIFFS}"
2007-09-23 08:04:46 +00:00
# \$LB_APT_PIPELINE: set apt/aptitude pipeline depth
# (Default: ${LB_APT_PIPELINE})
LB_APT_PIPELINE="${LB_APT_PIPELINE}"
2007-09-23 08:05:11 +00:00
# \$LB_APT_RECOMMENDS: set apt/aptitude recommends
# (Default: ${LB_APT_RECOMMENDS})
LB_APT_RECOMMENDS="${LB_APT_RECOMMENDS}"
2007-09-23 08:04:46 +00:00
# \$LB_APT_SECURE: set apt/aptitude security
# (Default: ${LB_APT_SECURE})
LB_APT_SECURE="${LB_APT_SECURE}"
2007-09-23 08:04:48 +00:00
# \$LB_BOOTSTRAP: set bootstrap program
# (Default: ${LB_BOOTSTRAP})
LB_BOOTSTRAP="${LB_BOOTSTRAP}"
2007-09-23 08:04:46 +00:00
# \$LB_CACHE: control cache
# (Default: ${LB_CACHE})
LB_CACHE="${LB_CACHE}"
2007-09-23 08:05:17 +00:00
# \$LB_CACHE_INDICES: control if downloaded package indices should be cached
# (Default: ${LB_CACHE_INDICES})
LB_CACHE_INDICES="${LB_CACHE_INDICES}"
2007-09-23 08:04:52 +00:00
# \$LB_CACHE_PACKAGES: control if downloaded packages files should be cached
# (Default: ${LB_CACHE_PACKAGES})
LB_CACHE_PACKAGES="${LB_CACHE_PACKAGES}"
2007-09-23 08:04:52 +00:00
# \$LB_CACHE_STAGES: control if completed stages should be cached
# (Default: ${LB_CACHE_STAGES})
LB_CACHE_STAGES="${LB_CACHE_STAGES}"
2007-09-23 08:04:46 +00:00
# \$LB_DEBCONF_FRONTEND: set debconf(1) frontend to use
# (Default: ${LB_DEBCONF_FRONTEND})
LB_DEBCONF_FRONTEND="${LB_DEBCONF_FRONTEND}"
2007-09-23 08:04:46 +00:00
# \$LB_DEBCONF_NOWARNINGS: set debconf(1) warnings
# (Default: ${LB_DEBCONF_NOWARNINGS})
LB_DEBCONF_NOWARNINGS="${LB_DEBCONF_NOWARNINGS}"
2007-09-23 08:04:50 +00:00
# \$LB_DEBCONF_PRIORITY: set debconf(1) priority to use
# (Default: ${LB_DEBCONF_PRIORITY})
LB_DEBCONF_PRIORITY="${LB_DEBCONF_PRIORITY}"
2007-09-23 08:05:10 +00:00
# \$LB_INITRAMFS: set initramfs hook
# (Default: ${LB_INITRAMFS})
LB_INITRAMFS="${LB_INITRAMFS}"
2007-09-23 08:05:10 +00:00
# \$LB_FDISK: set fdisk program
# (Default: autodetected)
LB_FDISK="${LB_FDISK}"
# \$LB_LOSETUP: set losetup program
2007-09-23 08:04:47 +00:00
# (Default: autodetected)
LB_LOSETUP="${LB_LOSETUP}"
2007-09-23 08:04:47 +00:00
# \$LB_MODE: set distribution mode
# (Default: ${LB_MODE})
LB_MODE="${LB_MODE}"
2007-09-23 08:05:10 +00:00
# \$LB_ROOT_COMMAND: use sudo or equivalent
2007-09-23 08:05:10 +00:00
# (Default: empty)
#LB_ROOT_COMMAND="sudo"
2007-09-23 08:05:10 +00:00
# \$LB_USE_FAKEROOT: use fakeroot/fakechroot
# (Default: ${LB_USE_FAKEROOT})
LB_USE_FAKEROOT="${LB_USE_FAKEROOT}"
# \$LB_TASKSEL: set tasksel program
# (Default: ${LB_TASKSEL})
LB_TASKSEL="${LB_TASKSEL}"
2007-09-23 08:04:51 +00:00
# \$LB_INCLUDES: set includes
# (Default: ${LB_INCLUDES})
LB_INCLUDES="${LB_INCLUDES}"
2007-09-23 08:04:52 +00:00
# \$LB_TEMPLATES: set templates
# (Default: ${LB_TEMPLATES})
LB_TEMPLATES="${LB_TEMPLATES}"
2007-09-23 08:04:52 +00:00
# live-build options
2007-09-23 08:04:49 +00:00
# \$_BREAKPOINTS: enable breakpoints
# (Default: ${_BREAKPOINTS})
#_BREAKPOINTS="${_BREAKPOINTS}"
2007-09-23 08:04:49 +00:00
# \$_DEBUG: enable debug
# (Default: ${_DEBUG})
#_DEBUG="${_DEBUG}"
2007-09-23 08:04:49 +00:00
# \$_COLOR: enable color
# (Default: ${_COLOR})
#_COLOR="${_COLOR}"
# \$_FORCE: enable force
# (Default: ${_FORCE})
#_FORCE="${_FORCE}"
2007-09-23 08:04:49 +00:00
# \$_QUIET: enable quiet
# (Default: ${_QUIET})
_QUIET="${_QUIET}"
2007-09-23 08:04:49 +00:00
# \$_VERBOSE: enable verbose
# (Default: ${_VERBOSE})
#_VERBOSE="${_VERBOSE}"
# Internal stuff (FIXME)
APT_OPTIONS="${APT_OPTIONS}"
APTITUDE_OPTIONS="${APTITUDE_OPTIONS}"
GZIP_OPTIONS="${GZIP_OPTIONS}"
ISOHYBRID_OPTIONS="${ISOHYBRID_OPTIONS}"
2007-09-23 08:04:46 +00:00
EOF
2007-09-23 08:05:10 +00:00
# Creating lh_bootstrap_* configuration
2007-09-23 08:05:17 +00:00
cat > config/bootstrap << EOF
# config/bootstrap - options for live-build(7), bootstrap stage
2007-09-23 08:05:10 +00:00
# \$LB_ARCHITECTURE: select chroot architecture
2007-09-23 08:05:10 +00:00
# (Default: autodetected)
LB_ARCHITECTURE="${LB_ARCHITECTURE}"
2007-09-23 08:05:10 +00:00
# \$LB_BOOTSTRAP_CONFIG: set distribution config directory
2007-09-23 08:05:10 +00:00
# (Default: empty)
LB_BOOTSTRAP_CONFIG="${LB_BOOTSTRAP_CONFIG}"
2007-09-23 08:05:10 +00:00
# \$LB_BOOTSTRAP_INCLUDE: include packages on base
# (Default: empty)
LB_BOOTSTRAP_INCLUDE="${LB_BOOTSTRAP_INCLUDE}"
# \$LB_BOOTSTRAP_EXCLUDE: exclude packages on base
# (Default: empty)
LB_BOOTSTRAP_EXCLUDE="${LB_BOOTSTRAP_EXCLUDE}"
# \$LB_BOOTSTRAP_FLAVOUR: select flavour to use
# (Default: empty)
LB_BOOTSTRAP_FLAVOUR="${LB_BOOTSTRAP_FLAVOUR}"
2007-09-23 08:05:10 +00:00
# \$LB_BOOTSTRAP_KEYRING: set distribution keyring
2007-09-23 08:05:11 +00:00
# (Default: empty)
LB_BOOTSTRAP_KEYRING="${LB_BOOTSTRAP_KEYRING}"
2007-09-23 08:05:11 +00:00
# \$LB_DISTRIBUTION: select distribution to use
# (Default: ${LB_DISTRIBUTION})
LB_DISTRIBUTION="${LB_DISTRIBUTION}"
2007-09-23 08:05:11 +00:00
# \$LB_MIRROR_BOOTSTRAP: set mirror to bootstrap from
# (Default: ${LB_MIRROR_BOOTSTRAP})
LB_MIRROR_BOOTSTRAP="${LB_MIRROR_BOOTSTRAP}"
2007-09-23 08:05:10 +00:00
# \$LB_MIRROR_CHROOT: set mirror to fetch packages from
# (Default: ${LB_MIRROR_CHROOT})
LB_MIRROR_CHROOT="${LB_MIRROR_CHROOT}"
# \$LB_MIRROR_CHROOT_SECURITY: set security mirror to fetch packages from
# (Default: ${LB_MIRROR_CHROOT_SECURITY})
LB_MIRROR_CHROOT_SECURITY="${LB_MIRROR_CHROOT_SECURITY}"
2007-09-23 08:05:10 +00:00
# \$LB_MIRROR_CHROOT_VOLATILE: set volatile mirror to fetch packages from
# (Default: ${LB_MIRROR_CHROOT_VOLATILE})
LB_MIRROR_CHROOT_VOLATILE="${LB_MIRROR_CHROOT_VOLATILE}"
# \$LB_MIRROR_CHROOT_BACKPORTS: set backports mirror to fetch packages from
# (Default: ${LB_MIRROR_CHROOT_BACKPORTS})
LB_MIRROR_CHROOT_BACKPORTS="${LB_MIRROR_CHROOT_BACKPORTS}"
# \$LB_MIRROR_BINARY: set mirror which ends up in the image
# (Default: ${LB_MIRROR_BINARY})
LB_MIRROR_BINARY="${LB_MIRROR_BINARY}"
2007-09-23 08:05:10 +00:00
# \$LB_MIRROR_BINARY_SECURITY: set security mirror which ends up in the image
# (Default: ${LB_MIRROR_BINARY_SECURITY})
LB_MIRROR_BINARY_SECURITY="${LB_MIRROR_BINARY_SECURITY}"
2007-09-23 08:05:10 +00:00
# \$LB_MIRROR_BINARY_VOLATILE: set volatile mirror which ends up in the image
# (Default: ${LB_MIRROR_BINARY_VOLATILE})
LB_MIRROR_BINARY_VOLATILE="${LB_MIRROR_BINARY_VOLATILE}"
# \$LB_MIRROR_BINARY_BACKPORTS: set backports mirror which ends up in the image
# (Default: ${LB_MIRROR_BINARY_BACKPORTS})
LB_MIRROR_BINARY_BACKPORTS="${LB_MIRROR_BINARY_BACKPORTS}"
# \$LB_MIRROR_DEBIAN_INSTALLER: set debian-installer mirror
# (Default: ${LB_MIRROR_BOOTSTRAP})
LB_MIRROR_DEBIAN_INSTALLER="${LB_MIRROR_DEBIAN_INSTALLER}"
# \$LB_ARCHIVE_AREAS: select archive areas to use
# (Default: ${LB_ARCHIVE_AREAS})
LB_ARCHIVE_AREAS="${LB_ARCHIVE_AREAS}"
2007-09-23 08:05:10 +00:00
EOF
2007-09-23 08:04:46 +00:00
# Creating lh_chroot_* configuration
mkdir -p config/chroot_apt
2007-09-23 08:05:17 +00:00
mkdir -p config/chroot_local-hooks
mkdir -p config/chroot_local-includes
mkdir -p config/chroot_local-patches
2007-09-23 08:05:17 +00:00
mkdir -p config/chroot_local-packages
mkdir -p config/chroot_local-packageslists
mkdir -p config/chroot_local-preseed
2007-09-23 08:05:17 +00:00
mkdir -p config/chroot_sources
2007-09-23 08:05:10 +00:00
2007-09-23 08:05:17 +00:00
cat > config/chroot << EOF
# config/chroot - options for live-build(7), chroot stage
2007-09-23 08:04:46 +00:00
# \$LB_CHROOT_FILESYSTEM: set chroot filesystem
# (Default: ${LB_CHROOT_FILESYSTEM})
LB_CHROOT_FILESYSTEM="${LB_CHROOT_FILESYSTEM}"
2007-09-23 08:05:09 +00:00
# \$LB_UNION_FILESYSTEM: set union filesystem
# (Default: ${LB_UNION_FILESYSTEM})
LB_UNION_FILESYSTEM="${LB_UNION_FILESYSTEM}"
2007-09-23 08:05:13 +00:00
# \$LB_VIRTUAL_ROOT_SIZE: set virtual-hdd filesystem size
# (Default: ${LB_VIRTUAL_ROOT_SIZE})
LB_VIRTUAL_ROOT_SIZE="${LB_VIRTUAL_ROOT_SIZE}"
# \$LB_EXPOSED_ROOT: expose root as read only
# (Default: ${LB_EXPOSED_ROOT})
LB_EXPOSED_ROOT="${LB_EXPOSED_ROOT}"
# \$LB_HOOKS: set hook commands
2007-09-23 08:05:10 +00:00
# (Default: empty)
LB_HOOKS="${LB_HOOKS}"
2007-09-23 08:05:10 +00:00
# \$LB_INTERACTIVE: set interactive build
# (Default: ${LB_INTERACTIVE})
LB_INTERACTIVE="${LB_INTERACTIVE}"
2007-09-23 08:05:09 +00:00
# \$LB_KEYRING_PACKAGES: set keyring packages
2007-09-23 08:04:49 +00:00
# (Default: empty)
LB_KEYRING_PACKAGES="${LB_KEYRING_PACKAGES}"
2007-09-23 08:04:49 +00:00
# \$LB_LANGUAGE: set language to use
2007-09-23 08:04:46 +00:00
# (Default: empty)
LB_LANGUAGE="${LB_LANGUAGE}"
2007-09-23 08:04:46 +00:00
# \$LB_LINUX_FLAVOURS: set kernel flavour to use
2007-09-23 08:05:10 +00:00
# (Default: autodetected)
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS}"
2007-09-23 08:05:10 +00:00
# \$LB_LINUX_PACKAGES: set kernel packages to use
2007-09-23 08:05:10 +00:00
# (Default: autodetected)
LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES}"
2007-09-23 08:05:10 +00:00
# \$LB_REPOSITORIES: enable available third-party repositories
# (Default: empty)
LB_REPOSITORIES="${LB_REPOSITORIES}"
# \$LB_PACKAGES: set packages to install
2007-09-23 08:04:46 +00:00
# (Default: empty)
LB_PACKAGES="${LB_PACKAGES}"
2007-09-23 08:04:46 +00:00
# \$LB_PACKAGES_LISTS: set package list to install
# (Default: ${LB_PACKAGES_LISTS})
LB_PACKAGES_LISTS="${LB_PACKAGES_LISTS}"
2007-09-23 08:04:46 +00:00
# \$LB_TASKS: set tasks to install
2007-09-23 08:04:46 +00:00
# (Default: empty)
LB_TASKS="${LB_TASKS}"
2007-09-23 08:04:46 +00:00
# \$LB_SECURITY: enable security updates
# (Default: ${LB_SECURITY})
LB_SECURITY="${LB_SECURITY}"
2007-09-23 08:04:46 +00:00
# \$LB_VOLATILE: enable volatile updates
# (Default: ${LB_VOLATILE})
LB_VOLATILE="${LB_VOLATILE}"
# \$LB_BACKPORTS: enable backports updates
# (Default: ${LB_BACKPORTS})
LB_BACKPORTS="${LB_BACKPORTS}"
# \$LB_SYMLINKS: enable symlink convertion
# (Default: ${LB_SYMLINKS})
LB_SYMLINKS="${LB_SYMLINKS}"
2007-09-23 08:04:46 +00:00
# \$LB_SYSVINIT: enable sysvinit
# (Default: ${LB_SYSVINIT})
LB_SYSVINIT="${LB_SYSVINIT}"
2007-09-23 08:04:46 +00:00
EOF
2007-09-23 08:04:52 +00:00
# Creating lh_binary_* configuration
mkdir -p config/binary_debian-installer
mkdir -p config/binary_debian-installer-includes
2007-09-23 08:05:17 +00:00
mkdir -p config/binary_grub
mkdir -p config/binary_local-debs
mkdir -p config/binary_local-hooks
mkdir -p config/binary_local-includes
2007-10-18 20:28:54 +00:00
mkdir -p config/binary_local-packageslists
2007-09-23 08:05:17 +00:00
mkdir -p config/binary_local-udebs
mkdir -p config/binary_rootfs
mkdir -p config/binary_syslinux
cat > config/binary << EOF
# config/binary - options for live-build(7), binary stage
2007-09-23 08:05:10 +00:00
# \$LB_BINARY_FILESYSTEM: set image filesystem
# (Default: ${LB_BINARY_FILESYSTEM})
LB_BINARY_FILESYSTEM="${LB_BINARY_FILESYSTEM}"
# \$LB_BINARY_IMAGES: set image type
# (Default: ${LB_BINARY_IMAGES})
LB_BINARY_IMAGES="${LB_BINARY_IMAGES}"
2007-09-23 08:04:46 +00:00
# \$LB_BINARY_INDICES: set apt/aptitude generic indices
# (Default: ${LB_BINARY_INDICES})
LB_BINARY_INDICES="${LB_BINARY_INDICES}"
2007-09-23 08:05:09 +00:00
# \$LB_BOOTAPPEND_LIVE: set boot parameters
2007-09-23 08:04:46 +00:00
# (Default: empty)
LB_BOOTAPPEND_LIVE="${LB_BOOTAPPEND_LIVE}"
2007-09-23 08:04:46 +00:00
# \$LB_BOOTAPPEND_INSTALL: set boot parameters
# (Default: empty)
LB_BOOTAPPEND_INSTALL="${LB_BOOTAPPEND_INSTALL}"
# \$LB_BOOTLOADER: set bootloader
# (Default: ${LB_BOOTLOADER})
LB_BOOTLOADER="${LB_BOOTLOADER}"
2007-09-23 08:05:10 +00:00
# \$LB_CHECKSUMS: set checksums
# (Default: ${LB_CHECKSUMS})
LB_CHECKSUMS="${LB_CHECKSUMS}"
# \${LB_BUILD_WITH_CHROOT: control if we build binary images chrooted
# (Default: ${LB_BUILD_WITH_CHROOT})
# DO NEVER, *NEVER*, *N*E*V*E*R* SET THIS OPTION to false.
LB_BUILD_WITH_CHROOT="${LB_BUILD_WITH_CHROOT}"
2007-09-23 08:05:15 +00:00
# \$LB_DEBIAN_INSTALLER: set debian-installer
# (Default: ${LB_DEBIAN_INSTALLER})
LB_DEBIAN_INSTALLER="${LB_DEBIAN_INSTALLER}"
2007-09-23 08:05:10 +00:00
# \$LB_DEBIAN_INSTALLER_DISTRIBUTION: set debian-installer suite
# (Default: empty)
LB_DEBIAN_INSTALLER_DISTRIBUTION="${LB_DEBIAN_INSTALLER_DISTRIBUTION}"
# \$LB_DEBIAN_INSTALLER_PRESEEDFILE: set debian-installer preseed filename/url
# (Default: ${LB_DEBIAN_INSTALLER_PRESEEDFILE})
LB_DEBIAN_INSTALLER_PRESEEDFILE="${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
# \$LB_DEBIAN_INSTALLER_GUI: toggle use of GUI debian-installer
# (Default: ${LB_DEBIAN_INSTALLER_GUI})
LB_DEBIAN_INSTALLER_GUI="${LB_DEBIAN_INSTALLER_GUI}"
# \$LB_ENCRYPTION: set encryption
# (Default: ${LB_ENCRYPTION})
LB_ENCRYPTION="${LB_ENCRYPTION}"
2007-09-23 08:04:46 +00:00
# \$LB_GRUB_SPLASH: set custom grub splash
2007-09-23 08:05:10 +00:00
# (Default: empty)
LB_GRUB_SPLASH="${LB_GRUB_SPLASH}"
2007-09-23 08:04:48 +00:00
# \$LB_HOSTNAME: set hostname
# (Default: ${LB_HOSTNAME})
LB_HOSTNAME="${LB_HOSTNAME}"
2007-09-23 08:04:48 +00:00
# \$LB_ISO_APPLICATION: set iso author
# (Default: ${LB_ISO_APPLICATION})
LB_ISO_APPLICATION="${LB_ISO_APPLICATION}"
2007-09-23 08:04:46 +00:00
# \$LB_ISO_PREPARER: set iso preparer
# (Default: ${LB_ISO_PREPARER})
LB_ISO_PREPARER="${LB_ISO_PREPARER}"
2007-09-23 08:05:10 +00:00
# \$LB_ISO_PUBLISHER: set iso publisher
# (Default: ${LB_ISO_PUBLISHER})
LB_ISO_PUBLISHER="${LB_ISO_PUBLISHER}"
2007-09-23 08:04:52 +00:00
# \$LB_ISO_VOLUME: set iso volume (max 32 chars)
# (Default: ${LB_ISO_VOLUME})
LB_ISO_VOLUME="${LB_ISO_VOLUME}"
2007-09-23 08:04:46 +00:00
# \$LB_JFFS2_ERASEBLOCK: set jffs2 eraseblock size
# (Default: unset)
LB_JFFS2_ERASEBLOCK=""
# \$LB_MEMTEST: set memtest
# (Default: ${LB_MEMTEST})
LB_MEMTEST="${LB_MEMTEST}"
2007-09-23 08:04:46 +00:00
# \$LB_WIN32_LOADER: set win32-loader
# (Default: ${LB_WIN32_LOADER})
LB_WIN32_LOADER="${LB_WIN32_LOADER}"
# \$LB_NET_ROOT_FILESYSTEM: set netboot filesystem
# (Default: ${LB_NET_ROOT_FILESYSTEM})
LB_NET_ROOT_FILESYSTEM="${LB_NET_ROOT_FILESYSTEM}"
# \$LB_NET_ROOT_MOUNTOPTIONS: set nfsopts
# (Default: empty)
LB_NET_ROOT_MOUNTOPTIONS="${LB_NET_ROOT_MOUNTOPTIONS}"
# \$LB_NET_ROOT_PATH: set netboot server directory
# (Default: ${LB_NET_ROOT_PATH})
LB_NET_ROOT_PATH="${LB_NET_ROOT_PATH}"
# \$LB_NET_ROOT_SERVER: set netboot server address
# (Default: ${LB_NET_ROOT_SERVER})
LB_NET_ROOT_SERVER="${LB_NET_ROOT_SERVER}"
# \$LB_NET_COW_FILESYSTEM: set net client cow filesystem
# (Default: ${LB_NET_COW_FILESYSTEM})
LB_NET_COW_FILESYSTEM="${LB_NET_COW_FILESYSTEM}"
2007-09-23 08:05:14 +00:00
# \$LB_NET_COW_MOUNTOPTIONS: set cow mount options
2007-09-23 08:05:14 +00:00
# (Default: empty)
LB_NET_COW_MOUNTOPTIONS="${LB_NET_COW_MOUNTOPTIONS}"
2007-09-23 08:05:14 +00:00
# \$LB_NET_COW_PATH: set cow directory
# (Default: ${LB_NET_COW_PATH})
LB_NET_COW_PATH="${LB_NET_COW_PATH}"
2007-09-23 08:04:46 +00:00
# \$LB_NET_COW_SERVER: set cow server
# (Default: ${LB_NET_COW_SERVER})
LB_NET_COW_SERVER="${LB_NET_COW_SERVER}"
2007-09-23 08:04:46 +00:00
# \$LB_NET_TARBALL: set net tarball
# (Default: ${LB_NET_TARBALL})
LB_NET_TARBALL="${LB_NET_TARBALL}"
# \$LB_SYSLINUX_SPLASH: set custom syslinux splash
2007-09-23 08:04:46 +00:00
# (Default: empty)
LB_SYSLINUX_SPLASH="${LB_SYSLINUX_SPLASH}"
2007-09-23 08:04:46 +00:00
# \$LB_SYSLINUX_TIMEOUT: set custom syslinux timeout in seconds
2007-09-23 08:05:20 +00:00
# (Default: 0)
LB_SYSLINUX_TIMEOUT="${LB_SYSLINUX_TIMEOUT}"
2007-09-23 08:05:20 +00:00
# \$LB_SYSLINUX_CFG: set custom syslinux configuration file
# (Default: empty)
LB_SYSLINUX_CFG="${LB_SYSLINUX_CFG}"
# \$LB_SYSLINUX_MENU: set syslinux menu
# (Default: ${LB_SYSLINUX_MENU})
LB_SYSLINUX_MENU="${LB_SYSLINUX_MENU}"
# \$LB_SYSLINUX_MENU_LIVE_ENTRY: set text to be used on the menu for live entries
# (Default: ${LB_SYSLINUX_MENU_LIVE_ENTRY})
LB_SYSLINUX_MENU_LIVE_ENTRY="${LB_SYSLINUX_MENU_LIVE_ENTRY}"
# \$LB_SYSLINUX_MENU_LIVE_FAILSAFE_ENTRY: set text to be used on the menu for live entries (failsafe ones)
# (Default: ${LB_SYSLINUX_MENU_LIVE_FAILSAFE_ENTRY})
LB_SYSLINUX_MENU_LIVE_FAILSAFE_ENTRY="${LB_SYSLINUX_MENU_LIVE_FAILSAFE_ENTRY}"
# \$LB_SYSLINUX_MENU_MEMTEST_ENTRY: set text to be used on the menu for memtest entry
# (Default: ${LB_SYSLINUX_MENU_MEMTEST_ENTRY})
LB_SYSLINUX_MENU_MEMTEST_ENTRY="${LB_SYSLINUX_MENU_MEMTEST_ENTRY}"
# \$LB_USERNAME: set username
# (Default: ${LB_USERNAME})
LB_USERNAME="${LB_USERNAME}"
2007-09-23 08:04:52 +00:00
EOF
# Creating lh_source_* configuration
2007-09-23 08:05:17 +00:00
cat > config/source << EOF
# config/source - options for live-build(7), source stage
2007-09-23 08:04:52 +00:00
# \$LB_SOURCE: set source option
# (Default: ${LB_SOURCE})
LB_SOURCE="${LB_SOURCE}"
2007-09-23 08:04:46 +00:00
# \$LB_SOURCE_IMAGES: set image type
# (Default: ${LB_SOURCE_IMAGES})
LB_SOURCE_IMAGES="${LB_SOURCE_IMAGES}"
2007-09-23 08:04:46 +00:00
EOF
2007-09-23 08:05:12 +00:00
mkdir -p auto/functions
2010-09-13 19:49:20 +00:00
mkdir -p auto/scripts
2007-09-23 08:05:17 +00:00
if [ "${CONFIG}" = "clone" ] # FIXME
2007-09-23 08:05:12 +00:00
then
# Read package selection
echo $(dpkg --get-selections | awk '{ print $1 }') > config/chroot_local-packageslists/local-system
LB_PACKAGES_LISTS="${LB_PACKAGES_LISTS} local-system"
2007-09-23 08:05:12 +00:00
# Read debconf questions
if [ ! -f /usr/bin/debconf-get-selections ]
then
Echo_warning "Please install 'debconf-utils' in order to use this feature."
else
debconf-get-selections | grep -v deinstall | cut -f1 > config/chroot_local-preseed/local-system
fi
fi
if [ "${BACKPORTS}" = "true" ]
then
# Adding sources.list entry
cat > config/chroot_sources/${LB_DISTRIBUTION}-backports.chroot << EOF
# Backports Maintainers
deb http://backports.debian-maintainers.org/ ${LB_DISTRIBUTION}/backports main contrib non-free
deb-src http://backports.debian-maintainers.org/ ${LB_DISTRIBUTION}/backports main contrib non-free
EOF
cp config/chroot_sources/${LB_DISTRIBUTION}-backports.chroot config/chroot_sources/${LB_DISTRIBUTION}-backports.binary
# Adding apt preferences
if ! grep -qs "^Pin: release o=backports.debian-maintainerns.org" config/chroot_apt/preferences
then
cat >> config/chroot_apt/preferences << EOF
Package: *
Pin: release o=backports.debian-maintainerns.org
Pin-Priority: 999
EOF
fi
# Addding archive signing key
wget -q http://backports.debian-maintainers.org/project/openpgp/archive-key.asc -O config/chroot_sources/${LB_DISTRIBUTION}-backports.chroot.gpg
cp config/chroot_sources/${LB_DISTRIBUTION}-backports.chroot.gpg config/chroot_sources/${LB_DISTRIBUTION}-backports.binary.gpg
fi
# Checking defaults again
Check_defaults
if [ "${_CLEAN}" = "true" ]
then
# Remove empty directories in config tree
rmdir --ignore-fail-on-non-empty config/*/ > /dev/null 2>&1 || true
rmdir --ignore-fail-on-non-empty config > /dev/null 2>&1 || true
rmdir --ignore-fail-on-non-empty auto/functions > /dev/null 2>&1 || true
rmdir --ignore-fail-on-non-empty auto/scripts > /dev/null 2>&1 || true
rmdir --ignore-fail-on-non-empty auto > /dev/null 2>&1 || true
fi
# Creating stage file
Create_stagefile .stage/config