Hi All,
I created another PR https://github.com/jirihnidek/dmidecode/pull/2, where
"dmidecode --json" uses json-c. It is still draft. I need to do some
refactoring and testing. Do not expect that it will work seamlessly with
all combinations of CLI options.

Example of output is here:
https://gist.github.com/jirihnidek/2269d97f9cc9be9dc74b310eceb9e2d0

I would like to get your feedback.

I hope that such will be accepted (after addressing all requests and
comments). We would not like to create some fork of dmidecode. Having the
option to do output of dmidecode without any other wrapper like (
https://kellyjonbrazil.github.io/jc/) is important to us.

Thanks in advance,

Jiri

On Fri, Jun 23, 2023 at 4:45 PM Jiri Hnidek <jhni...@redhat.com> wrote:

> Hi,
> I'm working on machine readable output of dmidecode. I added the --json
> CLI option. You can see my POC here:
>
> https://github.com/jirihnidek/dmidecode/pull/1
>
> Example of output can be seen here:
>
> https://gist.github.com/jirihnidek/02c7620a5c2cf06752ccea877b35cc84
>
> As you can see there are no dependencies to any other library, but some
> information is missing in the output (e.g. handle, DMI type), and there are
> other issues.
>
> I would like to ask if you would be interested adding this to upstream
> version of dmidecode?
>
> I would like to do proper implementation using the json-c library:
> https://github.com/json-c/json-c This is a small library that is part of
> most Linux distributions. Could adding dependency on json-c be acceptable?
>
> Adding support for machine readable output to dmidecode would be much
> appreciated, because our tools like subscription-manager [1] (core part of
> all RHEL) has to parse human readable output of dmidecode and it is
> sub-optimal. There are other projects trying to parse output of dmidecode,
> e.g. py-dmidecode: https://pypi.org/project/py-dmidecode/
>
> Thanks in advance
>
> Jiri
>
> [1] https://github.com/candlepin/subscription-manager/
>
> --
> Jiri Hnidek
> Senior Software Engineer, Team Candlepin, Red Hat
>

Reply via email to