#
a6b29104 |
| 10-Jul-2024 |
Alexander Hansen <alexander.hansen@9elements.com> |
console-server: Add UART Mux Support
This commit adds support for uart-muxes which can be controlled via gpios.
Change-Id: I91a4de1962554adf4302a2a59d2b371f492dc21d Signed-off-by: Alexander Hansen
console-server: Add UART Mux Support
This commit adds support for uart-muxes which can be controlled via gpios.
Change-Id: I91a4de1962554adf4302a2a59d2b371f492dc21d Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
#
312ecdc2 |
| 10-Jul-2024 |
Alexander Hansen <alexander.hansen@9elements.com> |
console-server: Enable multiple consoles
obmc-console can now support multiple consoles that can be configured.
The first console is the active console, if not configured otherwise.
This serves as
console-server: Enable multiple consoles
obmc-console can now support multiple consoles that can be configured.
The first console is the active console, if not configured otherwise.
This serves as preparation for uart mux support.
Change-Id: I6f350b8efe70c3b424bdadaa3fe1bbf89d310e5d Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
#
2325d5d5 |
| 07-Jun-2024 |
Alexander Hansen <alexander.hansen@9elements.com> |
console-server: refactor pollfd management
Instead of the previous memory management of pollfd array, with a fixed and flexible part and hardcoded indices, provide two functions to request and relea
console-server: refactor pollfd management
Instead of the previous memory management of pollfd array, with a fixed and flexible part and hardcoded indices, provide two functions to request and release pollfds.
- console_server_request_pollfd - console_server_release_pollfd
The pollfds are still in the same array but can be requested and released by these functions now. struct console_server and struct console now contain indices into that array of pollfds.
The benefit of this contribution is that the new interface provides a clean allocator-like abstraction for requesting and releasing pollfds, which will scale to multiple consoles and can be refactored or unit-tested more easily in the future.
The previous implementation was tightly coupled to the single-console use-case and the pollfds stored at hardcoded indices.
Change-Id: I93226699618130b175bffbeb4f71c20c91a7083a Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
#
c2b0d8c7 |
| 07-Jun-2024 |
Alexander Hansen <alexander.hansen@9elements.com> |
console-server: introduce `struct console_server`
Lift `struct console_server` from `struct console`
struct console_server will enable obmc-console to support multiple consoles in a single obmc-con
console-server: introduce `struct console_server`
Lift `struct console_server` from `struct console`
struct console_server will enable obmc-console to support multiple consoles in a single obmc-console-server in the future.
Currently the 'struct console_server' only supports one active console.
Change-Id: Icb22fb46f217b174f3bccc0a03485549d82d1d6b Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
#
1e04f449 |
| 12-Jun-2024 |
Alexander Hansen <alexander.hansen@9elements.com> |
use iniparser dependency for config file parsing
For the config file, we do not need the custom handwritten parser.
Thanks to Andrew for this command, we can now search for an alternative
$ git gr
use iniparser dependency for config file parsing
For the config file, we do not need the custom handwritten parser.
Thanks to Andrew for this command, we can now search for an alternative
$ git grep -lw INI -- :/:*.bb meta-openembedded/meta-oe/recipes-support/inih/libinih_58.bb meta-openembedded/meta-oe/recipes-support/iniparser/iniparser_4.1.bb meta-openembedded/meta-oe/recipes-support/minini/minini_1.2.b.bb poky/meta/recipes-devtools/python/python3-iniconfig_2.0.0.bb poky/meta/recipes-devtools/python/python3-iniparse_0.5.bb
For the ini parser we have following requirements
- small API - easy to use - compiles fast - has tests, examples, docs - support for sections
- minini [1]
can be dropped from the list since it also supports colon ':' instead of '=' for separating key and value, creating 2 ways of doing something. This makes it harder to swap out the ini parser in the future.
- libinih [2]
uses SAX-style parsing of .ini files and thus does not provide a DOM of the .ini. This is a break from the previous parser which stored everything in struct config. To use this library would require to create a struct to store all the possible configuration, then fill that struct in one pass. Essentially wrapping that library to have DOM capability. That would be possible, but not ideal. libinih is also highly configurable with lots of config options.
- iniparser [3]
has all the required features and stores the results of its parsing for later use. It is a seamless upgrade from the previous parser. The call sites do not have to be modified and we can read the config as before. A downside is that we have to provide our own wrap file.
For our purposes, iniparser is a good choice.
Using this dependency allows us to drop the custom parser and all the tests that go along with it.
If sections are required in future config files, iniparser can also support that.
References:
[1] https://github.com/compuphase/minIni [2] https://github.com/benhoyt/inih [3] https://gitlab.com/iniparser/iniparser
Change-Id: Ie2b57171ec1f8cb6b1b80ca1d9e6c112bedc1195 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
#
498a4a81 |
| 09-Jul-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
console-server: Respect DBus init failure
Given that the DBus interface is required by other OpenBMC applications, don't ignore a failure to initialize it.
It's always possible to add a switch down
console-server: Respect DBus init failure
Given that the DBus interface is required by other OpenBMC applications, don't ignore a failure to initialize it.
It's always possible to add a switch down the track to avoid initializing the DBus interfaces, if desired.
Change-Id: I8aecf1a1cb06d021f374eaf0fd6893ddf3a9cc3c Co-developed-by: Alexander Hansen <alexander.hansen@9elements.com> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
#
12398cd5 |
| 09-Jul-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
console-dbus: Connect to the default bus
sd_bus_default() connects to the system bus unless it detects a user slice, in which case it connects to the bus for the user session.
This should keep the
console-dbus: Connect to the default bus
sd_bus_default() connects to the system bus unless it detects a user slice, in which case it connects to the bus for the user session.
This should keep the desired behavior in-context e.g. on a BMC, while making it slightly more ergonomic to run obmc-console-server under dbus-run-session(1) for testing.
Change-Id: I0b5acfae49dcab9ec4f72159ba51296e118017ae Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
#
e2826c7d |
| 04-Jul-2024 |
Jeremy Kerr <jk@codeconstruct.com.au> |
console-server: allow separate handler instances
Currently, each handler (socket-handler, tty-handler and log-handler) provides a statically-allocated instance of a handler, which gets initialized f
console-server: allow separate handler instances
Currently, each handler (socket-handler, tty-handler and log-handler) provides a statically-allocated instance of a handler, which gets initialized for a console through the ->init callback.
We have upcoming changes that may create more than one console object, in which case means we will need multiple instances of each handler type.
This change splits the handler type from the handler instance; the former is now struct handler_type, with struct handler being the instance. Handler modules define a (const) struct handler_type, and ->init() now returns a newly-allocated instance of a handler of that type.
This allows multiple handlers of each type.
Because the handler instances are allocated by type->init, we now require both ->init and ->fini to be present on registered handlers.
We no longer need the `bool active` member of the handler, as instances are always active.
Change-Id: Id97f15bd6445e17786f5883b849de8559c5ea434 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
show more ...
|
Revision tags: v1.1.0 |
|
#
ba0a5a74 |
| 01-Jun-2023 |
Jonathan Doman <jonathan.doman@intel.com> |
Remove deprecated D-Bus interface
9598b866d8e2 ("Add new D-Bus UART interface") adds the interface that's described in phosphor-dbus-interface and deprecates the old interface. Now that the new inte
Remove deprecated D-Bus interface
9598b866d8e2 ("Add new D-Bus UART interface") adds the interface that's described in phosphor-dbus-interface and deprecates the old interface. Now that the new interface is merged, follow through and delete the deprecated interface.
Change-Id: I304041d74a5b2218732b32f915efcbc0a5e9aafe Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> [AJ: Rebase on master and update changelog] Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
9598b866 |
| 01-Jun-2023 |
Jonathan Doman <jonathan.doman@intel.com> |
Add new D-Bus UART interface
New interface xyz.openbmc_project.Console.UART was added to P-D-I: https://github.com/openbmc/phosphor-dbus-interfaces/blob/3826910ef8f91c05562a716929221745c92dd9d7/yaml
Add new D-Bus UART interface
New interface xyz.openbmc_project.Console.UART was added to P-D-I: https://github.com/openbmc/phosphor-dbus-interfaces/blob/3826910ef8f91c05562a716929221745c92dd9d7/yaml/xyz/openbmc_project/Console/UART.interface.yaml
Tested: With obmc-console@ttyS2: bmc# alias xyz=xyz.openbmc_project; alias XYZ=/xyz/openbmc_project bmc# stty -F /dev/ttyS2 speed 921600 bmc# busctl introspect $xyz.Console.default $XYZ/console/default $xyz.Console.UART NAME TYPE SIGNATURE RESULT/VALUE FLAGS .Baud property t 921600 writable
bmc# busctl set-property $xyz.Console.default $XYZ/console/default \ $xyz.Console.UART Baud t 57600 bmc# stty -F /dev/ttyS2 speed 57600
bmc# busctl set-property $xyz.Console.default $XYZ/console/default \ $xyz.Console.UART Baud t 57601 Failed to set property Baud on interface xyz.openbmc_project.Console.UART: Invalid argument
Change-Id: I055f2a95c515636b38a694bf565b71aa648fe7b7 Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
show more ...
|
#
bd992c9f |
| 09-May-2023 |
Ninad Palsule <ninadpalsule@us.ibm.com> |
Add Connect() method to console DBUS object
Added new poller and consumer for the console DBUS data.
Note: We initially developed SocketName attribute but it is now deprecated/removed.
The t
Add Connect() method to console DBUS object
Added new poller and consumer for the console DBUS data.
Note: We initially developed SocketName attribute but it is now deprecated/removed.
The tree of default object: $ busctl tree xyz.openbmc_project.Console.default `-/xyz `-/xyz/openbmc_project `-/xyz/openbmc_project/console `-/xyz/openbmc_project/console/default
The introspect of default console: $ busctl introspect xyz.openbmc_project.Console.default /xyz/openbmc_project/console/default NAME TYPE SIGNATURE RESULT/VALUE FLAGS org.freedesktop.DBus.Introspectable interface - - - .Introspect method - s - org.freedesktop.DBus.Peer interface - - - .GetMachineId method - s - .Ping method - - - org.freedesktop.DBus.Properties interface - - - .Get method ss v - .GetAll method s a{sv} - .Set method ssv - - .PropertiesChanged signal sa{sv}as - - xyz.openbmc_project.Console.Access interface - - - .Connect method - h - xyz.openbmc_project.console interface - - - .setBaudRate method u x - .baudrate property u 0 -
Tested: Performed integration testing with bmcweb.
Change-Id: I2444b1083cf26536f43c6f6b4b0857a2921c4f78 Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
show more ...
|
#
30ea6385 |
| 03-May-2023 |
Andrew Jeffery <andrew@aj.id.au> |
console-server: Add PTY support for testing purposes
Different TTY device types have different configuration options. The existing code kinda smooshes the differences between UARTs and VUARTs togeth
console-server: Add PTY support for testing purposes
Different TTY device types have different configuration options. The existing code kinda smooshes the differences between UARTs and VUARTs together. PTYs do not require the configuration applicable to either UARTs or VUARTs. Given this, separate out and be explict about the concepts and configuration required for all three types.
This in turn, with some further patches, allows testing of obmc-console using `socat`:
https://amboar.github.io/notes/2023/05/02/testing-obmc-console-with-socat.html
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I3c1ce610132fce8ef6b5324ed3b4e0c86395e433
show more ...
|
#
b14ca19c |
| 31-Mar-2023 |
Ninad Palsule <ninadpalsule@us.ibm.com> |
Added new dbus interface to query console info
obmc-console recipe configure consoles by setting the socket-id field in the console server config file. obmc-console server use this socket id to buil
Added new dbus interface to query console info
obmc-console recipe configure consoles by setting the socket-id field in the console server config file. obmc-console server use this socket id to build a abract socket name and register new service "xyz.openbmc_project.Console.Access". The leaf of the object path will be socket-id configured. It also exposes the unix abstract socket name through SocketName property. The socket name is sent as a byte stream as abstract socket contains null character at the start.
*** For example if recipe configured socket-id as "console0" the *** following object is exported through dbus interface
# Tree for "console0" console. $ busctl tree xyz.openbmc_project.Console.console0 `-/xyz `-/xyz/openbmc_project `-/xyz/openbmc_project/console `-/xyz/openbmc_project/console/console0
# Get SocketName property for console0 object $ busctl get-property xyz.openbmc_project.Console.console0 /xyz/openbmc_project/console/console0 xyz.openbmc_project.Console.Access SocketName ay 22 0 111 98 109 99 45 99 111 110 115 111 108 101 46 99 111 110 115 111 108 101 48
# Tree for "hypervisor" console $ busctl tree xyz.openbmc_project.Console.hypervisor `-/xyz `-/xyz/openbmc_project `-/xyz/openbmc_project/console `-/xyz/openbmc_project/console/hypervisor
# Get SocketName property for hypervisor object $ busctl get-property xyz.openbmc_project.Console.hypervisor /xyz/openbmc_project/console/hypervisor xyz.openbmc_project.Console.Access SocketName ay 24 0 111 98 109 99 45 99 111 110 115 111 108 101 46 104 121 112 101 114 118 105 115 111 114
# Note that this is an example of two consoles one is 'console0' and # second is 'hypervisor'. I have formated the output to easy viewing. # We also have one extra service for console that is coming from the # service exist today to get/set the tty device baud rate. $ busctl call xyz.openbmc_project.ObjectMapper \ /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper \ GetSubTree sias /xyz/openbmc_project/console 0 1 \ xyz.openbmc_project.Console.Access a{sa{sas}} 2 "/xyz/openbmc_project/console/console0" \ 1 "xyz.openbmc_project.Console.console0" 4 "org.freedesktop.DBus.Introspectable" "org.freedesktop.DBus.Peer" "org.freedesktop.DBus.Properties" "xyz.openbmc_project.Console.Access" "/xyz/openbmc_project/console/hypervisor" 2 "xyz.openbmc_project.Console.hypervisor" 4 "org.freedesktop.DBus.Introspectable" "org.freedesktop.DBus.Peer" "org.freedesktop.DBus.Properties" "xyz.openbmc_project.Console.Access" "xyz.openbmc_project.console" 4 "org.freedesktop.DBus.Introspectable" "org.freedesktop.DBus.Peer" "org.freedesktop.DBus.Properties" "xyz.openbmc_project.Console.Access"
Tested: Tested on the rainer system with busctl command and integration with bmcweb
Related commits: 1) phosphor-dbus-interface: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/61486 2) obmc-console: https://gerrit.openbmc.org/c/openbmc/obmc-console/+/62496 3) bmcweb: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/62525
Change-Id: Ifb70ce5585c3937f3abd904ffbae51ca67f58724 Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
show more ...
|
#
e258e51f |
| 26-Apr-2023 |
Ninad Palsule <ninadpalsule@us.ibm.com> |
Split dbus related code into separate file
Moved dbus related code into separate file. This can be used to disable dbus interface if required.
Change-Id: I880639983edaf00c64acc4acb786203c51b414e7 S
Split dbus related code into separate file
Moved dbus related code into separate file. This can be used to disable dbus interface if required.
Change-Id: I880639983edaf00c64acc4acb786203c51b414e7 Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
show more ...
|