diff -Nru schroot-1.6.8/debian/changelog schroot-1.6.8/debian/changelog --- schroot-1.6.8/debian/changelog 2014-04-01 08:57:36.000000000 -0500 +++ schroot-1.6.8/debian/changelog 2015-10-14 12:02:06.000000000 -0500 @@ -1,3 +1,11 @@ +schroot (1.6.8-1ubuntu1.1) trusty; urgency=medium + + [ Andy Whitcroft ] + * overlayfs: handle v3.18 backwards compatible v1 mode workdir + requirement. (LP: #1398523) + + -- Chris J Arges Wed, 14 Oct 2015 12:01:41 -0500 + schroot (1.6.8-1ubuntu1) trusty; urgency=medium * Pass CPPFLAGS through to cmake (closes: #742701, cf. #653916). diff -Nru schroot-1.6.8/debian/patches/overlayfs-v1-workdir-support.patch schroot-1.6.8/debian/patches/overlayfs-v1-workdir-support.patch --- schroot-1.6.8/debian/patches/overlayfs-v1-workdir-support.patch 1969-12-31 18:00:00.000000000 -0600 +++ schroot-1.6.8/debian/patches/overlayfs-v1-workdir-support.patch 2015-10-14 12:01:24.000000000 -0500 @@ -0,0 +1,112 @@ +Description: overlayfs v1 workdir support + Handle mainline v3.18 backwards compatible overlayfs v1 support. This mode + is on disk compatible with older overlayfs overlays but requires a new + work directory (on the same disk as the overlay) and this must be supplied + as workdir= at mount time. +Author: Andy Whitcroft +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1398523 + +--- + +Index: schroot-1.6.10/etc/setup.d/05union +=================================================================== +--- schroot-1.6.10.orig/etc/setup.d/05union ++++ schroot-1.6.10/etc/setup.d/05union +@@ -31,6 +31,15 @@ if [ -n "${CHROOT_UNION_TYPE}" ] && [ "$ + fatal "$CHROOT_UNION_OVERLAY_DIRECTORY does not exist, and could not be created" + fi + ++ case "${CHROOT_UNION_TYPE_MODE}" in ++ overlayfs-workdir) ++ mkdir "${CHROOT_UNION_OVERLAY_DIRECTORY}_work" ++ if [ ! -d "${CHROOT_UNION_OVERLAY_DIRECTORY}_work" ]; then ++ fatal "${CHROOT_UNION_OVERLAY_DIRECTORY}_work does not exist, and could not be created" ++ fi ++ ;; ++ esac ++ + mkdir "${CHROOT_UNION_UNDERLAY_DIRECTORY}" + if [ ! -d "$CHROOT_UNION_UNDERLAY_DIRECTORY" ]; then + fatal "$CHROOT_UNION_UNDERLAY_DIRECTORY does not exist, and could not be created" +@@ -40,6 +49,21 @@ if [ -n "${CHROOT_UNION_TYPE}" ] && [ "$ + if [ ! -d "${CHROOT_UNION_OVERLAY_DIRECTORY}" ]; then + fatal "Missing overlay directory for session: can't recover" + fi ++ ++ case "${CHROOT_UNION_TYPE_MODE}" in ++ overlayfs-workdir) ++ # Note that for an existing chroot created on older version ++ # this may not exist, no data is carried in this directory so ++ # we can simply create it here. ++ if [ ! -d "${CHROOT_UNION_OVERLAY_DIRECTORY}_work" ]; then ++ mkdir "${CHROOT_UNION_OVERLAY_DIRECTORY}_work" ++ if [ ! -d "${CHROOT_UNION_OVERLAY_DIRECTORY}_work" ]; then ++ fatal "${CHROOT_UNION_OVERLAY_DIRECTORY}_work does not exist, and could not be created" ++ fi ++ fi ++ ;; ++ esac ++ + if [ ! -d "${CHROOT_UNION_UNDERLAY_DIRECTORY}" ]; then + fatal "Missing underlay directory for session: can't recover" + fi +@@ -50,6 +74,12 @@ if [ -n "${CHROOT_UNION_TYPE}" ] && [ "$ + if [ -d "${CHROOT_UNION_OVERLAY_DIRECTORY}" ]; then + rm -rf "${CHROOT_UNION_OVERLAY_DIRECTORY}" + fi ++ case "${CHROOT_UNION_TYPE_MODE}" in ++ overlayfs-workdir) ++ info "Purging ${CHROOT_UNION_OVERLAY_DIRECTORY}_work" ++ rm -rf "${CHROOT_UNION_OVERLAY_DIRECTORY}_work" ++ ;; ++ esac + + # For safety, use rmdir rather than rm -rf in case + # umount failed. +Index: schroot-1.6.10/etc/setup.d/10mount +=================================================================== +--- schroot-1.6.10.orig/etc/setup.d/10mount ++++ schroot-1.6.10/etc/setup.d/10mount +@@ -112,7 +112,7 @@ do_mount_fs_union() + { + # Prepare mount options (branch config) for union type + if [ -z "$CHROOT_UNION_MOUNT_OPTIONS" ]; then +- case $CHROOT_UNION_TYPE in ++ case $CHROOT_UNION_TYPE_MODE in + unionfs) + CHROOT_UNION_MOUNT_OPTIONS="dirs=${CHROOT_UNION_OVERLAY_DIRECTORY}=rw,${CHROOT_UNION_UNDERLAY_DIRECTORY}=ro" + ;; +@@ -122,10 +122,13 @@ do_mount_fs_union() + overlayfs) + CHROOT_UNION_MOUNT_OPTIONS="lowerdir=${CHROOT_UNION_UNDERLAY_DIRECTORY},upperdir=${CHROOT_UNION_OVERLAY_DIRECTORY}" + ;; ++ overlayfs-workdir) ++ CHROOT_UNION_MOUNT_OPTIONS="lowerdir=${CHROOT_UNION_UNDERLAY_DIRECTORY},upperdir=${CHROOT_UNION_OVERLAY_DIRECTORY},workdir=${CHROOT_UNION_OVERLAY_DIRECTORY}_work" ++ ;; + esac + fi + +- info "Using '$CHROOT_UNION_TYPE' for filesystem union" ++ info "Using '$CHROOT_UNION_TYPE_MODE' for filesystem union" + + # Try mounting fs + mount -t "$CHROOT_UNION_TYPE" -o "$CHROOT_UNION_MOUNT_OPTIONS" "$CHROOT_NAME" "$1" +Index: schroot-1.6.10/etc/setup.d/common-data +=================================================================== +--- schroot-1.6.10.orig/etc/setup.d/common-data ++++ schroot-1.6.10/etc/setup.d/common-data +@@ -32,3 +32,14 @@ case "$(uname -s)" in + DEVTYPE="-b" + ;; + esac ++ ++ ++# Linux v3.18 and later overlayfs format changes. ++CHROOT_UNION_TYPE_MODE="${CHROOT_UNION_TYPE}" ++case "${CHROOT_UNION_TYPE}" in ++ overlayfs) ++ if dpkg --compare-versions `uname -r` ge 3.18.0; then ++ CHROOT_UNION_TYPE_MODE="overlayfs-workdir" ++ fi ++ ;; ++esac diff -Nru schroot-1.6.8/debian/patches/series schroot-1.6.8/debian/patches/series --- schroot-1.6.8/debian/patches/series 1969-12-31 18:00:00.000000000 -0600 +++ schroot-1.6.8/debian/patches/series 2015-10-14 12:01:40.000000000 -0500 @@ -0,0 +1 @@ +overlayfs-v1-workdir-support.patch