From c85373f9112f379fdc388964b24bf1929ceacc3b Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 16 Nov 2011 13:52:18 +0200 Subject: [PATCH] mk-sbuild,doc/mk-sbuild.1: aufs may still be used if overlayfs isn't available (as is the case on Debian). --- debian/changelog | 5 +++++ doc/mk-sbuild.1 | 3 ++- mk-sbuild | 15 +++++++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index a07bfe7..f889b35 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,13 @@ ubuntu-dev-tools (0.136) UNRELEASED; urgency=low + [ Marc Deslauriers ] * mk-sbuild,doc/mk-sbuild.1: switch from aufs to overlayfs, as aufs is no longer in the Precise kernel. + [ Stefano Rivera ] + * mk-sbuild,doc/mk-sbuild.1: aufs may still be used if overlayfs isn't + available (as is the case on Debian). + -- Marc Deslauriers Tue, 15 Nov 2011 16:01:32 -0500 ubuntu-dev-tools (0.135) unstable; urgency=low diff --git a/doc/mk-sbuild.1 b/doc/mk-sbuild.1 index 27a4904..78094ef 100644 --- a/doc/mk-sbuild.1 +++ b/doc/mk-sbuild.1 @@ -54,7 +54,8 @@ Currently known distros: "\fBdebian\fR" and "\fBubuntu\fR". .TP .B \-\-vg\fR=\fIVOLUME_GROUP Specify a volume group, and subsequently use a default \fBSCHROOT_TYPE\fR of -"\fBlvm-snapshot\fR" rather than "\fBdirectory\fR" (via overlayfs) mounts. +"\fBlvm-snapshot\fR" rather than "\fBdirectory\fR" (via overlayfs or +aufs) mounts. .TP .B \-\-type\fR=\fISHROOT_TYPE Specify a \fBSCHROOT_TYPE\fR. Supported values are "\fBdirectory\fR" diff --git a/mk-sbuild b/mk-sbuild index 10fdb4c..bad0420 100755 --- a/mk-sbuild +++ b/mk-sbuild @@ -24,7 +24,7 @@ # ################################################################## # # This script creates chroots designed to be used in a snapshot mode -# (either with LVM or overlayfs) with schroot and sbuild. +# (with LVM, btrfs, overlayfs, or aufs) with schroot and sbuild. # Much love to "man sbuild-setup", https://wiki.ubuntu.com/PbuilderHowto, # and https://help.ubuntu.com/community/SbuildLVMHowto. # @@ -536,6 +536,17 @@ case "$SCHROOT_TYPE" in MNT=`mktemp -d -t schroot-XXXXXX` esac +# Debian doesn't have overlayfs yet +case "$SCHROOT_TYPE" in + directory|file) + if grep -q '\soverlayfs$' /proc/filesystems \ + || (/sbin/modprobe -l | grep -Fq '/overlayfs.ko'); then + OVERLAY_FS=overlayfs + else + OVERLAY_FS=aufs + fi +esac + # work around apt's GPG invocation that fails without root's .gnupg directory sudo mkdir -p -m 0700 "$MNT"/root/.gnupg @@ -619,7 +630,7 @@ EOM ;; directory|file) cat >> "${TEMP_SCHROOTCONF}" <