[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master ff91e9b 07/10: Use schroot 'directory' type i
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master ff91e9b 07/10: Use schroot 'directory' type instead of deprecated 'plain' |
Date: |
Fri, 26 Jun 2020 08:05:20 -0400 (EDT) |
branch: master
commit ff91e9b753a39ad71af14682071ad0b0d7e37f13
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Use schroot 'directory' type instead of deprecated 'plain'
https://gitlab.com/codelibre/schroot/-/blob/master/NEWS.md
| The plain chroot type has been removed. [...]
| Please replace these with the directory chroot type.
The 'directory' type uses a "profile". The 'default' profile mounts
/home, which is dangerous. Even the 'minimal' profile copies four nss
databases into the chroot, which is needless. Created an 'lmi_profile'
type to meet lmi's needs. For now, the three files it contains are all
empty, but soon its 'fstab' will be customized.
A 'directory' chroot with this empty profile is not identical to a
'plain' chroot: it always runs the '/etc/schroot/setup.d/' scripts
(whereas 'plain' chroots ran none), and therefore it takes about half
a second longer to enter.
Incremented $CHRTVER because this is a significant change.
Incidentally added a couple of comments to '.conf' files. Notably,
the 'setup.config' key is mentioned because it may be handy, though
it's not used because it is apparently deprecated.
---
lmi_setup_00c.sh | 13 ++++++++++++-
lmi_setup_11.sh | 12 +++++++++++-
lmi_setup_inc.sh | 2 +-
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/lmi_setup_00c.sh b/lmi_setup_00c.sh
index e75d362..b424350 100755
--- a/lmi_setup_00c.sh
+++ b/lmi_setup_00c.sh
@@ -35,15 +35,26 @@ assert_not_chrooted
# Installing 'schroot' creates this 'chroot.d' directory.
cat >/etc/schroot/chroot.d/centos7lmi.conf <<EOF
[centos7lmi]
+# aliases=deliberately_unused
description=centos-7.7
directory=/srv/chroot/centos7lmi
users=${CHROOT_USERS}
groups=${NORMAL_GROUP}
root-groups=root
shell=/bin/zsh
-type=plain
+type=directory
+profile=lmi_profile
+# setup.config=lmi_profile/deliberately_unused
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
+
# 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 2acd75d..906c314 100755
--- a/lmi_setup_11.sh
+++ b/lmi_setup_11.sh
@@ -69,9 +69,19 @@ users=${CHROOT_USERS}
groups=${NORMAL_GROUP}
root-groups=root
shell=/bin/zsh
-type=plain
+type=directory
+profile=lmi_profile
+# setup.config=lmi_profile/deliberately_unused
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
+
# 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:
diff --git a/lmi_setup_inc.sh b/lmi_setup_inc.sh
index 4fa0846..8ed1073 100755
--- a/lmi_setup_inc.sh
+++ b/lmi_setup_inc.sh
@@ -31,7 +31,7 @@
set -evx
CODENAME=bullseye
-CHRTVER=2
+CHRTVER=3
CHRTNAME=lmi_${CODENAME}_${CHRTVER}
umask
- [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 <=
- [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, 2020/06/26