ttf-console: Add Megapede ttf-console adapter

TTF-console is a new console provider implemented in
Megapede-console-relay to support multi-node serial console streaming
leverage obmc-console

Add The Megapede ttf-console adapter script ttf-console.sh
and the ttf-console.bbclass to help each platform onboarding ttf-console

Platform inherit ttf-console and define ttf_console_list() python
function in platform obmc-console_%.bbappend.

obmc-console recipe will
1. Install the ttf-console.sh to /usr/libexec
2. Generate the ttf-console.list to /usr/libexec use the console mapping
   information provided by ttf_console_list()

All build sccuess:
http://fusion2/ci/kokoro/prod:gbmc%2Ffirmware-build%2Ffirmware%2Fgerrit/activity/7838bceb-8280-4faa-b9f6-81eee624d164/summary

Tested:
build obmc-console package for platform with ttf-console enabled
```
❯ tree image
image
...
    ├── libexec
    │   ├── readonly-obmc-console-client
    │   ├── ttf-console.list
    │   └── ttf-console.sh
    └── sbin
        └── obmc-console-server

❯ cat image/usr/libexec/ttf-console.list
declare -A console_map=(
    ["host-compute-node-1"]="/etc/obmc-console/server.ttyS2.conf"
    ["host-compute-node-2"]="/etc/obmc-console/server.ttyS1.conf"
)

```

Google-Bug-Id: 339717081
Change-Id: Id7ffecbeb0dab62b8d1b727281d047ada14fc289
Signed-off-by: Dan Zhang <zhdaniel@google.com>
(cherry picked from commit ea69bd53773007f24d3af3df47749d41a39f778c)
diff --git a/classes/ttf-console.bbclass b/classes/ttf-console.bbclass
new file mode 100644
index 0000000..9b0dfff
--- /dev/null
+++ b/classes/ttf-console.bbclass
@@ -0,0 +1,31 @@
+# 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
+}
diff --git a/recipes-phosphor/console/obmc-console/ttf-console.sh b/recipes-phosphor/console/obmc-console/ttf-console.sh
new file mode 100644
index 0000000..8415072
--- /dev/null
+++ b/recipes-phosphor/console/obmc-console/ttf-console.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# declare -A console_map=()
+# Each platform provide the console_map in obmc-console_%.bbappend via
+# ttf_console_list() python function, ttf-console.bbclass will generate
+# the ttf-console.list in the same directory of ttf-console.sh script
+# to delcare the console_map i.e.
+# ```
+# def ttf_console_list():
+#     return {
+#         "host-compute-node-1": "/etc/obmc-console/server.ttyS2.conf",
+#         "host-compute-node-2": "/etc/obmc-console/server.ttyS1.conf",
+#     }
+# ```
+# shellcheck source=/dev/null
+source "$(dirname "$0")/ttf-console.list"
+
+list_node() {
+    echo "Support node:"
+    for node in "${!console_map[@]}"; do
+        echo "$node"
+    done
+}
+
+# Check if the correct number of arguments is provided
+if [ "$#" -ne 1 ]; then
+    echo "Usage: $0 <node-name>"
+    list_node
+    exit 1
+fi
+
+# Check if the provided node name exists in the console_map array
+if [[ -z "${console_map[$1]}" ]]; then
+    echo "Invalid node name:" "$1"
+    list_node
+    exit 1
+fi
+
+# Execute the obmc-console-client to streaming out log
+exec /usr/bin/obmc-console-client -c "${console_map[$1]}"
diff --git a/recipes-phosphor/console/obmc-console_%.bbappend b/recipes-phosphor/console/obmc-console_%.bbappend
index cf1ed09..c680f24 100644
--- a/recipes-phosphor/console/obmc-console_%.bbappend
+++ b/recipes-phosphor/console/obmc-console_%.bbappend
@@ -3,6 +3,7 @@
 SRC_URI:append:gbmc = " \
   file://readonly-obmc-console-client \
   file://40-console-client-override.conf \
+  file://ttf-console.sh \
   "
 do_install:append:gbmc() {
     install -d -m0644 ${D}${sysconfdir}/systemd/system/serial-to-host@.service.d/