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

Last change on this file since 900 was 900, checked in by kbut, 4 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 'manage /etc/debian_chroot')"
18HELP=""
19USAGE="${PROGRAM} {install|remove} [--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
27# Requiring stage file
28Require_stagefile .build/config .build/bootstrap
29
30case "${1}" in
31        install)
32                Echo_message "Configuring file /etc/debian_chroot"
33
34                # Checking stage file
35                Check_stagefile .build/chroot_debianchroot
36
37                # Checking lock file
38                Check_lockfile .lock
39
40                # Creating lock file
41                Create_lockfile .lock
42
43                if [ -f chroot/etc/debian_chroot ]
44                then
45                        # Save chroot file
46                        mv chroot/etc/debian_chroot chroot/etc/debian_chroot.orig
47                fi
48
49                # Create chroot file
50                echo "live" > chroot/etc/debian_chroot
51
52                # Creating stage file
53                Create_stagefile .build/chroot_debianchroot
54                ;;
55
56        remove)
57                Echo_message "Deconfiguring file /etc/debian_chroot"
58
59                # Checking lock file
60                Check_lockfile .lock
61
62                # Creating lock file
63                Create_lockfile .lock
64
65                if [ -f chroot/etc/debian_chroot.orig ]
66                then
67                        # Restore chroot file
68                        mv chroot/etc/debian_chroot.orig chroot/etc/debian_chroot
69                else
70                        # Remove chroot file
71                        rm -f chroot/etc/debian_chroot
72                fi
73
74                # Removing stage file
75                rm -f .build/chroot_debianchroot
76                ;;
77
78        *)
79                Usage
80                ;;
81esac
Note: See TracBrowser for help on using the repository browser.