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

« back to all changes in this revision

Viewing changes to helpers/lh_bootstrap_copy

  • 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_bootstrap_copy(1) - bootstrap by copying the host system
 
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 'bootstrap by copying the host system')"
 
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
if [ "${LH_BOOTSTRAP}" != "copy" ]
 
27
then
 
28
        exit 0
 
29
fi
 
30
 
 
31
# Check architecture
 
32
Check_crossarchitecture
 
33
 
 
34
Echo_message "Begin bootstrapping system..."
 
35
 
 
36
# Ensure that a system is built as root
 
37
lh testroot
 
38
 
 
39
# Checking stage file
 
40
Check_stagefile .stage/bootstrap
 
41
 
 
42
# Checking lock file
 
43
Check_lockfile .lock
 
44
 
 
45
# Creating lock file
 
46
Create_lockfile .lock
 
47
 
 
48
# Copying host system
 
49
mkdir chroot
 
50
cd chroot
 
51
tar c / --exclude /proc --exclude /sys --exclude "$(dirname ${PWD})" | tar xv
 
52
cd ..
 
53
 
 
54
# Creating stage file
 
55
Create_stagefile .stage/bootstrap