summaryrefslogtreecommitdiff
path: root/src/udev/dmi_memory_id
Commit message (Collapse)AuthorAgeFilesLines
* udev: use version()Yu Watanabe2023-04-261-3/+1
| | | | Fixes #27382.
* udev: implement --version in all builtinsZbigniew Jędrzejewski-Szmek2023-03-161-3/+8
| | | | | | | | | | | | | | | | Those are separate binaries, and occasionally people will get a misplaced binary that doesn't match the rest of the installed system and be confused, so it good to be able to check the version. It is also nice to have the same interface in all binaries. Note that we usually use a separate 'enum ARG_VERSION = 0x100' for an option without a short name. We can use a less verbose approach of simply taking any unused letter, which works just as well and even the compiler would warn us if we tried to use the letter in another place. This way we avoid a few lines of boilerplate. The help texts are adjusted to have an empty line between the synopsis and option list, and no empty lines after the option list.
* tree-wide: Use correct format specifiersJan Janssen2022-08-301-1/+1
| | | | gcc will complain about all these with -Wformat-signedness.
* fix typoseggfly2022-08-231-1/+1
|
* memory-id: Work-around incorrect "Number of slots"Bastien Nocera2022-03-071-7/+9
| | | | | | | | | | | | | | In some BIOSes, the "Number of slots or sockets available for Memory Devices in this array" is incorrectly set to the number of memory array that's populated. Work-around this problem by outputting the number of sockets after having parsed them so that consumers of this data can carry on expecting an accurate number in this property. This fixes the number of memory slots advertised for the HP Z600. See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1686
* Change gendered terms to be gender-neutral (#21325)Emily Gonyer2021-11-121-1/+1
| | | Some typos are also fixed.
* alloc-util: add strdupa_safe() + strndupa_safe() and use it everywhereLennart Poettering2021-10-141-1/+1
| | | | | | | | | | | | | Let's define two helpers strdupa_safe() + strndupa_safe() which do the same as their non-safe counterparts, except that they abort if called with allocations larger than ALLOCA_MAX. This should ensure that all our alloca() based allocations are subject to this limit. afaics glibc offers three alloca() based APIs: alloca() itself, strndupa() + strdupa(). With this we have now replacements for all of them, that take the limit into account.
* Drop the text argument from assert_not_reached()Zbigniew Jędrzejewski-Szmek2021-08-031-1/+1
| | | | | | | | | | | | | | | | | In general we almost never hit those asserts in production code, so users see them very rarely, if ever. But either way, we just need something that users can pass to the developers. We have quite a few of those asserts, and some have fairly nice messages, but many are like "WTF?" or "???" or "unexpected something". The error that is printed includes the file location, and function name. In almost all functions there's at most one assert, so the function name alone is enough to identify the failure for a developer. So we don't get much extra from the message, and we might just as well drop them. Dropping them makes our code a tiny bit smaller, and most importantly, improves development experience by making it easy to insert such an assert in the code without thinking how to phrase the argument.
* meson: simplify the BUILD_MODE conditionalZbigniew Jędrzejewski-Szmek2021-04-141-1/+1
| | | | | | | Using a enum is all nice and generic, but at this point it seems unlikely that we'll add further build modes. But having an enum means that we need to include the header file with the enumeration whenerever the conditional is used. I want to use the conditional in log.h, which makes it hard to avoid circular imports.
* memory-id: fix never hit conditionYu Watanabe2020-12-181-2/+5
| | | | As sizeof(int64_t) is always 8.
* tree-wide: fix typoYu Watanabe2020-12-181-2/+2
|
* udev: Extract RAM properties from DMI informationBastien Nocera2020-12-161-0/+710
Add memory_id program to set properties about the physical memory devices in the system. This is useful on machines with removable memory modules to show how the machine can be upgraded, and on all devices to detect the actual RAM size, without relying on the OS accessible amount. Closes: #16651