[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 6fe3ab7 10/10: Customize /etc/schroot/lmi_pro
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 6fe3ab7 10/10: Customize /etc/schroot/lmi_profile/fstab |
Date: |
Fri, 26 Jun 2020 08:05:21 -0400 (EDT) |
branch: master
commit 6fe3ab737c9852feae317ecd2526381b420144ef
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Customize /etc/schroot/lmi_profile/fstab
A 'directory' schroot sets up the given mounts on entry, and removes
them on exit. An 8-4-4-4-12 UUID is appended to the apparent mountpoint,
which looks like this on the host:
/var/cache/schroots bound on
/run/schroot/mount/lmi_bullseye_2-${UUID}/var/cache/apt/archives
The bind mounts that the 'lmi_setup*.sh' scripts set up should now be
unnecessary, and they'll be removed soon. For the moment, it appears
that they can coexist with the new bind mounts.
---
lmi_setup_00c.sh | 23 +++++++++++++++++++++--
lmi_setup_11.sh | 23 +++++++++++++++++++++--
2 files changed, 42 insertions(+), 4 deletions(-)
diff --git a/lmi_setup_00c.sh b/lmi_setup_00c.sh
index b39bc02..b1ddae2 100755
--- a/lmi_setup_00c.sh
+++ b/lmi_setup_00c.sh
@@ -50,11 +50,30 @@ EOF
mkdir -p /etc/schroot/lmi_profile
rm -f /etc/schroot/lmi_profile/copyfiles
touch /etc/schroot/lmi_profile/copyfiles
-rm -f /etc/schroot/lmi_profile/fstab
-touch /etc/schroot/lmi_profile/fstab
rm -f /etc/schroot/lmi_profile/nssdatabases
touch /etc/schroot/lmi_profile/nssdatabases
+cat >/etc/schroot/lmi_profile/fstab <<EOF
+# fstab: static file system information for chroots.
+# Note that the mount point will be prefixed by the chroot path
+# (CHROOT_PATH)
+#
+# <file system> <mount point> <type> <options> <dump>
<pass>
+/dev/pts /dev/pts none rw,bind 0 0
+/proc /proc none rw,bind 0 0
+/srv/cache_for_lmi /srv/cache_for_lmi none rw,bind 0 0
+/var/cache/lmi_schroots /var/cache/apt/archives none rw,bind 0 0
+# It is convenient to bind a redhat cache mountpoint as well:
+/var/cache/lmi_schroots /var/cache/yum none rw,bind 0 0
+# ...and also a pass-through mount for an intermediate chroot:
+/var/cache/lmi_schroots /var/cache/lmi_schroots none rw,bind 0 0
+#
+# schroot creates a mountpoint if it does not already exist:
+# /tmp /nonexistent/mountpoint none rw,bind 0 0
+# but of course schroot won't create a nonexistent filesystem:
+# /dev/nonexistent /var/cache/nonexistent none rw,bind 0 0
+EOF
+
# Use the same cache directory for all chroot package downloads.
#
# Packages ('.deb' as well as '.rpm') are uniquely named, so no
diff --git a/lmi_setup_11.sh b/lmi_setup_11.sh
index 5f008da..cc122f7 100755
--- a/lmi_setup_11.sh
+++ b/lmi_setup_11.sh
@@ -87,11 +87,30 @@ EOF
mkdir -p /etc/schroot/lmi_profile
rm -f /etc/schroot/lmi_profile/copyfiles
touch /etc/schroot/lmi_profile/copyfiles
-rm -f /etc/schroot/lmi_profile/fstab
-touch /etc/schroot/lmi_profile/fstab
rm -f /etc/schroot/lmi_profile/nssdatabases
touch /etc/schroot/lmi_profile/nssdatabases
+cat >/etc/schroot/lmi_profile/fstab <<EOF
+# fstab: static file system information for chroots.
+# Note that the mount point will be prefixed by the chroot path
+# (CHROOT_PATH)
+#
+# <file system> <mount point> <type> <options> <dump>
<pass>
+/dev/pts /dev/pts none rw,bind 0 0
+/proc /proc none rw,bind 0 0
+/srv/cache_for_lmi /srv/cache_for_lmi none rw,bind 0 0
+/var/cache/lmi_schroots /var/cache/apt/archives none rw,bind 0 0
+# It is convenient to bind a redhat cache mountpoint as well:
+/var/cache/lmi_schroots /var/cache/yum none rw,bind 0 0
+# ...and also a pass-through mount for an intermediate chroot:
+/var/cache/lmi_schroots /var/cache/lmi_schroots none rw,bind 0 0
+#
+# schroot creates a mountpoint if it does not already exist:
+# /tmp /nonexistent/mountpoint none rw,bind 0 0
+# but of course schroot won't create a nonexistent filesystem:
+# /dev/nonexistent /var/cache/nonexistent none rw,bind 0 0
+EOF
+
# Experimentally show whether anything's already here:
du -sb /srv/chroot/"${CHRTNAME}"/var/cache/apt/archives
# Bind-mount apt archives for the chroot's debian release. Do this:
- [lmi-commits] [lmi] master updated (b745ce9 -> 6fe3ab7), Greg Chicares, 2020/06/26
- [lmi-commits] [lmi] master 5a787a9 04/10: Merge centos package caches, Greg Chicares, 2020/06/26
- [lmi-commits] [lmi] master 5777e42 08/10: Don't mount /proc or /dev/pts if already mounted, Greg Chicares, 2020/06/26
- [lmi-commits] [lmi] master 5a42ec0 06/10: Fix defect introduced 20200528T1107Z: wrong dependency order, Greg Chicares, 2020/06/26
- [lmi-commits] [lmi] master 501ce73 05/10: Merge all chroot package caches, Greg Chicares, 2020/06/26
- [lmi-commits] [lmi] master ff91e9b 07/10: Use schroot 'directory' type instead of deprecated 'plain', Greg Chicares, 2020/06/26
- [lmi-commits] [lmi] master 13805c4 01/10: Make a command handier, Greg Chicares, 2020/06/26
- [lmi-commits] [lmi] master 2c31fee 09/10: Destroy chroots more carefully, Greg Chicares, 2020/06/26
- [lmi-commits] [lmi] master 026c587 02/10: Replace an improperly hardcoded value with a variable, Greg Chicares, 2020/06/26
- [lmi-commits] [lmi] master 6236aea 03/10: Rationalize order of unmounting, Greg Chicares, 2020/06/26
- [lmi-commits] [lmi] master 6fe3ab7 10/10: Customize /etc/schroot/lmi_profile/fstab,
Greg Chicares <=