lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master af59b78 3/3: Add a script to destroy a chroot


From: Greg Chicares
Subject: [lmi-commits] [lmi] master af59b78 3/3: Add a script to destroy a chroot
Date: Fri, 27 Sep 2019 21:00:39 -0400 (EDT)

branch: master
commit af59b789226ae69a6e4ec45a0a1c8c848e61976f
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Add a script to destroy a chroot
---
 lmi_destroy_chroot.sh | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/lmi_destroy_chroot.sh b/lmi_destroy_chroot.sh
new file mode 100755
index 0000000..42f67bc
--- /dev/null
+++ b/lmi_destroy_chroot.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# Destroy a chroot for cross-building "Let me illustrate...".
+#
+# Copyright (C) 2016, 2017, 2018, 2019 Gregory W. Chicares.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program 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 this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+#
+# http://savannah.nongnu.org/projects/lmi
+# email: <address@hidden>
+# snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+set -vx
+
+. ./lmi_setup_inc.sh
+
+assert_su
+assert_not_chrooted
+
+umount /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
+umount /srv/chroot/"${CHRTNAME}"/dev/pts
+umount /srv/chroot/"${CHRTNAME}"/proc
+
+rm -rf "$(schroot --chroot="${CHRTNAME}" --location)"
+rm /etc/schroot/chroot.d/"${CHRTNAME}".conf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]