From 384a050c792ed13b3c1b0427ce55b7c3b3463170 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 12 Aug 2008 22:04:25 +0200 Subject: Adding guessing of the preseeding filename, and way to manually overwrite it (or select it in case of multiple available preseeding files). --- functions/defaults.sh | 46 +++++++++++++++++++++++++++++++++++++++------- helpers/lh_config | 12 +++++++++++- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/functions/defaults.sh b/functions/defaults.sh index afd5ef1..7db4e4d 100755 --- a/functions/defaults.sh +++ b/functions/defaults.sh @@ -504,13 +504,6 @@ Set_defaults () # Setting apt indices LH_BINARY_INDICES="${LH_BINARY_INDICES:-enabled}" - # Setting boot parameters - # LH_BOOTAPPEND_LIVE - if [ -z "${LH_BOOTAPPEND_INSTALL}" ] - then - LH_BOOTAPPEND_INSTALL="-- \${LH_BOOTAPPEND_LIVE}" - fi - # Setting bootloader if [ -z "${LH_BOOTLOADER}" ] then @@ -541,6 +534,45 @@ Set_defaults () # Setting debian-installer distribution LH_DEBIAN_INSTALLER_DISTRIBUTION="${LH_DEBIAN_INSTALLER_DISTRIBUTION:-${LH_DISTRIBUTION}}" + # Setting debian-installer preseed filename + if [ -z "${LH_DEBIAN_INSTALLER_PRESEEDFILE}" ] + then + if Find_files config/binary_debian-installer/preseed.cfg + then + LH_DEBIAN_INSTALLER_PRESEEDFILE="/install/preseed.cfg" + fi + + if Find_files config/binary_debian-installer/*.cfg && [ ! -e config/binary_debian-installer/preseed.cfg ] + then + Echo_warning "You have placed some preseeding files into config/binary_debian-installer" + Echo_warning "but you didn't specify the default preseeding file through" + Echo_warning "LH_DEBIAN_INSTALLER_PRESEEDFILE. This means that debian-installer will not" + Echo_warning "take up a preseeding file by default." + fi + fi + + # Setting boot parameters + # LH_BOOTAPPEND_LIVE + if [ -n "${LH_DEBIAN_INSTALLER_PRESEEDFILE}" ] + then + case "${LH_BINARY_IMAGES}" in + iso) + LH_BOOTAPPEND_PRESEED="file=/cdrom${LH_DEBIAN_INSTALLER_PRESEEDFILE}" + ;; + + usb-hdd) + LH_BOOTAPPEND_PRESEED="file=/hd-media${LH_DEBIAN_INSTALLER_PRESEEDFILE}" + ;; + esac + fi + + if [ -z "${LH_BOOTAPPEND_INSTALL}" ] && [ -n ${LH_BOOTAPPEND_PRESEED} ] + then + LH_BOOTAPPEND_INSTALL="${LH_BOOTAPPEND_PRESEED} -- \${LH_BOOTAPPEND_LIVE}" + else + LH_BOOTAPPEND_INSTALL="-- \${LH_BOOTAPPEND_LIVE}" + fi + # Setting encryption LH_ENCRYPTION="${LH_ENCRYPTION:-disabled}" diff --git a/helpers/lh_config b/helpers/lh_config index 39d7d07..13aca9e 100755 --- a/helpers/lh_config +++ b/helpers/lh_config @@ -55,6 +55,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ \t [--debconf-priority low|medium|high|critical]\n\ \t [--debian-installer enabled|cdrom|netinst|netboot|businesscard|live|disabled]\n\ \t [--debian-installer-distribution CODENAME|daily]\n\ +\t [--debian-installer-preseedfile FILE|URL]\n\ \t [--debug]\n\ \t [-d|--distribution CODENAME]\n\ \t [-e|--encryption disabled|aes128|aes192|aes256]\n\ @@ -118,7 +119,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ Local_arguments () { - ARGUMENTS="$(getopt --longoptions 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:,genisoimage:,initramfs:,fdisk:,losetup:,mode:,root-command:,use-fakeroot:,tasksel:,includes:,templates:,architecture:,bootstrap-config:,bootstrap-flavour:,bootstrap-keyring:,distribution:,mirror-bootstrap:,mirror-chroot:,mirror-chroot-security:,mirror-binary:,mirror-binary-security:,sections:,chroot-filesystem:,union-filesystem:,exposed-root:,hooks:,interactive:,keyring-packages:,language:,linux-flavours:,linux-packages:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,binary-filesystem:,binary-images:,binary-indices:,bootappend-install:,bootappend-live:,bootloader:,checksums:,chroot-build:,debian-installer:,,debian-installer-distribution:,encryption:,grub-splash:,hostname:,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:,source:,source-images:,breakpoints,conffile:,debug,force,help,ignore-system-defaults,quiet,usage,verbose,version --name=${PROGRAM} --options a:f:d:m:l:k:p:b:e:s:c:huv --shell sh -- "${@}")" + ARGUMENTS="$(getopt --longoptions 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:,genisoimage:,initramfs:,fdisk:,losetup:,mode:,root-command:,use-fakeroot:,tasksel:,includes:,templates:,architecture:,bootstrap-config:,bootstrap-flavour:,bootstrap-keyring:,distribution:,mirror-bootstrap:,mirror-chroot:,mirror-chroot-security:,mirror-binary:,mirror-binary-security:,sections:,chroot-filesystem:,union-filesystem:,exposed-root:,hooks:,interactive:,keyring-packages:,language:,linux-flavours:,linux-packages:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,binary-filesystem:,binary-images:,binary-indices:,bootappend-install:,bootappend-live:,bootloader:,checksums:,chroot-build:,debian-installer:,,debian-installer-distribution:,debian-installer-preseedfile:,encryption:,grub-splash:,hostname:,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:,source:,source-images:,breakpoints,conffile:,debug,force,help,ignore-system-defaults,quiet,usage,verbose,version --name=${PROGRAM} --options a:f:d:m:l:k:p:b:e:s:c:huv --shell sh -- "${@}")" if [ "${?}" != "0" ] then @@ -474,6 +475,11 @@ Local_arguments () shift 2 ;; + --debian-installer-preseedfile) + LH_DEBIAN_INSTALLER_PRESEEDFILE="${2}" + shift 2 + ;; + -e|--encryption) LH_ENCRYPTION="${2}" shift 2 @@ -999,6 +1005,10 @@ LH_DEBIAN_INSTALLER="${LH_DEBIAN_INSTALLER}" # (Default: empty) LH_DEBIAN_INSTALLER_DISTRIBUTION="${LH_DEBIAN_INSTALLER_DISTRIBUTION}" +# \$LH_DEBIAN_INSTALLER_PRESEEDFILE: set debian-installer preseed filename/url +# (Default: ${LH_DEBIAN_INSTALLER_PRESEEDFILE}) +LH_DEBIAN_INSTALLER_PRESEEDFILE="${LH_DEBIAN_INSTALLER_PRESEEDFILE}" + # \$LH_ENCRYPTION: set encryption # (Default: ${LH_ENCRYPTION}) LH_ENCRYPTION="${LH_ENCRYPTION}" -- cgit v1.0