meta-google: Add glome-login and glome-config
We have to use glome-config since the sample config is removed in
glome recipe. As a result, now glome depends on glome-config.
The platform also needs to overwrite these variables in their
bbappend files:
- glome-login.bb
* GLOME_FALLBACK_SERV
* GLOME_FALLBACK_OBJ
* GLOME_HOSTNAME_SUFFIX
* GLOME_BOARDSN_KEY
- glome-config.bb
* GLOME_PUBLIC_KEY
* GLOME_KEY_VERSION
* GLOME_URL_PREFIX
Tested:
1) `bitbake obmc-phosphor-image` build passes
2) inplace update the image on a real machine
3) connect to it
The glome is enabled and login is successful
Signed-off-by: Leo Tu <leotu@google.com>
Change-Id: I21a48cbdcfea67772f143b4fc115f717e6d7cbc5
diff --git a/meta-google/recipes-google/console/glome-config.bb b/meta-google/recipes-google/console/glome-config.bb
new file mode 100644
index 0000000..be3612d
--- /dev/null
+++ b/meta-google/recipes-google/console/glome-config.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Glome Config"
+DESCRIPTION = "Glome config file provides a glome config file"
+PR = "r1"
+
+# This is required to replace the glome/config that is removed in glome_git.bb
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+# Example Privkey: A0F1D0A0CB254839D04637F567325B850B5174850B129E811F5E203A42CC3B6C
+GLOME_PUBLIC_KEY ?= "AC11D4582261F2D05CDDE1BD94383393D26C5C269642EE26D7EABD1EADC03C14"
+GLOME_KEY_VERSION ?= "4"
+GLOME_URL_PREFIX ?= "http://example-glome-service/"
+
+SRC_URI = "file://config.in"
+
+do_install:append() {
+ if [ -z '${GLOME_PUBLIC_KEY}' ]; then
+ echo 'Missing GLOME_PUBLIC_KEY' >&2
+ exit 1
+ fi
+ if [ -z '${GLOME_KEY_VERSION}' ]; then
+ echo 'Missing GLOME_KEY_VERSION' >&2
+ exit 1
+ fi
+ if [ -z '${GLOME_URL_PREFIX}' ]; then
+ echo 'Missing GLOME_URL_PREFIX' >&2
+ exit 1
+ fi
+
+ sed ${WORKDIR}/config.in \
+ -e 's#@PUBLIC_KEY@#${GLOME_PUBLIC_KEY}#' \
+ -e 's#@KEY_VERSION@#${GLOME_KEY_VERSION}#' \
+ -e 's#@URL_PREFIX@#${GLOME_URL_PREFIX}#' \
+ > ${WORKDIR}/config
+
+ install -d ${D}${sysconfdir}/glome
+ install -m 0644 ${WORKDIR}/config ${D}${sysconfdir}/glome
+}