Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analyze: add new verb "smbios11" for listing passed smbios type #11 strings #32810

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

poettering
Copy link
Member

@poettering poettering commented May 14, 2024

There's no nice way to query this otherwise with default distro tools

@dnicolodi
Copy link

Would it make sense to have the tool optionally emit machine parsable output (ie omit the trailing log message)?

@poettering
Copy link
Member Author

Would it make sense to have the tool optionally emit machine parsable output (ie omit the trailing log message)?

that goes to stderr anyway (unlike the strings themselves) and you can always use SYSTEMD_LOG_TARGET=null...

@github-actions github-actions bot added documentation build-system util-lib meson please-review PR is ready for (re-)review by a maintainer labels May 14, 2024
@dnicolodi
Copy link

Right. I didn't pay attention to how the command is implemented, I just inferred from the documentation. Thanks!

Copy link

Important

An -rc1 tag has been created and a release is being prepared, so please note that PRs introducing new features and APIs will be held back until the new version has been released.

src/shared/smbios11.c Outdated Show resolved Hide resolved
src/analyze/analyze-smbios11.c Outdated Show resolved Hide resolved
src/analyze/analyze-smbios11.c Show resolved Hide resolved
@poettering
Copy link
Member Author

new version pushed, ptal

Copy link
Member

@yuwata yuwata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Please add simple coverage tests for the new command.

@poettering
Copy link
Member Author

Right. I didn't pay attention to how the command is implemented, I just inferred from the documentation. Thanks!

btw, the message is now also suppressed if you add "-q" or "--quiet" to the cmdline

I find myself wanting to check this data with a quick command, and
browsing through /sys/ manually getting binary data sucks. Hence let's
do add a nice little analysis tool.
@poettering
Copy link
Member Author

Please add simple coverage tests for the new command.

done

p,
max_size >= SIZE_MAX - offsetof(struct dmi_field_header, contents) ? SIZE_MAX :
sizeof(dmi_field_header) + max_size,
(char**) &data, &size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why not directly read into dmi_field_header?

uint16_t handle;
uint8_t count;
char contents[];
} _packed_ *dmi_field_header;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e.:

Suggested change
} _packed_ *dmi_field_header;
} _packed_ * _cleanup_free_ dmi_field_header;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants