summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-10-08 13:01:39 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-10-08 13:01:39 (EDT)
commitd4318c2320fa13197a18eda991c5576a01e1dab2 (patch)
tree83cccffae312fde5a2ce15272e1331292d3cddf4
parentd7325b15a0949cef77707be5fd0bf864d6338c57 (diff)
lib/chroot.sh: Remove
Replaced by lib/session.sh.
-rw-r--r--lib/chroot.sh82
-rw-r--r--lib/local.mk1
2 files changed, 0 insertions, 83 deletions
diff --git a/lib/chroot.sh b/lib/chroot.sh
deleted file mode 100644
index 4aea1d1..0000000
--- a/lib/chroot.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-# Functions for setting up isolated file system environments
-#
-# Copyright (C) 2014 Patrick "P. J." McDermott
-#
-# This file is part of the ProteanOS Development Kit.
-#
-# The ProteanOS Development Kit is free software: you can redistribute
-# it and/or modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# The ProteanOS Development Kit is distributed in the hope that it
-# will be useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with the ProteanOS Development Kit. If not, see
-# <http://www.gnu.org/licenses/>.
-
-[ "x${_CHROOT_SM+set}" = 'xset' ] && return 0
-_CHROOT_SM=1
-
-use profile
-
-chroot_mount()
-{
- local root="${1}"
- local arch=
- local plat=
- local fs=
- local dir=
- local fstype=
- local options=
-
- arch="$(cat "${root}/etc/proteanos_arch")"
- plat="$(cat "${root}/etc/proteanos_plat")"
-
- while read fs dir fstype options; do
- [ "x${dir}" = 'x' ] && continue
- mount -t "${fstype}" -o "${options}" "${fs}" "${root}/${dir}"
- done <<-EOF
- $(profile_get_fstab "${arch}" "${plat}")
- EOF
-}
-
-chroot_umount()
-{
- local root="${1}"
- local arch=
- local plat=
- local fs=
- local dir=
- local fstype=
- local options=
-
- arch="$(cat "${root}/etc/proteanos_arch")"
- plat="$(cat "${root}/etc/proteanos_plat")"
-
- while read fs dir fstype options; do
- [ "x${dir}" = 'x' ] && continue
- # umount sometimes complains that the /dev file system is busy.
- # Here's a kludge to try to handle that. We better make sure
- # bind mounts get unmounted; otherwise, `rm -Rf ${root}` can be
- # painful.
- while ! umount "${root}/${dir}"; do
- sleep 1
- done
- done <<-EOF
- $(profile_get_fstab "${arch}" "${plat}" | sed -n '1!G;h;$p')
- EOF
-}
-
-chroot_exec()
-{
- local root="${1}"
- shift 1
-
- chroot_mount "${root}"
- chroot "${root}" "${@}"
- chroot_umount "${root}"
-}
diff --git a/lib/local.mk b/lib/local.mk
index 66d203f..f87ab10 100644
--- a/lib/local.mk
+++ b/lib/local.mk
@@ -11,7 +11,6 @@ pkgdata_sources = \
lib/pkg.sh \
lib/mutex.sh \
lib/session.sh \
- lib/chroot.sh \
lib/opkg.sh \
lib/rand.sh \
lib/cmd.sh \