#
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 ...
|
Revision tags: v1.1.0 |
|
#
5ba20b5b |
| 12-May-2023 |
Ninad Palsule <ninadpalsule@us.ibm.com> |
obmc-console: Consolidate handling of default socket-id
If console-id is not specified on command line or in the config file then use the default value. ae2460d0b8e8 ("obmc-console: Provide a defaul
obmc-console: Consolidate handling of default socket-id
If console-id is not specified on command line or in the config file then use the default value. ae2460d0b8e8 ("obmc-console: Provide a default value for `console-id`.") only implemented the default value for naming the abstract listening socket and overlooked the new DBus path naming convention. This caused issues during dbus registration:
``` obmc-console-server: Object name: /xyz/openbmc_project/console/(null) obmc-console-server: Failed to issue method call: Invalid argument ```
Fixes: ae2460d0b8e8 ("obmc-console: Provide a default value for `console-id`.") Change-Id: I6d0f7b23cc085992189cd4463129a6aae590b3e7 Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
9a8f30ec |
| 01-May-2023 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Introduce console-id, deprecate socket-id
The name `socket-id` exposes too much detail about the implementation. Really the tag identifies the console, so name it as such.
Maintain ba
obmc-console: Introduce console-id, deprecate socket-id
The name `socket-id` exposes too much detail about the implementation. Really the tag identifies the console, so name it as such.
Maintain backwards compatibility until we've converted all the in-tree OpenBMC users over to `console-id`. Once that's done we can drop support for `socket-id`.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I5aa2ba84835d64901e459b42bfe7be59043466c7
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 ...
|
#
b70f8713 |
| 18-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Fix readability-isolate-declaration
For example:
``` /usr/bin/clang-tidy -checks=-*, readability-isolate-declaration -export-fixes /tmp/tmpoo7fbs72/tmpo8xiwfxs.yaml -p=build /mnt/host
obmc-console: Fix readability-isolate-declaration
For example:
``` /usr/bin/clang-tidy -checks=-*, readability-isolate-declaration -export-fixes /tmp/tmpoo7fbs72/tmpo8xiwfxs.yaml -p=build /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/test-client-escape.c /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:61:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors] char *name, *value; ^~~~~~~~~~~~~~~~~~~ /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:62:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors] char *p, *line; ^~~~~~~~~~~~~~~ /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:110:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors] size_t size, len; ^~~~~~~~~~~~~~~~~ /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:170:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors] struct config_item *item, *next; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../console-client.c:263:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors] struct console_client _client, *client; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 warnings generated. ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ia7829b1672ea2dfb3fa020c7c48bd8266e6a1769
show more ...
|
#
2834c5b1 |
| 18-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Fix readability-braces-around-statements
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I88d2bdcb15106298d83a1cf7176e069092820f1d
|
#
5c359cc6 |
| 18-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Fix bugprone-narrowing-conversions
For example:
``` /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../console-server.c:769:9: error: narrowing conversion from 'ssize_t' (
obmc-console: Fix bugprone-narrowing-conversions
For example:
``` /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../console-server.c:769:9: error: narrowing conversion from 'ssize_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors] rc = read(console->tty_fd, buf, sizeof(buf)); ^ ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I67c158b411f1533ca3b5a62803116e95907e8c5b
show more ...
|
#
a72711af |
| 18-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Add clang-format configuration
And apply the formatting.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I75251051affa5129c8698185baf8d151302b19d6
|
#
6ed0e4e7 |
| 20-Feb-2020 |
Andrew Jeffery <andrew@aj.id.au> |
console-client: Improve failure-to-connect warning
Print the abstract socket path to which we failed to connect.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I62b3656d5aeda655dcb89e53
console-client: Improve failure-to-connect warning
Print the abstract socket path to which we failed to connect.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I62b3656d5aeda655dcb89e53beccb02f0046661c
show more ...
|
#
71e7a249 |
| 12-Feb-2020 |
Andrew Jeffery <andrew@aj.id.au> |
console-client: Enable use of a configuration file
However, only initialise a config if the option was provided. This avoids searching for the default config, which may not exist and is intended for
console-client: Enable use of a configuration file
However, only initialise a config if the option was provided. This avoids searching for the default config, which may not exist and is intended for the server.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I08f736243c1843bfb8855f5ceb69418d59a8775a
show more ...
|
#
ddf2ab7c |
| 09-Feb-2020 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Expose socket ID configuration for client and server
* Add a new option in the server configuration file to use a friendly ID in the socket abstract path * Add a new command-line opt
obmc-console: Expose socket ID configuration for client and server
* Add a new option in the server configuration file to use a friendly ID in the socket abstract path * Add a new command-line option to the client to connect to a particular server socket path.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I95440ca7c2c76d2c1ef00d92abc9e0ffc32cbf5a
show more ...
|
#
5e7c0786 |
| 09-Feb-2020 |
Andrew Jeffery <andrew@aj.id.au> |
console-socket: Add an optional component to UNIX socket abstract names
Allows multiple instances of obmc-console-server to run concurrently without interfering with each other.
Signed-off-by: Andr
console-socket: Add an optional component to UNIX socket abstract names
Allows multiple instances of obmc-console-server to run concurrently without interfering with each other.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I7ef9c14e554c687e8d606e1eaaed82a7f1c06d98
show more ...
|
#
5b16dc89 |
| 26-Jul-2019 |
William A. Kennington III <wak@google.com> |
console-client: Fix fixed-string escape mode dropping its last byte
This fixes an issue of the server not receiving the final byte of the escape sequence due to an off by one.
Fixes: 15691c8ef350bc
console-client: Fix fixed-string escape mode dropping its last byte
This fixes an issue of the server not receiving the final byte of the escape sequence due to an off by one.
Fixes: 15691c8ef350bcaae0f37c522488ce87dbe5ea84 Change-Id: Id6240f858fb4b77e684faeb3405cc631c07c35cb Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
#
8a154357 |
| 25-Jul-2019 |
William A. Kennington III <wak@google.com> |
console-client: Produce unique exit code when escaped
This allows programs which supervise obmc-console-client to know the difference between a clean exit and one where the shell had a deliberate es
console-client: Produce unique exit code when escaped
This allows programs which supervise obmc-console-client to know the difference between a clean exit and one where the shell had a deliberate escape.
Tested: Ran on a machine and checked that issuing an escape generated a return code of 2.
Change-Id: Ica698134f60ba17b445c12b9c95faed43f90f309 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
#
15691c8e |
| 25-Jul-2019 |
William A. Kennington III <wak@google.com> |
console-client: Support an alternate string escape mode
This mode is intended to avoid the behavior of witholding any characters from the console-server. It sends the entire buffer regardless of mat
console-client: Support an alternate string escape mode
This mode is intended to avoid the behavior of witholding any characters from the console-server. It sends the entire buffer regardless of matching the escape sequence, however it will immediately terminate after seeing a full escape sequence and sending the remaining buffered content.
Tested: Ran obmc-console-client with no arguments and ensured the ssh-like escape sequence still worked. Then ran `obmc-console-client -e esc`, typed a bunch of text into the console followed by esc and watched the console exit as expected.
Change-Id: I780719d6e2402f93bba81beb8c09e1c661471e22 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
#
ff569830 |
| 25-Jul-2019 |
William A. Kennington III <wak@google.com> |
console-client: Cleanup the escape code
This change fixes a bug where multiple tildes were sent if a user typed \r~~ This is unlike ssh, which allows nesting of escape sequences by ensuring that onl
console-client: Cleanup the escape code
This change fixes a bug where multiple tildes were sent if a user typed \r~~ This is unlike ssh, which allows nesting of escape sequences by ensuring that only the second tilde is sent after the command sequence is issued. This patch fixes the behavior so the console-server only ever gets \r~ for an issued \r~~
This also prepares the escape sequence handling code for an upcoming change which allows a user configurable escape sequence in addition to the default ssh like one.
Change-Id: Iaff04e62fb57fab88d413df2b347809b98f728bb Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
#
fcf8541b |
| 18-Dec-2018 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
obmc-console-server: bind/connect with the correct sockaddr size
Abstract unix sockets start with the nul-charater, but are not nul terminated. In fact, the nul-character has no meaning in the path.
obmc-console-server: bind/connect with the correct sockaddr size
Abstract unix sockets start with the nul-charater, but are not nul terminated. In fact, the nul-character has no meaning in the path. According to the man page unix(7),
abstract: an abstract socket address is distinguished (from a pathname socket) by the fact that sun_path[0] is a null byte ('\0'). The socket's address in this namespace is given by the additional bytes in sun_path that are covered by the specified length of the address structure. (Null bytes in the name have no special significance.)
This means that when calling bind/connect, the size of the sockaddr structure is not sizeof(sockaddr_un), it is sizeof(sockaddr_un) - sizeof(sun_path) + (path_len)
Change-Id: I6560ba8b2a25a60644873adf66f02a60ded42b1d Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
#
0cff652c |
| 17-Mar-2016 |
Jeremy Kerr <jk@ozlabs.org> |
socket: Actually use the console-socket definitions
Since the console_socket variables aren't declared with 'extern' in console-server.h, we ended up with default definitions for these. This happene
socket: Actually use the console-socket definitions
Since the console_socket variables aren't declared with 'extern' in console-server.h, we ended up with default definitions for these. This happened to work, but with a zero-length socket path.
This change uses the console-socket.c object as intended, to provide proper socket paths.
Now that the char[] is an extern, we'll need to get the address of it to get the pointer value.
Also, fix the sizeof() to take account of the trailing nul.
Found by Joel Stanley <joel@jms.id.au>.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
#
8596581d |
| 17-Mar-2016 |
Joel Stanley <joel@jms.id.au> |
console-client: Initialise prc before acessing it
On the first time through the loop, if the test is false:
if (pollfds[0].revents) ...
then prc is uninitalised when we access it here:
if
console-client: Initialise prc before acessing it
On the first time through the loop, if the test is false:
if (pollfds[0].revents) ...
then prc is uninitalised when we access it here:
if (prc == PROCESS_OK && ...
To avoid this, initialise it to PROCESS_OK.
[jk: Minor change to use PROCESS_OK instead of PROCESS_ERR]
Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|
#
9326d779 |
| 17-Mar-2016 |
Jeremy Kerr <jk@ozlabs.org> |
Add licence document and per-file headers
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
#
2bd05186 |
| 10-Mar-2016 |
Jeremy Kerr <jk@ozlabs.org> |
Add socket handler & console client
This change adds a socket handler to the console-server, exposing a unix domain socket for the UART data. We use this to replace the existing stdio handler.
We a
Add socket handler & console client
This change adds a socket handler to the console-server, exposing a unix domain socket for the UART data. We use this to replace the existing stdio handler.
We also add a client for this socket, allowing multiple processes to read/write data from & to the server.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|