2007-09-23 08:05:11 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2007-09-23 08:05:16 +00:00
|
|
|
# lh_chroot_preseed(1) - use debconf preseeding file
|
2008-03-06 14:43:00 -01:00
|
|
|
# Copyright (C) 2006-2008 Daniel Baumann <daniel@debian.org>
|
2007-09-23 08:05:11 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Including common functions
|
|
|
|
LH_BASE="${LH_BASE:-/usr/share/live-helper}"
|
|
|
|
|
|
|
|
for FUNCTION in "${LH_BASE}"/functions/*.sh
|
|
|
|
do
|
|
|
|
. "${FUNCTION}"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Setting static variables
|
|
|
|
DESCRIPTION="execute preseed in chroot"
|
|
|
|
HELP=""
|
|
|
|
USAGE="${PROGRAM} [--force]"
|
|
|
|
|
|
|
|
Arguments "${@}"
|
|
|
|
|
|
|
|
# Reading configuration files
|
2008-04-07 10:10:21 +00:00
|
|
|
Read_conffile config/all config/common config/bootstrap config/chroot config/binary config/source
|
2007-09-23 08:05:11 +00:00
|
|
|
Set_defaults
|
|
|
|
|
|
|
|
Echo_message "Begin executing preseed..."
|
|
|
|
|
|
|
|
# Requiring stage file
|
|
|
|
Require_stagefile .stage/bootstrap
|
|
|
|
|
|
|
|
# Checking stage file
|
|
|
|
Check_stagefile .stage/chroot_preseed
|
|
|
|
|
|
|
|
# Checking lock file
|
|
|
|
Check_lockfile .lock
|
|
|
|
|
|
|
|
# Creating lock file
|
|
|
|
Create_lockfile .lock
|
|
|
|
|
2007-09-23 08:05:16 +00:00
|
|
|
# Processing preseeds
|
2007-09-23 08:05:17 +00:00
|
|
|
for PRESEED in ${LH_PACKAGES_LISTS} ${LH_TASKS}
|
2007-09-23 08:05:16 +00:00
|
|
|
do
|
|
|
|
if [ -f ${LH_BASE:-/usr/share/live-helper}/preseed/"${PRESEED}" ]
|
|
|
|
then
|
|
|
|
# Check dependency
|
|
|
|
Check_package chroot/usr/bin/debconf-set-selections debconf
|
2007-09-23 08:05:11 +00:00
|
|
|
|
2007-09-23 08:05:16 +00:00
|
|
|
# Install dependency
|
|
|
|
Install_package
|
2007-09-23 08:05:11 +00:00
|
|
|
|
2007-09-23 08:05:16 +00:00
|
|
|
# Copying preseed
|
|
|
|
cp "${PRESEED}" chroot/root/preseed
|
2007-09-23 08:05:11 +00:00
|
|
|
|
2007-09-23 08:05:16 +00:00
|
|
|
Chroot "debconf-set-selections /root/preseed"
|
2007-09-23 08:05:11 +00:00
|
|
|
|
2007-09-23 08:05:16 +00:00
|
|
|
# Removing preseed file
|
|
|
|
rm -f chroot/root/preseed
|
2007-09-23 08:05:11 +00:00
|
|
|
|
2007-09-23 08:05:16 +00:00
|
|
|
# Remove dependency
|
|
|
|
Remove_package
|
2007-09-23 08:05:11 +00:00
|
|
|
|
2007-09-23 08:05:16 +00:00
|
|
|
# Creating stage file
|
|
|
|
Create_stagefile .stage/chroot_preseed
|
|
|
|
fi
|
|
|
|
done
|