From 18ed669fa0b159abf6753719d04766708c1e872a Mon Sep 17 00:00:00 2001
From: Anoop Karollil <anoop.karollil@gmail.com>
Date: Thu, 25 Jul 2019 11:04:50 -0700
Subject: [meta-virtualization][PATCH] docker: Define override-able BUILD_TAGS
 in recipe

DOCKER_BUILDTAGS has tags that exclude btrfs and devicemapper graph
drivers. To enable either, the tags have to be removed, but this isn't
easily possible as DOCKER_BUILDTAGS can't be overridden via a bbappend
(a make.sh script is used to build dockerd rather than oe_runmake, so
overriding with EXTRA_OEMAKE isn't possible).

Define a BUILD_TAGS variable in the docker recipe that is set with the
current exclude tags, and use it for setting DOCKER_BUILDTAGS. This
makes it possible for downstream/upper layers to tweak
BUILD_TAGS/DOCKER_BUILD_TAGS via a bbappend.

Signed-off-by: Anoop Karollil <anoop.karollil@gmail.com>
---
 recipes-containers/docker/docker_git.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb
index feca536..e45f87e 100644
--- a/recipes-containers/docker/docker_git.bb
+++ b/recipes-containers/docker/docker_git.bb
@@ -63,6 +63,8 @@ PV = "${DOCKER_VERSION}+git${SRCREV_moby}"
 PACKAGES =+ "${PN}-contrib"
 
 DOCKER_PKG="github.com/docker/docker"
+# in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056
+BUILD_TAGS = "exclude_graphdriver_btrfs exclude_graphdriver_devicemapper"
 
 inherit go
 inherit goarch
@@ -91,8 +93,7 @@ do_compile() {
 	export CGO_ENABLED="1"
 	export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 	export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
-	# in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056
-	export DOCKER_BUILDTAGS='exclude_graphdriver_btrfs exclude_graphdriver_devicemapper ${PACKAGECONFIG_CONFARGS}'
+	export DOCKER_BUILDTAGS='${BUILD_TAGS} ${PACKAGECONFIG_CONFARGS}'
 
 	export DISABLE_WARN_OUTSIDE_CONTAINER=1
 
-- 
2.17.1

