blob: ea043d3a5e7d5a3be93217e8999af750150da3f9 [file] [log] [blame]
Leo Tu9104c302022-08-18 05:17:39 +00001SUMMARY = "Glome Login Scripts"
2DESCRIPTION = "Glome Login Scripts"
3PR = "r1"
4
5LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
7
8GLOME_FALLBACK_SERV ?= ""
9GLOME_FALLBACK_OBJ ?= ""
10GLOME_HOSTNAME_SUFFIX ?= ""
11GLOME_BOARDSN_KEY ?= "bmc-boardsn"
12
13RDEPENDS:${PN} += "bash"
14RDEPENDS:${PN} += "glome"
15RDEPENDS:${PN} += "jq"
16RDEPENDS:${PN} += "obmc-console"
17
18SRC_URI += "file://glome-login.sh.in"
19
20do_install:append() {
21 if [ -z '${GLOME_FALLBACK_SERV}' ]; then
22 echo 'Missing GLOME_FALLBACK_SERV' >&2
23 exit 1
24 fi
25
26 if [ -z '${GLOME_FALLBACK_OBJ}' ]; then
27 echo 'Missing GLOME_FALLBACK_OBJ' >&2
28 exit 1
29 fi
30
31 if [ -z '${GLOME_HOSTNAME_SUFFIX}' ]; then
32 echo 'Missing GLOME_HOSTNAME_SUFFIX' >&2
33 exit 1
34 fi
35
36 sed ${WORKDIR}/glome-login.sh.in \
37 -e 's#@INV_SERV@#${GLOME_FALLBACK_SERV}#' \
38 -e 's#@INV_OBJ@#${GLOME_FALLBACK_OBJ}#' \
39 -e 's#@HOSTNAME_SUFFIX@#${GLOME_HOSTNAME_SUFFIX}#' \
40 -e 's#@BOARDSN_KEY@#${GLOME_BOARDSN_KEY}#' \
41 > ${WORKDIR}/glome-login.sh
42
43 install -d ${D}${bindir}
44 install -m 0755 ${WORKDIR}/glome-login.sh ${D}${bindir}
45}
46
47# This is an example to override the glome login service in the bbappend for 'prod'
48#
49#FILES:${PN}:append:prod = " \
50# ${systemd_system_unitdir}/serial-to-bmc@.service.d/bmc-login-glome-override.conf \
51# ${systemd_system_unitdir}/serial-getty@.service.d/bmc-login-glome-override.conf \
52# "
53#
54#do_install:append:prod() {
55# install -D -m 0644 ${WORKDIR}/bmc-login-glome-override.conf \
56# ${D}${systemd_system_unitdir}/serial-to-bmc@.service.d/bmc-login-glome-override.conf
57# install -D -m 0644 ${WORKDIR}/bmc-login-glome-override.conf \
58# ${D}${systemd_system_unitdir}/serial-getty@.service.d/bmc-login-glome-override.conf
59#}