Moving partial python rewrite to separate branch, let's do it in the jessie+1 cycle...
[debian-live-build.git] / scripts / build / chroot_proc
blob6d0de2f908851722647600b17f122e71d851f72f
1 #!/bin/sh
3 ## live-build(7) - System Build Scripts
4 ## Copyright (C) 2006-2014 Daniel Baumann <mail@daniel-baumann.ch>
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.
11 set -e
13 # Including common functions
14 [ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
16 # Setting static variables
17 DESCRIPTION="$(Echo 'mount /proc')"
18 HELP=""
19 USAGE="${PROGRAM} {install|remove} [--force]"
21 Arguments "${@}"
23 # Reading configuration files
24 Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
25 Set_defaults
27 # Requiring stage file
28 Require_stagefile .build/config .build/bootstrap
30 case "${1}" in
31 install)
32 Echo_message "Begin mounting /proc..."
34 # Checking stage file
35 Check_stagefile .build/chroot_proc
37 # Checking lock file
38 Check_lockfile .lock
40 # Creating lock file
41 Create_lockfile .lock
43 # Creating mountpoint
44 mkdir -p chroot/proc
46 # Mounting /proc
47 mount proc-live -t proc chroot/proc
49 # Creating stage file
50 Create_stagefile .build/chroot_proc
53 remove)
54 Echo_message "Begin unmounting /proc..."
56 # Checking lock file
57 Check_lockfile .lock
59 # Creating lock file
60 Create_lockfile .lock
62 # Workaround binfmt-support /proc locking
63 if [ -e chroot/proc/sys/fs/binfmt_misc/status ]
64 then
65 umount chroot/proc/sys/fs/binfmt_misc
68 # Unmounting /proc
69 if [ -e chroot/proc/version ]
70 then
71 umount chroot/proc
74 # Removing stage file
75 rm -f .build/chroot_proc
79 Usage
81 esac