live-build/helpers/lh_chroot_preseed

79 lines
1.5 KiB
Plaintext
Raw Normal View History

2007-09-23 08:05:11 +00:00
#!/bin/sh
# lh_chroot_preseed(1) - mount /proc
# 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.
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
Read_conffile config/common
Read_conffile config/bootstrap
Read_conffile config/chroot
Read_conffile config/binary
Read_conffile config/source
Set_defaults
2007-09-23 08:05:11 +00:00
if [ -z "${LIVE_PRESEED}" ]
then
exit 0
fi
2007-09-23 08:05:11 +00:00
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:11 +00:00
if [ -f "${LIVE_PRESEED}" ]
2007-09-23 08:05:11 +00:00
then
2007-09-23 08:05:11 +00:00
# Check dependency
Check_package chroot/usr/bin/debconf-set-selections debconf
2007-09-23 08:05:11 +00:00
2007-09-23 08:05:11 +00:00
# Install dependency
Install_package
2007-09-23 08:05:11 +00:00
2007-09-23 08:05:11 +00:00
# Copying preseed
cp "${LIVE_PRESEED}" chroot/root/preseed
2007-09-23 08:05:11 +00:00
2007-09-23 08:05:11 +00:00
Chroot "debconf-set-selections /root/preseed"
2007-09-23 08:05:11 +00:00
2007-09-23 08:05:11 +00:00
# Removing preseed file
rm -f chroot/root/preseed
2007-09-23 08:05:11 +00:00
2007-09-23 08:05:11 +00:00
# Remove dependency
Remove_package
2007-09-23 08:05:11 +00:00
2007-09-23 08:05:11 +00:00
# Creating stage file
Create_stagefile .stage/chroot_preseed
2007-09-23 08:05:11 +00:00
else
Echo_error "'${LIVE_PRESEED}' file doesn't exists."
exit 1
fi