live-build/helpers/lh_config

268 lines
7.5 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:47 +00:00
if [ "${1}" != "newconfig" ]
then
# Source existing configuration
Read_conffile "${LIVE_ROOT}"/config/common
Read_conffile "${LIVE_ROOT}"/config/bootstrap
Read_conffile "${LIVE_ROOT}"/config/chroot
Read_conffile "${LIVE_ROOT}"/config/image
fi
# Setting defaults
2007-09-23 08:04:46 +00:00
Set_defaults
# Creating configuration directory
install -d -m 0755 "${LIVE_ROOT}"/config || true
# Creating live-helper configuration
cat > "${LIVE_ROOT}"/config/common << EOF
# config/common: configuration for live-helper(7)
# \$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_GENERIC: set apt/aptitude generic indices
# (Default: ${LH_APT_GENERIC})
LH_APT_GENERIC="${LH_APT_GENERIC}"
# \$LH_APT_PDIFFS: set apt/aptitude pdiff indices
# (Default: ${LH_APT_PDIFFS})
LH_APT_PDIFFS="${LH_APT_PDIFFS}"
# \$LH_APT_RECOMMENDS: enable recommends
# (Default: ${LH_APT_RECOMMENDS})
LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}"
2007-09-23 08:04:48 +00:00
# \$LH_APT_SECURE: enable secure
# (Default: ${LH_APT_SECURE})
LH_APT_SECURE="${LH_APT_SECURE}"
2007-09-23 08:04:46 +00:00
# \$LH_BOOTSTRAP: select the bootstrap program
# (Default: ${LH_BOOTSTRAP})
LH_BOOTSTRAP="${LH_BOOTSTRAP}"
2007-09-23 08:04:47 +00:00
# \$LH_CACHE: control if downloaded packages should be cached
2007-09-23 08:04:46 +00:00
# (Default: ${LH_CACHE})
LH_CACHE="${LH_CACHE}"
# \$LH_DEBCONF_FRONTEND: set the debconf(1) frontend to use
# (Default: ${LH_DEBCONF_FRONTEND})
LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}"
# \$LH_DEBCONF_PRIORITY: set the debconf(1) priority to use
# (Default: ${LH_DEBCONF_PRIORITY})
LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}"
# \$LH_GENISOIMAGE: set the 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:04:47 +00:00
# \$LH_LOSETUP: set the losetup program
# (Default: autodetected)
LH_LOSETUP="${LH_LOSETUP}"
2007-09-23 08:04:46 +00:00
# \$LIVE_ROOT: set the 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}"
EOF
# Creating lh_chroot_* configuration
cat > "${LIVE_ROOT}"/config/chroot << EOF
# config/chroot: configuration for lh_chroot_*
2007-09-23 08:04:48 +00:00
# \$LIVE_KERNEL_FLAVOUR: set the kernel flavour to use
2007-09-23 08:04:46 +00:00
# (Default: autodetected)
2007-09-23 08:04:48 +00:00
LIVE_KERNEL_FLAVOUR="${LIVE_KERNEL_FLAVOUR}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:48 +00:00
# \$LIVE_KERNEL_PACKAGES: set the kernel packages to use
2007-09-23 08:04:46 +00:00
# (Default: autodetected)
2007-09-23 08:04:48 +00:00
LIVE_KERNEL_PACKAGES="${LIVE_KERNEL_PACKAGES}"
2007-09-23 08:04:46 +00:00
# \$LIVE_LANGUAGE: set the language to use
# (Default: empty)
LIVE_LANGUAGE="${LIVE_LANGUAGE}"
# \$LIVE_PACKAGES: set the packages to install
# (Default: empty)
LIVE_PACKAGES="${LIVE_PACKAGES}"
2007-09-23 08:04:48 +00:00
# \$LIVE_PACKAGES_LISTS: set the package list to install
# (Default: ${LIVE_PACKAGES_LISTS})
LIVE_PACKAGES_LISTS="${LIVE_PACKAGES_LISTS}"
2007-09-23 08:04:46 +00:00
# \$LIVE_TASKS: set the tasks to install
# (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}"
2007-09-23 08:04:48 +00:00
# \$LIVE_INTERACTIVE: set interactive build
# (Default: ${LIVE_INTERACTIVE})
LIVE_INTERACTIVE="${LIVE_INTERACTIVE}"
2007-09-23 08:04:46 +00:00
EOF
# Creating lh_chroot_* directories
install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localhooks || true
install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localincludes || true
install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localpackages || true
2007-09-23 08:04:48 +00:00
install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localpackageslists || true
2007-09-23 08:04:46 +00:00
# Creating lh_bootstrap_* configuration
cat > "${LIVE_ROOT}"/config/bootstrap << EOF
# config/bootstrap: configuration for lh_bootstrap_*
# \$LIVE_ARCHITECTURE: select the chroot architecture
# (Default: autodetected)
LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}"
# \$LIVE_DISTRIBUTION: select the 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}"
2007-09-23 08:04:48 +00:00
# \$LIVE_BOOTSTRAP_FLAVOUR: select the flavour to use
# (Default: ${LIVE_BOOTSTRAP_FLAVOUR})
2007-09-23 08:04:49 +00:00
LIVE_BOOTSTRAP_FLAVOUR="${LIVE_BOOTSTRAP_FLAVOUR}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:48 +00:00
# \$LIVE_MIRROR_BUILD: set the mirror to fetch packages from
# (Default: ${LIVE_MIRROR_BUILD})
LIVE_MIRROR_BUILD="${LIVE_MIRROR_BUILD}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:48 +00:00
# \$LIVE_MIRROR_BUILD_SECURITY: set the security mirror to fetch packages from
# (Default: ${LIVE_MIRROR_BUILD_SECURITY})
LIVE_MIRROR_BUILD_SECURITY="${LIVE_MIRROR_BUILD_SECURITY}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:48 +00:00
# \$LIVE_MIRROR_IMAGE: set the mirror which ends up in the image
# (Default: ${LIVE_MIRROR_IMAGE})
LIVE_MIRROR_IMAGE="${LIVE_MIRROR_IMAGE}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:48 +00:00
# \$LIVE_MIRROR_IMAGE_SECURITY: set the security mirror which ends up in the image
# (Default: ${LIVE_MIRROR_IMAGE_SECURITY})
LIVE_MIRROR_IMAGE_SECURITY="${LIVE_MIRROR_IMAGE_SECURITY}"
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:47 +00:00
# \$LIVE_SECTIONS: select the section(s) to use
2007-09-23 08:04:46 +00:00
# (Default: ${LIVE_SECTIONS})
LIVE_SECTIONS="${LIVE_SECTIONS}"
EOF
# Creating lh_image_* configuration
cat > "${LIVE_ROOT}"/config/image << EOF
# config/chroot: configuration for lh_image_*
# \$LIVE_BOOTAPPEND: set boot parameters
# (Default: empty)
LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND}"
# \$LIVE_ENCRYPTION: set encrytion
# (Default: empty)
LIVE_ENCRYPTION="${LIVE_ENCRYPTION}"
2007-09-23 08:04:48 +00:00
# \$LIVE_USERNAME: set username
# (Default: ${LIVE_USERNAME})
LIVE_USERNAME="${LIVE_USERNAME}"
# \$LIVE_HOSTNAME: set hostname
# (Default: ${LIVE_HOSTNAME})
LIVE_HOSTNAME="${LIVE_HOSTNAME}"
2007-09-23 08:04:46 +00:00
# \$LIVE_FILESYSTEM: set filesystem
# (Default: ${LIVE_FILESYSTEM})
LIVE_FILESYSTEM="${LIVE_FILESYSTEM}"
# \$LIVE_MEMTEST86: set memtest86+
# (Default: ${LIVE_MEMTEST86})
LIVE_MEMTEST86="${LIVE_MEMTEST86}"
# \$LIVE_ISO_VOLUME: set iso volume
# (Default: ${LIVE_ISO_VOLUME})
LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}"
# \$LIVE_SERVER_ADDRESS: set the netboot server address
# (Default: ${LIVE_SERVER_ADDRESS})
LIVE_SERVER_ADDRESS="${LIVE_SERVER_ADDRESS}"
# \$LIVE_SERVER_PATH: set the netboot server directory
# (Default: ${LIVE_SERVER_PATH})
LIVE_SERVER_PATH="${LIVE_SERVER_PATH}"
# \$LIVE_SOURCE: set source option
# (Default: ${LH_SOURCE})
LIVE_SOURCE="${LIVE_SOURCE}"
2007-09-23 08:04:49 +00:00
# \$LIVE_BOOTLOADER: set bootloader
# (Default: ${LIVE_BOOTLOADER})
LIVE_BOOTLOADER="${LIVE_BOOTLOADER}"
# \$LIVE_GRUB_SPLASH: set custom grub splash
# (Default: empty)
LIVE_GRUB_SPLASH="${LIVE_GRUB_SPLASH}"
2007-09-23 08:04:46 +00:00
# \$LIVE_SYSLINUX_SPLASH: set custom syslinux splash
# (Default: empty)
LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}"
# \$LIVE_BINARY_IMAGE: set image type
# (Default: ${LIVE_BINARY_IMAGE})
LIVE_BINARY_IMAGE="${LIVE_BINARY_IMAGE}"
# \$LIVE_SOURCE_IMAGE: set image type
# (Default: ${LIVE_SOURCE_IMAGE})
LIVE_SOURCE_IMAGE="${LIVE_SOURCE_IMAGE}"
2007-09-23 08:04:48 +00:00
# \$LIVE_INCLUDES: set includes
# (Default: ${LIVE_INCLUDES})
LIVE_INCLUDES="${LIVE_INCLUDES}"
2007-09-23 08:04:46 +00:00
# \$LIVE_TEMPLATES: set templates
# (Default: ${LIVE_TEMPLATES})
LIVE_TEMPLATES="${LIVE_TEMPLATES}"
EOF
2007-09-23 08:04:48 +00:00
# Creating lh_binary_* directories
install -d -m 0755 "${LIVE_ROOT}"/config/binary_localincludes || true