WIP: Adding Mainboard page #14
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
translation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sungsphinx/examine!14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "add-mainboard-info"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is just WIP as it does currently error out on the page.
Found some small details
@ -88,11 +95,20 @@ impl Application for AppModel {Err((_errors, config)) => config,})You probably need to run this as sudo for it to work.
This wont work for this string, we need to exclude lines without
:first.Mm I'm not sure how to do that personally lol. I just copied the other lines.
@ -88,11 +95,20 @@ impl Application for AppModel {Err((_errors, config)) => config,})The issue with that is that there will not be a prompt to ask the user for that currently. It looks like this gives some info without sudo:
cat /sys/devices/virtual/dmi/id/board_{vendor,name,version}
Yeah me neither, but maybe there's a way to prompt the user for authorization and elevate the process.
I'm sure there is/will be but perhaps we'll want to do this a different way.
Sorry I confused the conversations, you can use
filterfor that.I think we may want to use this crate like how osrelease is pulled:
https://docs.rs/smbios-lib/0.9.2/smbioslib/
It looks like
hostnamectldoes not need root and it provides board information.The page displays info that should probably not be on the motherboard page:
@ -355,6 +371,33 @@ impl Application for AppModel {.height(Length::Fill)We should trim all whitespaces out of the prefix, otherwise it looks strange.
@sungsphinx I need to get it to build on 24.10 for testing on my end.
LGTM
Yea it certainly has more info then we may want.
I don't know how to trim out more content @sungsphinx but this at least gets a nice starting point.
I don’t believe it has more info than what’s needed, is just the right amount imo
@edfloreshz I don't think it should show stuff like Operating System, Icon Name and Static Hostname, etc. Just motherboard related info.
@ahoneybun Maybe we could parse a json output from
hostnamectl:Should have mentioned certain only lines/blocks/whatever it is in JSON files that relate to the motherboard lol.
It looks like
inxi --machinemight be better?I can't seem to build the project though:
I had the same when I was attempting the Hardware Security page (#6), I think the command has a bit of a delay, and rust decides:
nah I'm good thanks 1 second is too longHow about getting the JSON a de-serializing it to a struct that only contains the fields we need?
That's fine I just don't know how to do that, I can certainly change the output to JSON though!
Refer to this, you can read a JSON and access specific untyped values by key.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.