live-build/helpers/lh_config

371 lines
10 KiB
Plaintext
Raw Normal View History

2007-09-23 08:04:40 +00:00
#!/bin/sh
2007-09-23 08:04:48 +00:00
# lh_config(1) - create configuration for live-helper(7)
# Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org>
#
# live-helper 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
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
2007-09-23 08:04:48 +00:00
# Set static variables
DESCRIPTION="create configuration for live-helper(7)"
HELP=""
USAGE="${PROGRAM} [--force]"
Arguments "${@}"
2007-09-23 08:04:50 +00:00
CONFIG="${1}"
2007-09-23 08:04:49 +00:00
Echo_debug "Init ${PROGRAM}"
2007-09-23 08:04:50 +00:00
if [ -n "${LH_CONFIG}" ]
then
if [ -d /usr/share/live-helper/configs/"${LH_CONFIG}" ]
then
mkdir "${LH_CONFIG}"
cp -r /usr/share/live-helper/configs/"${LH_CONFIG}" "${LH_CONFIG}"/config
LIVE_ROOT="${LH_CONFIG}"
CONFIG=""
else
Echo_error "Couldn't find config ${LH_CONFIG} in /usr/share/live-helper/configs/."
fi
fi
if [ "${CONFIG}" != "newconfig" ]
2007-09-23 08:04:47 +00:00
then
# Source existing configuration
Read_conffile "${LIVE_ROOT}"/config/common
Read_conffile "${LIVE_ROOT}"/config/bootstrap
Read_conffile "${LIVE_ROOT}"/config/chroot
2007-09-23 08:04:52 +00:00
Read_conffile "${LIVE_ROOT}"/config/binary
Read_conffile "${LIVE_ROOT}"/config/source
2007-09-23 08:04:47 +00:00
fi
# Setting defaults
2007-09-23 08:04:46 +00:00
Set_defaults
2007-09-23 08:04:49 +00:00
Breakpoint "config: Init"
2007-09-23 08:05:10 +00:00
# Creating bootstrap configuration
2007-09-23 08:04:50 +00:00
mkdir -p "${LIVE_ROOT}"/config
2007-09-23 08:05:09 +00:00
mkdir -p "${LIVE_ROOT}"/config/includes
mkdir -p "${LIVE_ROOT}"/config/templates
2007-09-23 08:04:46 +00:00
# Creating live-helper configuration
cat > "${LIVE_ROOT}"/config/common << EOF
2007-09-23 08:05:10 +00:00
# config/common - common options for live-helper(7)
2007-09-23 08:04:49 +00:00
2007-09-23 08:04:46 +00:00
# \$LH_APT: set package manager
# (Default: ${LH_APT})
LH_APT="${LH_APT}"
# \$LH_APT_FTPPROXY: set apt/aptitude ftp proxy
# (Default: autodetected or empty)
LH_APT_FTPPROXY="${LH_APT_FTPPROXY}"
# \$LH_APT_HTTPPROXY: set apt/aptitude http proxy
# (Default: autodetected or empty)
LH_APT_HTTPPROXY="${LH_APT_HTTPPROXY}"
# \$LH_APT_PDIFFS: set apt/aptitude pdiff indices
# (Default: ${LH_APT_PDIFFS})
LH_APT_PDIFFS="${LH_APT_PDIFFS}"
2007-09-23 08:05:10 +00:00
# \$LH_APT_RECOMMENDS: set apt/aptitude recommends
2007-09-23 08:04:46 +00:00
# (Default: ${LH_APT_RECOMMENDS})
LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}"
2007-09-23 08:05:10 +00:00
# \$LH_APT_SECURE: set apt/aptitude security
2007-09-23 08:04:48 +00:00
# (Default: ${LH_APT_SECURE})
LH_APT_SECURE="${LH_APT_SECURE}"
2007-09-23 08:05:10 +00:00
# \$LH_BOOTSTRAP: set bootstrap program
2007-09-23 08:04:46 +00:00
# (Default: ${LH_BOOTSTRAP})
LH_BOOTSTRAP="${LH_BOOTSTRAP}"
2007-09-23 08:05:10 +00:00
# \$LH_CACHE_INDICES: control if downloaded package indices should be cached
2007-09-23 08:04:52 +00:00
# (Default: ${LH_CACHE_INDICES})
LH_CACHE_INDICES="${LH_CACHE_INDICES}"
2007-09-23 08:05:10 +00:00
# \$LH_CACHE_PACKAGES: control if downloaded packages files should be cached
2007-09-23 08:04:52 +00:00
# (Default: ${LH_CACHE_PACKAGES})
LH_CACHE_PACKAGES="${LH_CACHE_PACKAGES}"
2007-09-23 08:05:10 +00:00
# \$LH_CACHE_STAGES: control if completed stages should be cached
2007-09-23 08:04:52 +00:00
# (Default: ${LH_CACHE_STAGES})
LH_CACHE_STAGES="${LH_CACHE_STAGES}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# \$LH_DEBCONF_FRONTEND: set debconf(1) frontend to use
2007-09-23 08:04:46 +00:00
# (Default: ${LH_DEBCONF_FRONTEND})
LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}"
2007-09-23 08:04:50 +00:00
# \$LH_DEBCONF_NOWARNINGS: set debconf(1) warnings
# (Default: ${LH_DEBCONF_NOWARNINGS})
LH_DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}"
2007-09-23 08:05:10 +00:00
# \$LH_DEBCONF_PRIORITY: set debconf(1) priority to use
# (Default: ${LH_DEBCONF_PRIORITY})
LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}"
# \$LH_GENISOIMAGE: set genisoimage program
2007-09-23 08:04:48 +00:00
# (Default: ${LH_GENISOIMAGE})
2007-09-23 08:04:46 +00:00
LH_GENISOIMAGE="${LH_GENISOIMAGE}"
2007-09-23 08:05:10 +00:00
# \$LH_INITRAMFS: set initramfs hook
# (Default: ${LH_INITRAMFS})
LH_INITRAMFS="${LH_INITRAMFS}"
# \$LH_LOSETUP: set losetup program
2007-09-23 08:04:47 +00:00
# (Default: autodetected)
LH_LOSETUP="${LH_LOSETUP}"
2007-09-23 08:05:10 +00:00
# \$LH_MODE: set distribution mode
# (Default: ${LH_MODE})
LH_MODE="${LH_MODE}"
# \$LH_ROOT_COMMAND: use sudo or equivalent
# (Default: empty)
#LH_ROOT_COMMAND="sudo"
# \$LH_TASKSEL: set tasksel program
2007-09-23 08:04:51 +00:00
# (Default: ${LH_TASKSEL})
LH_TASKSEL="${LH_TASKSEL}"
2007-09-23 08:05:10 +00:00
# \$LIVE_ROOT: set root directory
2007-09-23 08:04:47 +00:00
# (Default: ${LIVE_ROOT})
2007-09-23 08:04:46 +00:00
LIVE_ROOT="${LIVE_ROOT}"
2007-09-23 08:04:49 +00:00
2007-09-23 08:04:52 +00:00
# \$LIVE_INCLUDES: set includes
# (Default: ${LIVE_INCLUDES})
LIVE_INCLUDES="${LIVE_INCLUDES}"
# \$LIVE_TEMPLATES: set templates
# (Default: ${LIVE_TEMPLATES})
LIVE_TEMPLATES="${LIVE_TEMPLATES}"
2007-09-23 08:04:49 +00:00
# Live-helper options
# \$LH_BREAKPOINTS: enable breakpoints
# (Default: ${LH_BREAKPOINTS})
2007-09-23 08:04:52 +00:00
#LH_BREAKPOINTS="${LH_BREAKPOINTS}"
2007-09-23 08:04:49 +00:00
# \$LH_DEBUG: enable debug
# (Default: ${LH_DEBUG})
2007-09-23 08:04:52 +00:00
#LH_DEBUG="${LH_DEBUG}"
2007-09-23 08:04:49 +00:00
# \$LH_FORCE: enable force
# (Default: ${LH_FORCE})
2007-09-23 08:04:52 +00:00
#LH_FORCE="${LH_FORCE}"
2007-09-23 08:04:49 +00:00
# \$LH_QUIET: enable quiet
# (Default: ${LH_QUIET})
2007-09-23 08:04:52 +00:00
#LH_QUIET="${LH_QUIET}"
2007-09-23 08:04:49 +00:00
# \$LH_VERBOSE: enable verbose
# (Default: ${LH_VERBOSE})
2007-09-23 08:04:52 +00:00
#LH_VERBOSE="${LH_VERBOSE}"
2007-09-23 08:04:46 +00:00
EOF
2007-09-23 08:05:10 +00:00
# Creating lh_bootstrap_* configuration
cat > "${LIVE_ROOT}"/config/bootstrap << EOF
# config/bootstrap - options for live-helper(7), bootstrap stage
# \$LIVE_ARCHITECTURE: select chroot architecture
# (Default: autodetected)
LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}"
# \$LIVE_DISTRIBUTION: select distribution to use
# (Default: ${LIVE_DISTRIBUTION})
LIVE_DISTRIBUTION="${LIVE_DISTRIBUTION}"
# \$LIVE_DISTRIBUTION_CONFIG: set distribution config directory
# (Default: empty)
LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}"
# \$LIVE_BOOTSTRAP_FLAVOUR: select flavour to use
# (Default: ${LIVE_BOOTSTRAP_FLAVOUR})
LIVE_BOOTSTRAP_FLAVOUR="${LIVE_BOOTSTRAP_FLAVOUR}"
# \$LIVE_MIRROR_BOOTSTRAP: set mirror to fetch packages from
# (Default: ${LIVE_MIRROR_BOOTSTRAP})
LIVE_MIRROR_BOOTSTRAP="${LIVE_MIRROR_BOOTSTRAP}"
# \$LIVE_MIRROR_BOOTSTRAP_SECURITY: set security mirror to fetch packages from
# (Default: ${LIVE_MIRROR_BOOTSTRAP_SECURITY})
LIVE_MIRROR_BOOTSTRAP_SECURITY="${LIVE_MIRROR_BOOTSTRAP_SECURITY}"
# \$LIVE_MIRROR_BINARY: set mirror which ends up in the image
# (Default: ${LIVE_MIRROR_BINARY})
LIVE_MIRROR_BINARY="${LIVE_MIRROR_BINARY}"
# \$LIVE_MIRROR_BINARY_SECURITY: set security mirror which ends up in the image
# (Default: ${LIVE_MIRROR_BINARY_SECURITY})
LIVE_MIRROR_BINARY_SECURITY="${LIVE_MIRROR_BINARY_SECURITY}"
# \$LIVE_SECTIONS: select section(s) to use
# (Default: ${LIVE_SECTIONS})
LIVE_SECTIONS="${LIVE_SECTIONS}"
EOF
2007-09-23 08:04:46 +00:00
# Creating lh_chroot_* configuration
2007-09-23 08:05:10 +00:00
mkdir -p "${LIVE_ROOT}"/config/chroot_local-hooks
mkdir -p "${LIVE_ROOT}"/config/chroot_local-includes
mkdir -p "${LIVE_ROOT}"/config/chroot_local-packages
mkdir -p "${LIVE_ROOT}"/config/chroot_local-packageslists
mkdir -p "${LIVE_ROOT}"/config/chroot_sources
2007-09-23 08:04:46 +00:00
cat > "${LIVE_ROOT}"/config/chroot << EOF
2007-09-23 08:05:10 +00:00
# config/chroot - options for live-helper(7), chroot stage
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:09 +00:00
# \$LIVE_CHROOT_FILESYSTEM: set chroot filesystem
# (Default: ${LIVE_CHROOT_FILESYSTEM})
LIVE_CHROOT_FILESYSTEM="${LIVE_CHROOT_FILESYSTEM}"
2007-09-23 08:05:10 +00:00
# \$LIVE_HOOKS: set hook commands
# (Default: empty)
LIVE_HOOKS="${LIVE_HOOKS}"
2007-09-23 08:05:09 +00:00
# \$LIVE_INTERACTIVE: set interactive build
# (Default: ${LIVE_INTERACTIVE})
LIVE_INTERACTIVE="${LIVE_INTERACTIVE}"
2007-09-23 08:05:10 +00:00
# \$LIVE_KEYRING_PACKAGES: set keyring packages
2007-09-23 08:04:49 +00:00
# (Default: empty)
LIVE_KEYRING_PACKAGES="${LIVE_KEYRING_PACKAGES}"
2007-09-23 08:05:10 +00:00
# \$LIVE_LANGUAGE: set language to use
2007-09-23 08:04:46 +00:00
# (Default: empty)
LIVE_LANGUAGE="${LIVE_LANGUAGE}"
2007-09-23 08:05:10 +00:00
# \$LIVE_LINUX_FLAVOURS: set kernel flavour to use
# (Default: autodetected)
LIVE_LINUX_FLAVOURS="${LIVE_LINUX_FLAVOURS}"
# \$LIVE_LINUX_PACKAGES: set kernel packages to use
# (Default: autodetected)
LIVE_LINUX_PACKAGES="${LIVE_LINUX_PACKAGES}"
# \$LIVE_PACKAGES: set packages to install
2007-09-23 08:04:46 +00:00
# (Default: empty)
LIVE_PACKAGES="${LIVE_PACKAGES}"
2007-09-23 08:05:10 +00:00
# \$LIVE_PACKAGES_LISTS: set package list to install
2007-09-23 08:04:48 +00:00
# (Default: ${LIVE_PACKAGES_LISTS})
LIVE_PACKAGES_LISTS="${LIVE_PACKAGES_LISTS}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# \$LIVE_TASKS: set tasks to install
2007-09-23 08:04:46 +00:00
# (Default: empty)
LIVE_TASKS="${LIVE_TASKS}"
# \$LIVE_SECURITY: enable security updates
# (Default: ${LIVE_SECURITY})
LIVE_SECURITY="${LIVE_SECURITY}"
# \$LIVE_SYMLINKS: enable symlink convertion
# (Default: ${LIVE_SYMLINKS})
LIVE_SYMLINKS="${LIVE_SYMLINKS}"
# \$LIVE_SYSVINIT: enable sysvinit
# (Default: ${LIVE_SYSVINIT})
LIVE_SYSVINIT="${LIVE_SYSVINIT}"
EOF
2007-09-23 08:04:52 +00:00
# Creating lh_binary_* configuration
2007-09-23 08:05:10 +00:00
mkdir -p "${LIVE_ROOT}"/config/binary_grub
mkdir -p "${LIVE_ROOT}"/config/binary_local-includes
mkdir -p "${LIVE_ROOT}"/config/binary_syslinux
2007-09-23 08:04:52 +00:00
cat > "${LIVE_ROOT}"/config/binary << EOF
2007-09-23 08:05:10 +00:00
# config/binary - options for live-helper(7), binary stage
# \$LIVE_BINARY_IMAGES: set image type
# (Default: ${LIVE_BINARY_IMAGES})
LIVE_BINARY_IMAGES="${LIVE_BINARY_IMAGES}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:09 +00:00
# \$LIVE_BINARY_INDICES: set apt/aptitude generic indices
# (Default: ${LIVE_BINARY_INDICES})
LIVE_BINARY_INDICES="${LIVE_BINARY_INDICES}"
2007-09-23 08:04:46 +00:00
# \$LIVE_BOOTAPPEND: set boot parameters
# (Default: empty)
LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND}"
2007-09-23 08:05:10 +00:00
# \$LIVE_BOOTLOADER: set bootloader
# (Default: ${LIVE_BOOTLOADER})
LIVE_BOOTLOADER="${LIVE_BOOTLOADER}"
# \$LIVE_DEBIAN_INSTALLER: set debian-installer
# (Default: ${LIVE_DEBIAN_INSTALLER})
LIVE_DEBIAN_INSTALLER="${LIVE_DEBIAN_INSTALLER}"
2007-09-23 08:04:46 +00:00
# \$LIVE_ENCRYPTION: set encrytion
# (Default: empty)
LIVE_ENCRYPTION="${LIVE_ENCRYPTION}"
2007-09-23 08:05:10 +00:00
# \$LIVE_GRUB_SPLASH: set custom grub splash
# (Default: empty)
LIVE_GRUB_SPLASH="${LIVE_GRUB_SPLASH}"
2007-09-23 08:04:48 +00:00
# \$LIVE_HOSTNAME: set hostname
# (Default: ${LIVE_HOSTNAME})
LIVE_HOSTNAME="${LIVE_HOSTNAME}"
2007-09-23 08:05:10 +00:00
# \$LIVE_ISO_APPLICATION: set iso author
# (Default: ${LIVE_ISO_APPLICATION})
LIVE_ISO_APPLICATION="${LIVE_ISO_APPLICATION}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# \$LIVE_ISO_PREPARER: set iso preparer
# (Default: ${LIVE_ISO_PREPARER})
LIVE_ISO_PREPARER="${LIVE_ISO_PREPARER}"
# \$LIVE_ISO_PUBLISHER: set iso preparer
# (Default: ${LIVE_ISO_PUBLISHER})
LIVE_ISO_PUBLISHER="${LIVE_ISO_PUBLISHER}"
2007-09-23 08:04:52 +00:00
2007-09-23 08:04:46 +00:00
# \$LIVE_ISO_VOLUME: set iso volume
# (Default: ${LIVE_ISO_VOLUME})
LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}"
2007-09-23 08:05:10 +00:00
# \$LIVE_MEMTEST: set memtest
# (Default: ${LIVE_MEMTEST})
LIVE_MEMTEST="${LIVE_MEMTEST}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# \$LIVE_NET_PATH: set netboot server directory
2007-09-23 08:05:09 +00:00
# (Default: ${LIVE_NET_PATH})
LIVE_NET_PATH="${LIVE_NET_PATH}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:10 +00:00
# \$LIVE_NET_SERVER: set netboot server address
# (Default: ${LIVE_NET_SERVER})
LIVE_NET_SERVER="${LIVE_NET_SERVER}"
2007-09-23 08:04:46 +00:00
# \$LIVE_SYSLINUX_SPLASH: set custom syslinux splash
# (Default: empty)
LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}"
2007-09-23 08:05:10 +00:00
# \$LIVE_USERNAME: set username
# (Default: ${LIVE_USERNAME})
LIVE_USERNAME="${LIVE_USERNAME}"
2007-09-23 08:04:52 +00:00
EOF
# Creating lh_source_* configuration
cat > "${LIVE_ROOT}"/config/source << EOF
2007-09-23 08:05:10 +00:00
# config/source - options for live-helper(7), source stage
2007-09-23 08:04:52 +00:00
# \$LIVE_SOURCE: set source option
2007-09-23 08:05:10 +00:00
# (Default: ${LIVE_SOURCE})
2007-09-23 08:04:52 +00:00
LIVE_SOURCE="${LIVE_SOURCE}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:09 +00:00
# \$LIVE_SOURCE_IMAGES: set image type
# (Default: ${LIVE_SOURCE_IMAGES})
LIVE_SOURCE_IMAGES="${LIVE_SOURCE_IMAGES}"
2007-09-23 08:04:46 +00:00
EOF