source: live-build/trunk/fuentes/scripts/build/lb_chroot_preseed @ 900

Last change on this file since 900 was 900, checked in by kbut, 3 years ago

add original source

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#!/bin/sh
2
3## live-build(7) - System Build Scripts
4## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
5##
6## This program 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
11set -e
12
13# Including common functions
14( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
15
16# Setting static variables
17DESCRIPTION="$(Echo 'execute local preseed in chroot')"
18HELP=""
19USAGE="${PROGRAM} [--force]"
20
21Arguments "${@}"
22
23# Reading configuration files
24Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
25Set_defaults
26
27Echo_message "Begin executing local preseeds..."
28
29# Requiring stage file
30Require_stagefile .build/config .build/bootstrap
31
32# Checking stage file
33Check_stagefile .build/chroot_preseed
34
35# Checking lock file
36Check_lockfile .lock
37
38# Creating lock file
39Create_lockfile .lock
40
41if ls config/preseed/*.preseed > /dev/null 2>&1 || \
42   ls config/preseed/*.preseed.chroot > /dev/null 2>&1 || \
43   ls chroot/root/packages.chroot.cfg > /dev/null 2>&1
44then
45        # Check dependency
46        Check_package chroot/usr/bin/debconf-set-selections debconf
47
48        # Install dependency
49        Install_package
50
51        for PRESEED in config/preseed/*.preseed config/preseed/*.preseed.chroot chroot/root/packages.chroot.cfg
52        do
53                if [ -e "${PRESEED}" ]
54                then
55                        # Copying local preseed
56                        cp "${PRESEED}" chroot/root/preseed
57
58                        Chroot chroot "debconf-set-selections /root/preseed"
59
60                        # Removing local preseed file
61                        rm -f chroot/root/preseed
62                fi
63        done
64
65        rm -f chroot/root/packages.chroot.cfg
66
67        # Remove dependency
68        Remove_package
69
70        # Creating stage file
71        Create_stagefile .build/chroot_preseed
72fi
Note: See TracBrowser for help on using the repository browser.