summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2014-03-31 08:05:45 (GMT)
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2014-03-31 08:07:08 (GMT)
commit0fbcc80442b42b7a785e4cbb1fabea044094441f (patch)
treea0df73fed7eac74f38a801c1b623ef740449cec9
parentef5aba9e7a2470055c01cc53f98b5bab79e60d28 (diff)
downloadbaserock-chroot-0fbcc80442b42b7a785e4cbb1fabea044094441f.tar.gz
Enable shared /src
This adds a shared /src mounted from /opt/baserock/src This allows chroots to share /src and also provides a persistent src space in the face of adding and removing chroots. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk> Reviewed-by: Sam Thursfield <sam.thursfield@codethink.co.uk>
-rw-r--r--Makefile1
-rwxr-xr-xbr-ct-sync-chroots4
-rw-r--r--debian/changelog6
-rwxr-xr-xmanage-baserock4
4 files changed, 14 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index d0238b2..e9bf8ae 100644
--- a/Makefile
+++ b/Makefile
@@ -14,4 +14,5 @@ install:
install -m 0755 $${TOOL} $(DESTDIR)$(PREFIX)/sbin/$${TOOL}; \
done
install -d $(DESTDIR)/opt/baserock/chroots
+ install -d $(DESTDIR)/opt/baserock/src
diff --git a/br-ct-sync-chroots b/br-ct-sync-chroots
index 596a8b5..5ca8998 100755
--- a/br-ct-sync-chroots
+++ b/br-ct-sync-chroots
@@ -23,6 +23,7 @@ ACTION="$1"
SCHROOT_BASE="${SCHROOT_BASE:-/etc/schroot}"
SCHROOT_CONF="${SCHROOT_CONF:-${SCHROOT_BASE}/schroot.conf}"
BASEROCK_BASE="${BASEROCK_BASE:-/opt/baserock/chroots}"
+SRC_BASE="${SRC_BASE:-/opt/baserock/src}"
clear_entries () {
sed -e'/BASEROCK_ENTRIES_BEGIN/,/BASEROCK_ENTRIES_END/d' -i "${SCHROOT_CONF}"
@@ -77,12 +78,13 @@ FSTAB="${SCHROOT_BASE}/baserock-${entry}/fstab"
COPYFILES="${SCHROOT_BASE}/baserock-${entry}/copyfiles"
NSSDATABASES="${SCHROOT_BASE}/baserock-${entry}/nssdatabases"
EOF
- cat > "${SCHROOT_BASE}/baserock-${entry}/fstab" <<'EOF'
+ cat > "${SCHROOT_BASE}/baserock-${entry}/fstab" <<EOF
/proc /proc none rw,bind 0 0
/sys /sys none rw,bind 0 0
/dev /dev none rw,bind 0 0
/dev/pts /dev/pts none rw,bind 0 0
/tmp /tmp none rw,bind 0 0
+${SRC_BASE} /src none rw,bind 0 0
EOF
cat > "${SCHROOT_BASE}/baserock-${entry}/copyfiles" <<'EOF'
/etc/resolv.conf
diff --git a/debian/changelog b/debian/changelog
index 6540df6..2b5108a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+baserock-chroot (3) unstable; urgency=low
+
+ * Add support for a shared /src
+
+ -- Daniel Silverstone <daniel.silverstone@codethink.co.uk> Mon, 31 Mar 2014 11:06:54 +0300
+
baserock-chroot (2) unstable; urgency=low
* Add support for SSH authentication agent sockets.
diff --git a/manage-baserock b/manage-baserock
index d45a6b2..c878d18 100755
--- a/manage-baserock
+++ b/manage-baserock
@@ -100,6 +100,10 @@ EOF
EOF
fi
+ if ! test -d "${BASEROCK_BASE}/${SYSTEM}/src"; then
+ mkdir "${BASEROCK_BASE}/${SYSTEM}/src"
+ fi
+
br-ct-sync-chroots
;;