blob: 9b0dfffd2b35e21ca7b53b5a96262fd00de23a53 [file] [log] [blame]
# This class to adapting the obmc-console to Megapede-console (go/ttf-console)
python __anonymous () {
d.setVar("TTF_CONSOLE_LIST", gen_ttf_console_list())
}
def gen_ttf_console_list():
import shlex
# node names registered in MIBA policy (go/ttf-console-miba)
valid_nodes = {
"host-compute-node-1",
"host-compute-node-2",
}
console_list = "# node_name to its console config file mapping\n"
console_list += "declare -A console_map=("
for node, conf_file in ttf_console_list().items():
if node not in valid_nodes:
raise("%s has not been registered in MIBA policy go/ttf-console-miba" % node)
console_list += '\n ["%s"]="%s"' % (node, conf_file)
console_list += "\n)\n"
return shlex.quote(console_list)
do_install:append:gbmc() {
install -d -m0755 ${D}${libexecdir}
bbnote "Install ttf-console.sh to libexec"
install -m0755 ${WORKDIR}/ttf-console.sh ${D}${libexecdir}/ttf-console.sh
bbnote "Generate ttf-console.list to libexec"
echo ${TTF_CONSOLE_LIST} > ${D}${libexecdir}/ttf-console.list
}