Changes for new pre-defined usergroup hostconsole

The new pre-defined usergroup named "hostconsole" is added to
differentiate access between host console and manager console.
The only users allowed to interact with host console are part of the
"hostconsole" group.

Note: The changes are spread across multiple repositories listed under
"Related commits:"

The obmc-console changes to incorporate new group are as follows:
- Remove dependency on dropbear.default file by adding new default file
  dropbear.env for obmc-console. This file is required for obmc
  services. This file is added in obmc-console-ssh@.service.in and
  use-socket.conf
- In future we can add file /etc/obmc-console/dropbear.%i.env for port
  specific configuration.

Tested:
  Loaded on system and qemu eumulator. Made sure that the new file
  contents are reflected on the system.

Related commits:
  docs: https://gerrit.openbmc.org/c/openbmc/docs/+/60968
  phosphor-user-manager: https://gerrit.openbmc.org/c/openbmc/phosphor-user-manager/+/61583
  openbmc: https://gerrit.openbmc.org/c/openbmc/openbmc/+/61582
  obmc-console: https://gerrit.openbmc.org/c/openbmc/obmc-console/+/61581
  bmcweb: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/61580

Change-Id: Id080d0cf1c8dea7c383bc040c988dae2b4a09800
Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
2 files changed
tree: a9d933b4fd6ec99171447f713fb350c3dfc8af36
  1. conf/
  2. test/
  3. .clang-format
  4. .clang-tidy
  5. .gitignore
  6. .travis.yml
  7. bootstrap.sh
  8. config.c
  9. configure.ac
  10. console-client.c
  11. console-server.c
  12. console-server.h
  13. console-socket.c
  14. LICENSE
  15. log-handler.c
  16. Makefile.am
  17. meson.build
  18. meson_options.txt
  19. OWNERS
  20. README.md
  21. ringbuffer.c
  22. socket-handler.c
  23. tty-handler.c
  24. util.c
README.md

To Build

Note: In addition to a toolchain and autoconf tools, this requires autotools-archive to be installed.

To build this project, run the following shell commands:

./bootstrap.sh
./configure ${CONFIGURE_FLAGS}
make

To fully clean the repository, run:

./bootstrap.sh clean

To Run Server

Running the server requires a serial port (e.g. /dev/ttyS0):

touch obmc-console.conf
./obmc-console-server --config obmc-console.conf ttyS0

To Connect Client

To connect to the server, simply run the client:

./obmc-console-client

To disconnect the client, use the standard ~. combination.

Underlying design

This shows how the host UART connection is abstracted within the BMC as a Unix domain socket.

               +--------------------------------------------------------------------------------------------+
               |                                                                                            |
               |       obmc-console-client      unix domain socket         obmc-console-server              |
               |                                                                                            |
               |     +---------------------+                           +------------------------+           |
               |     | client.2200.conf    |  +---------------------+  | server.ttyVUART0.conf  |           |
           +---+--+  +---------------------+  |                     |  +------------------------+  +--------+-------+
Network    | 2200 +-->                     +->+ @obmc-console.host0 +<-+                        <--+ /dev/ttyVUART0 |   UARTs
           +---+--+  | socket-id = "host0" |  |                     |  | socket-id = "host0"    |  +--------+-------+
               |     |                     |  +---------------------+  |                        |           |
               |     +---------------------+                           +------------------------+           |
               |                                                                                            |
               |                                                                                            |
               |                                                                                            |
               +--------------------------------------------------------------------------------------------+

This supports multiple independent consoles. The socket-id is a unique portion for the unix domain socket created by the obmc-console-server instance. The server needs to know this because it needs to know what to name the pipe; the client needs to know it as it needs to form the abstract socket name to which to connect.