diff -Nru schroot-1.6.10/debian/changelog schroot-1.6.10/debian/changelog --- schroot-1.6.10/debian/changelog 2014-05-05 21:28:59.000000000 +0100 +++ schroot-1.6.10/debian/changelog 2014-12-03 13:56:15.000000000 +0000 @@ -1,3 +1,11 @@ +schroot (1.6.10-1ubuntu1) vivid; urgency=low + + * overlayfs: handle v3.18 backwards compatible v1 mode workdir + requirement. (LP: #1398523) + * overlayfs: handle v3.18 overlay union type. (LP: #1398569) + + -- Andy Whitcroft Wed, 03 Dec 2014 11:24:31 +0000 + schroot (1.6.10-1) unstable; urgency=medium * New upstream stable release. diff -Nru schroot-1.6.10/debian/patches/overlayfs-v1-workdir-support.patch schroot-1.6.10/debian/patches/overlayfs-v1-workdir-support.patch --- schroot-1.6.10/debian/patches/overlayfs-v1-workdir-support.patch 1970-01-01 01:00:00.000000000 +0100 +++ schroot-1.6.10/debian/patches/overlayfs-v1-workdir-support.patch 2014-12-03 13:56:48.000000000 +0000 @@ -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.10/debian/patches/overlay-union-support.patch schroot-1.6.10/debian/patches/overlay-union-support.patch --- schroot-1.6.10/debian/patches/overlay-union-support.patch 1970-01-01 01:00:00.000000000 +0100 +++ schroot-1.6.10/debian/patches/overlay-union-support.patch 2014-12-03 12:54:39.000000000 +0000 @@ -0,0 +1,53 @@ +Description: overlay union support + Add v3.18 new format overlay union support. +Author: Andy Whitcroft +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1398569 + +--- + +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 +@@ -38,6 +38,15 @@ if [ -n "${CHROOT_UNION_TYPE}" ] && [ "$ + fatal "${CHROOT_UNION_OVERLAY_DIRECTORY}_work does not exist, and could not be created" + fi + ;; ++ overlay) ++ mkdir "${CHROOT_UNION_OVERLAY_DIRECTORY}/upper" ++ if [ ! -d "${CHROOT_UNION_OVERLAY_DIRECTORY}/upper" ]; then ++ fatal "${CHROOT_UNION_OVERLAY_DIRECTORY}/upper does not exist, and could not be created" ++ fi ++ 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}" +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 +@@ -125,6 +125,9 @@ do_mount_fs_union() + overlayfs-workdir) + CHROOT_UNION_MOUNT_OPTIONS="lowerdir=${CHROOT_UNION_UNDERLAY_DIRECTORY},upperdir=${CHROOT_UNION_OVERLAY_DIRECTORY},workdir=${CHROOT_UNION_OVERLAY_DIRECTORY}_work" + ;; ++ overlay) ++ CHROOT_UNION_MOUNT_OPTIONS="lowerdir=${CHROOT_UNION_UNDERLAY_DIRECTORY},upperdir=${CHROOT_UNION_OVERLAY_DIRECTORY}/upper,workdir=${CHROOT_UNION_OVERLAY_DIRECTORY}/work" ++ ;; + esac + fi + +Index: schroot-1.6.10/sbuild/sbuild-chroot-facet-union.cc +=================================================================== +--- schroot-1.6.10.orig/sbuild/sbuild-chroot-facet-union.cc ++++ schroot-1.6.10/sbuild/sbuild-chroot-facet-union.cc +@@ -137,6 +137,7 @@ chroot_facet_union::set_union_type (std: + { + if (type == "aufs" || + type == "overlayfs" || ++ type == "overlay" || + type == "unionfs" || + type == "none") + this->union_type = type; diff -Nru schroot-1.6.10/debian/patches/series schroot-1.6.10/debian/patches/series --- schroot-1.6.10/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 +++ schroot-1.6.10/debian/patches/series 2014-12-03 11:34:22.000000000 +0000 @@ -0,0 +1,2 @@ +overlayfs-v1-workdir-support.patch +overlay-union-support.patch