~tom-gall/live-build/integrate-linaro-media-create

« back to all changes in this revision

Viewing changes to scripts/build/chroot_tasks

  • Committer: Daniel Baumann
  • Date: 2011-03-09 18:17:15 UTC
  • Revision ID: git-v1:74c3ad26d5d710282da6f51b746a33ad6370b8ce
Rearranging helpers scripts in source tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# lh_chroot_tasks(1) - install tasks into chroot
 
4
# Copyright (C) 2006-2010 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}"/scripts/build.sh
 
14
 
 
15
# Setting static variables
 
16
DESCRIPTION="$(Echo 'install tasks into 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 installing tasks..."
 
27
 
 
28
# Requiring stage file
 
29
Require_stagefile .stage/config .stage/bootstrap
 
30
 
 
31
# Checking stage file
 
32
Check_stagefile .stage/chroot_tasks
 
33
 
 
34
# Checking lock file
 
35
Check_lockfile .lock
 
36
 
 
37
# Creating lock file
 
38
Create_lockfile .lock
 
39
 
 
40
if [ -n "${LH_TASKS}" ] && [ "${LH_TASKS}" != "none" ]
 
41
then
 
42
        # Restoring cache
 
43
        Restore_cache cache/packages_chroot
 
44
 
 
45
        # Checking depends
 
46
        case "${LH_TASKSEL}" in
 
47
                aptitude)
 
48
                        Check_package chroot/usr/bin/aptitude aptitude
 
49
                        ;;
 
50
 
 
51
                tasksel)
 
52
                        Check_package chroot/usr/bin/tasksel tasksel
 
53
                        ;;
 
54
        esac
 
55
 
 
56
        # Installing depends
 
57
        Install_package
 
58
 
 
59
        # Installing tasks
 
60
        case "${LH_TASKSEL}" in
 
61
                aptitude)
 
62
                        Chroot chroot "aptitude ${APTITUDE_OPTIONS} install ${LH_TASKS}"
 
63
                        ;;
 
64
 
 
65
                tasksel)
 
66
                        for TASK in ${LH_TASKS}
 
67
                        do
 
68
                                Chroot chroot "tasksel --debconf-apt-progress --logstderr install ${TASK}"
 
69
                        done
 
70
                        ;;
 
71
        esac
 
72
 
 
73
        # Removing depends
 
74
        Remove_package
 
75
 
 
76
        # Saving cache
 
77
        Save_cache cache/packages_chroot
 
78
 
 
79
        # Creating stage file
 
80
        Create_stagefile .stage/chroot_tasks
 
81
fi