2007-09-23 08:05:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
2012-02-04 19:41:41 -01:00
|
|
|
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
|
2010-09-02 11:12:37 +00:00
|
|
|
##
|
|
|
|
## live-build 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:05:16 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Including common functions
|
2010-09-07 13:11:20 +00:00
|
|
|
. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
|
2007-09-23 08:05:16 +00:00
|
|
|
|
|
|
|
# Setting static variables
|
2009-01-15 01:37:42 -01:00
|
|
|
DESCRIPTION="$(Echo 'execute local preseed in chroot')"
|
2007-09-23 08:05:16 +00:00
|
|
|
HELP=""
|
|
|
|
USAGE="${PROGRAM} [--force]"
|
|
|
|
|
|
|
|
Arguments "${@}"
|
|
|
|
|
|
|
|
# Reading configuration files
|
2008-10-28 14:26:17 -01:00
|
|
|
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
|
2007-09-23 08:05:16 +00:00
|
|
|
Set_defaults
|
|
|
|
|
2008-04-15 16:40:36 +00:00
|
|
|
Echo_message "Begin executing local preseeds..."
|
2007-09-23 08:05:16 +00:00
|
|
|
|
|
|
|
# Requiring stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Require_stagefile .build/config .build/bootstrap
|
2007-09-23 08:05:16 +00:00
|
|
|
|
|
|
|
# Checking stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Check_stagefile .build/chroot_preseed
|
2007-09-23 08:05:16 +00:00
|
|
|
|
|
|
|
# Checking lock file
|
|
|
|
Check_lockfile .lock
|
|
|
|
|
|
|
|
# Creating lock file
|
|
|
|
Create_lockfile .lock
|
|
|
|
|
2011-09-28 07:53:58 +00:00
|
|
|
if ls config/preseed/*.preseed > /dev/null 2>&1 || \
|
2012-04-26 20:49:57 +00:00
|
|
|
ls config/preseed/*.preseed.chroot > /dev/null 2>&1 || \
|
|
|
|
ls chroot/root/packages.chroot.cfg > /dev/null 2>&1
|
2007-09-23 08:05:16 +00:00
|
|
|
then
|
|
|
|
# Check dependency
|
|
|
|
Check_package chroot/usr/bin/debconf-set-selections debconf
|
|
|
|
|
|
|
|
# Install dependency
|
|
|
|
Install_package
|
|
|
|
|
2012-04-26 20:49:57 +00:00
|
|
|
for PRESEED in config/preseed/*.preseed config/preseed/*.preseed.chroot chroot/root/packages.chroot.cfg
|
2007-09-23 08:05:16 +00:00
|
|
|
do
|
2011-10-12 18:08:45 +00:00
|
|
|
if [ -e "${PRESEED}" ]
|
|
|
|
then
|
|
|
|
# Copying local preseed
|
|
|
|
cp "${PRESEED}" chroot/root/preseed
|
2007-09-23 08:05:16 +00:00
|
|
|
|
2011-10-12 18:08:45 +00:00
|
|
|
Chroot chroot "debconf-set-selections /root/preseed"
|
2007-09-23 08:05:16 +00:00
|
|
|
|
2011-10-12 18:08:45 +00:00
|
|
|
# Removing local preseed file
|
|
|
|
rm -f chroot/root/preseed
|
|
|
|
fi
|
2007-09-23 08:05:16 +00:00
|
|
|
done
|
|
|
|
|
2012-04-26 20:49:57 +00:00
|
|
|
rm -f chroot/root/packages.chroot.cfg
|
|
|
|
|
2007-09-23 08:05:16 +00:00
|
|
|
# Remove dependency
|
|
|
|
Remove_package
|
|
|
|
|
|
|
|
# Creating stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Create_stagefile .build/chroot_preseed
|
2007-09-23 08:05:16 +00:00
|
|
|
fi
|