2007-10-31 09:20:03 -01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
2015-01-04 18:05:39 -01:00
|
|
|
## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
|
2010-09-02 11:12:37 +00:00
|
|
|
##
|
2012-07-29 23:59:00 +00:00
|
|
|
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
2010-09-02 11:12:37 +00:00
|
|
|
## This is free software, and you are welcome to redistribute it
|
|
|
|
## under certain conditions; see COPYING for details.
|
|
|
|
|
2007-10-31 09:20:03 -01:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Including common functions
|
2012-08-27 13:52:29 +00:00
|
|
|
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
|
2007-10-31 09:20:03 -01:00
|
|
|
|
|
|
|
# Setting static variables
|
2015-02-05 02:30:47 -01:00
|
|
|
DESCRIPTION="Mount /dev/pts"
|
2007-10-31 09:20:03 -01:00
|
|
|
HELP=""
|
|
|
|
USAGE="${PROGRAM} {install|remove} [--force]"
|
|
|
|
|
|
|
|
Arguments "${@}"
|
|
|
|
|
|
|
|
# Reading configuration files
|
2008-10-28 14:26:17 -01:00
|
|
|
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
|
2007-10-31 09:20:03 -01:00
|
|
|
Set_defaults
|
|
|
|
|
|
|
|
# Requiring stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Require_stagefile .build/config .build/bootstrap
|
2007-10-31 09:20:03 -01:00
|
|
|
|
|
|
|
case "${1}" in
|
|
|
|
install)
|
2007-11-13 10:49:43 -01:00
|
|
|
Echo_message "Begin mounting /dev/pts..."
|
|
|
|
|
2007-10-31 09:20:03 -01:00
|
|
|
# Checking stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Check_stagefile .build/chroot_devpts
|
2007-10-31 09:20:03 -01:00
|
|
|
|
|
|
|
# Checking lock file
|
|
|
|
Check_lockfile .lock
|
|
|
|
|
|
|
|
# Creating lock file
|
|
|
|
Create_lockfile .lock
|
|
|
|
|
2013-02-18 11:56:07 -01:00
|
|
|
# Creating mountpoint
|
|
|
|
mkdir -p chroot/dev/pts
|
2007-10-31 09:20:03 -01:00
|
|
|
|
2013-02-18 11:56:07 -01:00
|
|
|
# Mounting /dev/pts
|
2013-10-23 19:01:03 +00:00
|
|
|
mount devpts-live -t devpts -o gid=5,mode=620 chroot/dev/pts || true
|
2007-10-31 09:20:03 -01:00
|
|
|
|
|
|
|
# Creating stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Create_stagefile .build/chroot_devpts
|
2007-10-31 09:20:03 -01:00
|
|
|
;;
|
|
|
|
|
|
|
|
remove)
|
2007-11-13 10:49:43 -01:00
|
|
|
Echo_message "Begin unmounting /dev/pts..."
|
|
|
|
|
2007-10-31 09:20:03 -01:00
|
|
|
# Checking lock file
|
|
|
|
Check_lockfile .lock
|
|
|
|
|
|
|
|
# Creating lock file
|
|
|
|
Create_lockfile .lock
|
|
|
|
|
|
|
|
# Unmounting /dev/pts
|
2013-02-18 11:56:07 -01:00
|
|
|
if grep -qs "$(pwd)/chroot/dev/pts" /proc/mounts || Find_files chroot/dev/pts/*
|
2007-11-11 19:33:43 -01:00
|
|
|
then
|
2013-02-18 11:56:07 -01:00
|
|
|
umount chroot/dev/pts
|
|
|
|
else
|
|
|
|
umount -f chroot/dev/pts > /dev/null 2>&1 || true
|
2007-11-11 19:33:43 -01:00
|
|
|
fi
|
2007-10-31 09:20:03 -01:00
|
|
|
|
|
|
|
# Removing stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
rm -f .build/chroot_devpts
|
2007-10-31 09:20:03 -01:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
Usage
|
|
|
|
;;
|
|
|
|
esac
|