History log of /openbmc/obmc-console/config.c (Results 1 – 25 of 25)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 4ec26bb1 29-Aug-2024 Igor Kononenko <i.kononenko.e@gmail.com>

obmc-console: fix segfault on missing config

The `obmc-console-client` allow to not specify configuration file for
active session. But at the same time it does not tolerate null pointer
passed as co

obmc-console: fix segfault on missing config

The `obmc-console-client` allow to not specify configuration file for
active session. But at the same time it does not tolerate null pointer
passed as config. This leads to a segmentation fault due to a missing
configuration file.

Fix this small inconvenience.

Added testcase to make sure that obmc-console-client doesn't segfault
when invoked without any arguments.

Output without the fix:
'''
+ /home/dev/obmc-console/build/obmc-console-client
+ grep Connection refused
Segmentation fault (core dumped)
'''

Output with the fix:
'''
+ /home/ninad/dev/1110_ghe/obmc-console/build/obmc-console-client
+ grep Connection refused
+ cleanup
+ cd -
+ rm -rf /tmp/test_console_client_no_args_3245394.DZqk0S
'''

Change-Id: Ia83da8bca30e2be94e00066f20f2cbe2ccba23b6
Tested-by: Ninad Palsule <ninad@linux.ibm.com>
Signed-off-by: Ninad Palsule <ninad@linux.ibm.com>
Signed-off-by: Igor Kononenko <i.kononenko.e@gmail.com>

show more ...


# b965c220 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I2f8eeee40b0b2583092d351979dd77fd277a97ba
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# e3a083eb 08-Jul-2024 Alexander Hansen <alexander.hansen@9elements.com>

config: support sections in config_ api

This commit wraps some functions from iniparser to support sections in
our config files.

The new functions become part of the config_* api and will help to
s

config: support sections in config_ api

This commit wraps some functions from iniparser to support sections in
our config files.

The new functions become part of the config_* api and will help to
support the uart mux feature.

Change-Id: I7fa9aa1d60b67458943d5c53a1aeb90406c5fcf3
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>

show more ...


# e3f1aa1e 10-Jul-2024 Alexander Hansen <alexander.hansen@9elements.com>

util: Consolidate ARRAY_SIZE() definitions

ARRAY_SIZE() was defined several times around the code-base.
Provide a single definition in util.h and include it where necessary.

Change-Id: Idc4cf030969

util: Consolidate ARRAY_SIZE() definitions

ARRAY_SIZE() was defined several times around the code-base.
Provide a single definition in util.h and include it where necessary.

Change-Id: Idc4cf030969ffc7f0928c6897a23962a70adcf05
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>

show more ...


# d659cfcd 09-Jul-2024 Andrew Jeffery <andrew@codeconstruct.com.au>

config: Allow NULL for internal dict pointer

If the default configuration file is not present, behave as if it
were empty. This allows obmc-console-server to not fail out if no
configuration is prov

config: Allow NULL for internal dict pointer

If the default configuration file is not present, behave as if it
were empty. This allows obmc-console-server to not fail out if no
configuration is provided, but still fail out if a struct config object
couldn't be allocated.

Change-Id: Ic188281f5fc41d94b3175c8009c97f1efb62699a
Fixes: 1e04f449b7f0 ("use iniparser dependency for config file parsing")
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

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 ...


# d6e8b64a 18-Mar-2024 Medicine Yeh <medicinehy@gmail.com>

config: rename parse_logsize to be more generic

Rename config_parse_logsize to config_parse_bytesize.
A more generic name allows this function to be reused in other
config parsing purposes.

Change-

config: rename parse_logsize to be more generic

Rename config_parse_logsize to config_parse_bytesize.
A more generic name allows this function to be reused in other
config parsing purposes.

Change-Id: I3036c184669be17ddc0d194f275ea05d871341d1
Signed-off-by: Medicine Yeh <medicinehy@gmail.com>

show more ...


# acefe010 12-Sep-2023 Zev Weiss <zev@bewilderbeest.net>

config: Allow multi-word config values

None of the presently existing config keys need it, but in order to
support configuring multiple channels of the Aspeed UART-routing mux it
will be useful to b

config: Allow multi-word config values

None of the presently existing config keys need it, but in order to
support configuring multiple channels of the Aspeed UART-routing mux it
will be useful to be able to have multiple (space-separated) words in a
config value (whereas previously the value was truncated at the first
space). The '#' comment character is respected as terminating the
value, however.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I2ab6f16efb2f0bed1041d79b1766136df939350d

show more ...


# 35f44fcc 12-Sep-2023 Zev Weiss <zev@bewilderbeest.net>

config: Use isspace(3) instead of open-coding it

While we're at it, a 'while' loop seems incrementally more readable than
a partially-populated 'for' loop with the desired effect in the third
clause

config: Use isspace(3) instead of open-coding it

While we're at it, a 'while' loop seems incrementally more readable than
a partially-populated 'for' loop with the desired effect in the third
clause.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I2a1a9b9f6fecc8e24ef7f124b8ac5048f20be3f9

show more ...


# dfda5afb 06-Jun-2023 Andrew Jeffery <andrew@aj.id.au>

config: Drop support for the `socket-id` configuration key

9a8f30ec5b58 ("obmc-console: Introduce console-id, deprecate socket-id")
replaces the `socket-id` configuration key with a better name. Now

config: Drop support for the `socket-id` configuration key

9a8f30ec5b58 ("obmc-console: Introduce console-id, deprecate socket-id")
replaces the `socket-id` configuration key with a better name. Now that
we've fixed up all in-tree users in OpenBMC with 7a612d4fa70f
("obmc-console: Convert configs from socket-id to console-id"), drop
support for `socket-id`.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ied35025a98db426e27891f32ed4bd661d0edb14c

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 ...


# ba2af969 02-May-2023 Andrew Jeffery <andrew@aj.id.au>

console-server: Don't require a configuration file

Not requiring a configuration file makes it marginally less irritating
to test obmc-console-server.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au

console-server: Don't require a configuration file

Not requiring a configuration file makes it marginally less irritating
to test obmc-console-server.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ibdf898933284bb4028861d25640bea3c58fb05bf

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


# d30d7573 18-Apr-2023 Andrew Jeffery <andrew@aj.id.au>

config: Remove use of %m sscanf format specifier

The %m format specifier isn't defined by the C standards and so produces
an error under CFLAGS=`-pedantic -Werror`.

Signed-off-by: Andrew Jeffery <a

config: Remove use of %m sscanf format specifier

The %m format specifier isn't defined by the C standards and so produces
an error under CFLAGS=`-pedantic -Werror`.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I7fd818582472ced3f8e6adc2ea5d545b5b7dc020

show more ...


# f9c8f6ca 04-Mar-2019 Cheng C Yang <cheng.c.yang@linux.intel.com>

Change baudrate dynamically through dbus

Create a dbus interface so that user can change baudrate dynamically.
With this feature, SOL can still work correctly when BIOS switch uart
from high speed u

Change baudrate dynamically through dbus

Create a dbus interface so that user can change baudrate dynamically.
With this feature, SOL can still work correctly when BIOS switch uart
from high speed uart to normal uart.

Tested By:
Run busctl introspect xyz.openbmc_project.console /xyz/openbmc_project/console
the property baudrate show the current baudrate.
Run busctl call xyz.openbmc_project.console /xyz/openbmc_project/console
xyz.openbmc_project.console setBaudRate x 9600
The property baudrate show 9600 now. After change BIOS console redirection
to 9600 baudrate and change putty client also to 9600. SOL and serial port can
work correctly.

Change-Id: I2045f47520275a0b5bb9242af78a64e5aac8ea8a
Signed-off-by: Cheng C Yang <cheng.c.yang@linux.intel.com>

show more ...


# 6424cc3b 14-Jun-2018 Kun Yi <kunyi731@gmail.com>

log-handler: Add a config option for log size.

Allow a configuration option to specify a log size. The parameter takes and
interprets common size suffixes k/M/G. 1kB = 1024B, 1MB=1024kB, 1GB=1024MB.

log-handler: Add a config option for log size.

Allow a configuration option to specify a log size. The parameter takes and
interprets common size suffixes k/M/G. 1kB = 1024B, 1MB=1024kB, 1GB=1024MB.
Default unit is byte. If "B" is specified at the end it will be ignored.

Tested:
Tested that "logsize = 567kB" correctly sets up a 567KB log buffer.
Tested that invalid/overflow values will be ignored and 16KB will be used.
Tested that if log size smaller than pagesize is rounded up.

Change-Id: I2fb50462c6ff7873130be80f7d57ef8065acc5da
Signed-off-by: Kun Yi <kunyi731@gmail.com>

show more ...


# fcbdea9c 04-Jun-2018 Benjamin Fair <benjaminfair@google.com>

tty-handler: move baud rate parsing into config.c

This is in preparation for being able to set the baud rate on the host
console tty.

Change-Id: Id279530bdfc1240649fcdd606fbc928437fc38dc
Signed-off

tty-handler: move baud rate parsing into config.c

This is in preparation for being able to set the baud rate on the host
console tty.

Change-Id: Id279530bdfc1240649fcdd606fbc928437fc38dc
Signed-off-by: Benjamin Fair <benjaminfair@google.com>

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>


# e440a407 17-Mar-2016 Jeremy Kerr <jk@ozlabs.org>

Use obmc-* for binary, logs, and config filenames

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>


# 6c8d781c 17-Mar-2016 Jeremy Kerr <jk@ozlabs.org>

config: Add test utility for configuration system

When compiled with CONFIG_TEST, the config code will include a little
main() function to read configuration from stdin, and print parsed
config to s

config: Add test utility for configuration system

When compiled with CONFIG_TEST, the config code will include a little
main() function to read configuration from stdin, and print parsed
config to stdout.

This allows the configuration system to be easily used with a testuite
or fuzzer.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

show more ...


# 2eb56f55 17-Mar-2016 Jeremy Kerr <jk@ozlabs.org>

config: Avoid fstat in configuration read

Instead of using fstat(), just read until we've reached EOF.

This allows us to read input from a non-standard file.

Signed-off-by: Jeremy Kerr <jk@ozlabs.

config: Avoid fstat in configuration read

Instead of using fstat(), just read until we've reached EOF.

This allows us to read input from a non-standard file.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

show more ...


# d66195c1 16-Mar-2016 Jeremy Kerr <jk@ozlabs.org>

Add configuration infrastructure

Rather than expecting parameters on the command line, this change
implemnets a little configration infrastructure, to allow the core
code to load configuration from

Add configuration infrastructure

Rather than expecting parameters on the command line, this change
implemnets a little configration infrastructure, to allow the core
code to load configuration from a file in ${sysconfdir}.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

show more ...