|  | # 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 | 
|  | # port names registered in MIBA policy (go/ttf-console-miba) | 
|  | valid_ports = { | 
|  | "port-1", | 
|  | "port-2", | 
|  | } | 
|  |  | 
|  | console_list = "# port_name to its console config file mapping\n" | 
|  | console_list += "declare -A console_map=(" | 
|  | for port, conf_file in ttf_console_list().items(): | 
|  | if port not in valid_ports: | 
|  | bb.warn("%s has not been registered in MIBA policy go/ttf-console-miba" % port) | 
|  | console_list += '\n    ["%s"]="%s"' % (port, 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 | 
|  | } |