~oem-solutions-releng/live-build/lb-sg-2.x-add-support-for-xz-and-bzip2-compression

« back to all changes in this revision

Viewing changes to helpers/lh_bootstrap_copy

  • Committer: Daniel Baumann
  • Date: 2011-03-09 17:19:41 UTC
  • Revision ID: daniel@debian.org-20110309171941-vyn0zxupujidmbu9
Adding live-helper 1.0~a15-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# lh_bootstrap_copy(1) - bootstrap by copying the host system
 
4
# Copyright (C) 2006-2007 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="${LH_BASE:-/usr/share/live-helper}"
 
14
 
 
15
for FUNCTION in "${LH_BASE}"/functions/*.sh
 
16
do
 
17
        . "${FUNCTION}"
 
18
done
 
19
 
 
20
# Setting static variables
 
21
DESCRIPTION="bootstrap by copying the host system"
 
22
HELP=""
 
23
USAGE="${PROGRAM} [--force]"
 
24
 
 
25
Arguments "${@}"
 
26
 
 
27
# Reading configuration files
 
28
Read_conffile config/common
 
29
Read_conffile config/bootstrap
 
30
Read_conffile config/chroot
 
31
Read_conffile config/binary
 
32
Read_conffile config/source
 
33
Set_defaults
 
34
 
 
35
if [ "${LH_BOOTSTRAP}" != "copy" ]
 
36
then
 
37
        exit 0
 
38
fi
 
39
 
 
40
Echo_message "Begin bootstrapping system..."
 
41
 
 
42
# Ensure that a system is built as root
 
43
lh_testroot
 
44
 
 
45
# Checking stage file
 
46
Check_stagefile .stage/bootstrap
 
47
 
 
48
# Checking lock file
 
49
Check_lockfile .lock
 
50
 
 
51
# Creating lock file
 
52
Create_lockfile .lock
 
53
 
 
54
# Copying host system
 
55
find / ! -name /proc ! -name /sys ! -name "`dirname ${PWD}`"  | xargs cp -a chroot
 
56
 
 
57
# Creating stage file
 
58
Create_stagefile .stage/bootstrap