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

« back to all changes in this revision

Viewing changes to helpers/lh_chroot_resolv

  • 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:
16
16
Set_defaults
17
17
 
18
18
# Requiring stage file
19
 
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
 
19
Require_stagefile .stage/bootstrap
20
20
 
21
21
# Checking lock file
22
 
Check_lockfile "${LIVE_ROOT}"/.lock
 
22
Check_lockfile .lock
23
23
 
24
24
# Creating lock file
25
 
Create_lockfile "${LIVE_ROOT}"/.lock
 
25
Create_lockfile .lock
26
26
 
27
27
case "${1}" in
28
28
        install)
29
29
                # Checking stage file
30
 
                Check_stagefile "${LIVE_ROOT}"/.stage/chroot_resolv
 
30
                Check_stagefile .stage/chroot_resolv
31
31
 
32
 
                if [ -f "${LIVE_CHROOT}"/etc/resolv.conf ]
 
32
                if [ -f chroot/etc/resolv.conf ]
33
33
                then
34
34
                        # Save resolv file
35
 
                        cp "${LIVE_CHROOT}"/etc/resolv.conf "${LIVE_CHROOT}"/etc/resolv.conf.orig
 
35
                        cp chroot/etc/resolv.conf chroot/etc/resolv.conf.orig
36
36
                fi
37
37
 
38
38
                if [ -f /etc/resolv.conf ]
39
39
                then
40
40
                        # Copy resolv file
41
 
                        cp /etc/resolv.conf "${LIVE_CHROOT}"/etc/resolv.conf
 
41
                        cp /etc/resolv.conf chroot/etc/resolv.conf
42
42
                fi
43
43
 
44
44
                # Creating stage file
45
 
                Create_stagefile "${LIVE_ROOT}"/.stage/chroot_resolv
 
45
                Create_stagefile .stage/chroot_resolv
46
46
                ;;
47
47
 
48
48
        remove)
49
 
                if [ -f "${LIVE_CHROOT}"/etc/resolv.conf.orig ]
 
49
                if [ -f chroot/etc/resolv.conf.orig ]
50
50
                then
51
51
                        # Restore resolv file
52
 
                        mv "${LIVE_CHROOT}"/etc/resolv.conf.orig "${LIVE_CHROOT}"/etc/resolv.conf
 
52
                        mv chroot/etc/resolv.conf.orig chroot/etc/resolv.conf
53
53
                else
54
54
                        # Remove resolv file
55
 
                        rm -f "${LIVE_CHROOT}"/etc/resolv.conf
 
55
                        rm -f chroot/etc/resolv.conf
56
56
                fi
57
57
 
58
58
                # Removing stage file
59
 
                rm -f "${LIVE_ROOT}"/.stage/chroot_resolv
 
59
                rm -f .stage/chroot_resolv
60
60
                ;;
61
61
 
62
62
        *)