There's a long standing request to extend the output of dmidecode to something that would be machine-readable. Something like an XML or JSON-based format. Unfortunately this can't be implemented right now because the output of dmidecode is generated by open-coded printfs as the DMI table is being parsed, with no intermediate structures nor temporary buffers.

While implementing a machine-parseable output is out of scope for a single hack week, let's remember that even the longest journey starts with a single footstep. I would like to try and rewrite the 5200 lines of code of dmidecode in such a way that printing the output would be somewhat separated from parsing the DMI table and done by a limited set of dedicated functions. Alternative output formats could later hook into such functions.

Looking for hackers with the skills:

dmidecode c

This project is part of:

Hack Week 19

Activity

  • about 4 years ago: bmwiedemann liked this project.
  • about 4 years ago: mkubecek liked this project.
  • about 4 years ago: ematsumiya liked this project.
  • about 4 years ago: jdelvare added keyword "c" to this project.
  • about 4 years ago: jdelvare added keyword "dmidecode" to this project.
  • about 4 years ago: jdelvare started this project.
  • about 4 years ago: jdelvare originated this project.

  • Comments

    • bmwiedemann
      about 4 years ago by bmwiedemann | Reply

      I think there are tools parsing output of dmidecode: ohai and salt at least. Probably more. hwinfo?

      • jdelvare
        about 4 years ago by jdelvare | Reply

        hwinfo has its own DMI table decoder, it does not rely on dmidecode.

        I didn't know about ohai (I don't even know what it is) and salt. The output of dmidecode is plain text currently, it can be parsed if you are motivated enough, just you have to write your own parser and hope that the output format will never change in a way that will break your parser. I can understand why people would prefer a more structured output format.

    • jdelvare
      about 4 years ago by jdelvare | Reply

      Last week I posted preliminary clean-up patches that I came up with during the project:

      https://lists.nongnu.org/archive/html/dmidecode-devel/2020-03/threads.html

      There were no objections, so I committed them yesterday.

    • jdelvare

    Similar Projects

    Extend GObject based introspectable API to libzypp by zbenjamin

    [comment]: # (Please use the project descriptio...


    Vulkan Widget for GTK by yudaike

    [comment]: # (Please use the project descriptio...


    80-bit floats support on x86_64 for Valgrind by mfranc

    [comment]: # (Please use the project descriptio...


    Deep Packet Inspection: compare the performance between libnetfilter_queue, NF_HOOK and eBPF XDP by nguyens

    Deep Packet Inspection: compare the performan...


    The Missing Middle: Add an intermediate brightness setting for auxiliary LEDs in Andúril 2 by gkenion

    [comment]: # (Please use the project descriptio...