~asac/live-build/virtual-hdd-mtab-hack

« back to all changes in this revision

Viewing changes to helpers/lh_chroot_preseed

  • Committer: Daniel Baumann
  • Date: 2009-11-22 13:38:00 UTC
  • Revision ID: git-v1:a62f12110b19a52a58d7eae871012202cfa16055
Renaming categories to archive areas (Closes: #519690).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# lh_chroot_preseed(1) - use debconf preseeding file
 
4
# Copyright (C) 2006-2009 Daniel Baumann <daniel@debian.org>
 
5
#
 
6
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
 
7
# This is free software, and you are welcome to redistribute it
 
8
# under certain conditions; see COPYING for details.
 
9
 
 
10
set -e
 
11
 
 
12
# Including common functions
 
13
. "${LH_BASE:-/usr/share/live-helper}"/functions.sh
 
14
 
 
15
# Setting static variables
 
16
DESCRIPTION="$(Echo 'execute preseed in chroot')"
 
17
HELP=""
 
18
USAGE="${PROGRAM} [--force]"
 
19
 
 
20
Arguments "${@}"
 
21
 
 
22
# Reading configuration files
 
23
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
 
24
Set_defaults
 
25
 
 
26
Echo_message "Begin executing preseed..."
 
27
 
 
28
# Requiring stage file
 
29
Require_stagefile .stage/config .stage/bootstrap
 
30
 
 
31
# Checking stage file
 
32
Check_stagefile .stage/chroot_preseed
 
33
 
 
34
# Checking lock file
 
35
Check_lockfile .lock
 
36
 
 
37
# Creating lock file
 
38
Create_lockfile .lock
 
39
 
 
40
# Processing preseeds
 
41
for PRESEED in ${LH_PACKAGES_LISTS} ${LH_TASKS}
 
42
do
 
43
        if [ -f ${LH_BASE:-/usr/share/live-helper}/preseed/"${PRESEED}" ]
 
44
        then
 
45
                # Check dependency
 
46
                Check_package chroot/usr/bin/debconf-set-selections debconf
 
47
 
 
48
                # Install dependency
 
49
                Install_package
 
50
 
 
51
                # Copying preseed
 
52
                cp "${PRESEED}" chroot/root/preseed
 
53
 
 
54
                Chroot chroot "debconf-set-selections /root/preseed"
 
55
 
 
56
                # Removing preseed file
 
57
                rm -f chroot/root/preseed
 
58
 
 
59
                # Remove dependency
 
60
                Remove_package
 
61
 
 
62
                # Creating stage file
 
63
                Create_stagefile .stage/chroot_preseed
 
64
        fi
 
65
done