From 2b2dc3b9e95895002e32e3cda02bc6d6b71ac2ab Mon Sep 17 00:00:00 2001
From: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
Date: Thu, 9 Sep 2021 15:27:27 +0000
Subject: [PATCH] flavours: disable public sstate cache by default

The cache is relatively network-heavy, as it attempts to check if one of
myriad of cache files is available and is somewhat misleading, since the
cache only works for the small subset of configurations that have been
cleared for legal re-distribution and have a public cache available.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
---
 flavours/freertos/local.conf.sample | 12 ++++++++----
 flavours/linux/local.conf.sample    | 12 ++++++++----
 flavours/zephyr/local.conf.sample   | 12 ++++++++----
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/flavours/freertos/local.conf.sample b/flavours/freertos/local.conf.sample
index 9b6d5f61..66f0ffdc 100644
--- a/flavours/freertos/local.conf.sample
+++ b/flavours/freertos/local.conf.sample
@@ -69,9 +69,13 @@ PACKAGE_CLASSES ?= "package_rpm"
 # this doesn't mean anything to you.
 CONF_VERSION = "1"
 
-# Use OSTC download and sstate-cache by default. You can comment out or remove
-# those lines and use the defaults from Poky. Note that this cache is limited
-# to system configurations that are entirely re-distributable.
+# Use OSTC download cache default.
+# Note that this cache is limited to system configurations that are entirely
+# re-distributable, as determined by the OSTC legal team.
 INHERIT += "own-mirrors"
 SOURCE_MIRROR_URL = "https://cache.ostc-eu.org/bitbake/downloads"
-SSTATE_MIRRORS = "file://.* https://cache.ostc-eu.org/bitbake/sstate-cache/PATH;downloadfilename=PATH \n"
+
+# If you are building on a very slow device but have relatively reliable network access
+# *and* the project you are building has a public sstate cache, you may choose to uncomment
+# this line and use the sstate cache published by OSTC.
+# SSTATE_MIRRORS = "file://.* https://cache.ostc-eu.org/bitbake/sstate-cache/PATH;downloadfilename=PATH \n"
diff --git a/flavours/linux/local.conf.sample b/flavours/linux/local.conf.sample
index 72d38219..a2d408b0 100644
--- a/flavours/linux/local.conf.sample
+++ b/flavours/linux/local.conf.sample
@@ -250,9 +250,13 @@ PACKAGECONFIG_append_pn-qemu-system-native = " sdl"
 # this doesn't mean anything to you.
 CONF_VERSION = "1"
 
-# Use OSTC download and sstate-cache by default. You can comment out or remove
-# those lines and use the defaults from Poky. Note that this cache is limited
-# to system configurations that are entirely re-distributable.
+# Use OSTC download cache default.
+# Note that this cache is limited to system configurations that are entirely
+# re-distributable, as determined by the OSTC legal team.
 INHERIT += "own-mirrors"
 SOURCE_MIRROR_URL = "https://cache.ostc-eu.org/bitbake/downloads"
-SSTATE_MIRRORS = "file://.* https://cache.ostc-eu.org/bitbake/sstate-cache/PATH;downloadfilename=PATH \n"
+
+# If you are building on a very slow device but have relatively reliable network access
+# *and* the project you are building has a public sstate cache, you may choose to uncomment
+# this line and use the sstate cache published by OSTC.
+# SSTATE_MIRRORS = "file://.* https://cache.ostc-eu.org/bitbake/sstate-cache/PATH;downloadfilename=PATH \n"
diff --git a/flavours/zephyr/local.conf.sample b/flavours/zephyr/local.conf.sample
index 0b42a371..7e929c56 100644
--- a/flavours/zephyr/local.conf.sample
+++ b/flavours/zephyr/local.conf.sample
@@ -252,9 +252,13 @@ PACKAGECONFIG_append_pn-qemu-system-native = " sdl"
 # this doesn't mean anything to you.
 CONF_VERSION = "1"
 
-# Use OSTC download and sstate-cache by default. You can comment out or remove
-# those lines and use the defaults from Poky. Note that this cache is limited
-# to system configurations that are entirely re-distributable.
+# Use OSTC download cache default.
+# Note that this cache is limited to system configurations that are entirely
+# re-distributable, as determined by the OSTC legal team.
 INHERIT += "own-mirrors"
 SOURCE_MIRROR_URL = "https://cache.ostc-eu.org/bitbake/downloads"
-SSTATE_MIRRORS = "file://.* https://cache.ostc-eu.org/bitbake/sstate-cache/PATH;downloadfilename=PATH \n"
+
+# If you are building on a very slow device but have relatively reliable network access
+# *and* the project you are building has a public sstate cache, you may choose to uncomment
+# this line and use the sstate cache published by OSTC.
+# SSTATE_MIRRORS = "file://.* https://cache.ostc-eu.org/bitbake/sstate-cache/PATH;downloadfilename=PATH \n"
-- 
GitLab