~asac/live-build/live-helper.install-kernel-with-no-initramfs

« back to all changes in this revision

Viewing changes to helpers/lh_bootstrap_cdebootstrap

  • Committer: Daniel Baumann
  • Date: 2007-09-23 08:04:47 UTC
  • Revision ID: git-v1:f4383da69d4642521cb07f8f970d9c9c759b44ee
Tags: 1.0_a2-1
Adding live-helper 1.0~a2-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
Set_defaults
20
20
 
21
21
# Checking stage file
22
 
Check_stagefile "${LIVE_ROOT}"/.stage/bootstrap
 
22
Check_stagefile .stage/bootstrap
23
23
 
24
24
# Checking lock file
25
 
Check_lockfile "${LIVE_ROOT}"/.lock
 
25
Check_lockfile .lock
26
26
 
27
27
# Creating lock file
28
 
Create_lockfile "${LIVE_ROOT}"/.lock
29
 
 
30
 
# Creating root directory
31
 
if [ ! -d "${LIVE_ROOT}" ]
32
 
then
33
 
        mkdir -p "${LIVE_ROOT}"
34
 
fi
 
28
Create_lockfile .lock
35
29
 
36
30
# Creating chroot directory
37
 
if [ ! -d "${LIVE_CHROOT}" ]
 
31
if [ ! -d chroot ]
38
32
then
39
 
        mkdir -p "${LIVE_CHROOT}"
 
33
        mkdir -p chroot
40
34
fi
41
35
 
42
36
# Setting cdebootstrap options
60
54
if [ -x "/usr/bin/cdebootstrap" ]
61
55
then
62
56
        # Restore old cache
63
 
        if [ -d "${LIVE_ROOT}"/cache/bootstrap ]
 
57
        if [ -d cache/bootstrap ]
64
58
        then
65
 
                mkdir -p "${LIVE_CHROOT}"/var/cache/bootstrap
66
 
                cp "${LIVE_ROOT}"/cache/bootstrap/*.deb "${LIVE_CHROOT}"/var/cache/bootstrap
 
59
                mkdir -p chroot/var/cache/bootstrap
 
60
                cp cache/bootstrap/*.deb chroot/var/cache/bootstrap
67
61
        fi
68
62
 
69
63
        if [ "${LH_CACHE}" = "enabled" ]
70
64
        then
71
65
                # Executing cdebootstrap (download-only)
72
 
                cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
 
66
                cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_LOCAL}"
73
67
 
74
68
                # Removing old cache
75
 
                if [ -d "${LIVE_ROOT}"/cache/bootstrap ]
 
69
                if [ -d cache/bootstrap ]
76
70
                then
77
 
                        rm -f "${LIVE_ROOT}"/cache/bootstrap/*.deb
 
71
                        rm -f cache/bootstrap/*.deb
78
72
                fi
79
73
 
80
74
                # Saving new cache
81
 
                if [ ! -d "${LIVE_ROOT}"/cache/bootstrap ]
 
75
                if [ ! -d cache/bootstrap ]
82
76
                then
83
 
                        mkdir -p "${LIVE_ROOT}"/cache/bootstrap
 
77
                        mkdir -p cache/bootstrap
84
78
                fi
85
79
 
86
 
                cp "${LIVE_CHROOT}"/var/cache/bootstrap/*.deb "${LIVE_ROOT}"/cache/bootstrap
 
80
                cp chroot/var/cache/bootstrap/*.deb cache/bootstrap
87
81
        fi
88
82
 
89
83
        # Executing cdebootstrap (regular run)
90
 
        cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
 
84
        cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_LOCAL}"
91
85
else
92
86
        echo "E: Can't process file /usr/bin/cdebootstrap (FIXME)"
93
87
        exit 1
94
88
fi
95
89
 
96
90
# Removing bootstrap cache
97
 
if [ -d "${LIVE_CHROOT}/var/cache/bootstrap" ]
 
91
if [ -d chroot/var/cache/bootstrap ]
98
92
then
99
 
        rm -rf "${LIVE_CHROOT}"/var/cache/bootstrap
 
93
        rm -rf chroot/var/cache/bootstrap
100
94
fi
101
95
 
102
96
# Creating stage file
103
 
Create_stagefile "${LIVE_ROOT}"/.stage/bootstrap
 
97
Create_stagefile .stage/bootstrap