Skip to content

Adding Mainboard page#14

Draft
ahoneybun wants to merge 4 commits into
mainfrom
add-mainboard-info
Draft

Adding Mainboard page#14
ahoneybun wants to merge 4 commits into
mainfrom
add-mainboard-info

Conversation

@ahoneybun

Copy link
Copy Markdown
Member

This is just WIP as it does currently error out on the page.

@edfloreshz edfloreshz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Found some small details

Comment thread src/app.rs
Comment thread src/app.rs Outdated
@ahoneybun

Copy link
Copy Markdown
Member Author

I think we may want to use this crate like how osrelease is pulled:

https://docs.rs/smbios-lib/0.9.2/smbioslib/

@sungsphinx sungsphinx added the enhancement New feature or request label Oct 18, 2024
@ahoneybun

Copy link
Copy Markdown
Member Author

It looks like hostnamectl does not need root and it provides board information.

@ahoneybun ahoneybun requested a review from edfloreshz November 3, 2024 02:33

@sungsphinx sungsphinx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The page displays info that should probably not be on the motherboard page:

image

Comment thread src/app.rs Outdated
Co-authored-by: Dexter Reed <dreed4470@proton.me>
@ahoneybun ahoneybun requested a review from sungsphinx November 3, 2024 18:03
@ahoneybun

Copy link
Copy Markdown
Member Author

@sungsphinx I need to get it to build on 24.10 for testing on my end.

@edfloreshz edfloreshz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ahoneybun

Copy link
Copy Markdown
Member Author

Yea it certainly has more info then we may want.

screenshot-2024-11-04-13-31-03

@ahoneybun

Copy link
Copy Markdown
Member Author

I don't know how to trim out more content @sungsphinx but this at least gets a nice starting point.

@edfloreshz

Copy link
Copy Markdown
Member

I don’t believe it has more info than what’s needed, is just the right amount imo

@sungsphinx

Copy link
Copy Markdown
Member

@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:

hostnamectl --json={pretty or short}

@ahoneybun

ahoneybun commented Nov 5, 2024

Copy link
Copy Markdown
Member Author

@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:

hostnamectl --json={pretty or short}
aaronh@pop-os:~$ hostnamectl --json=pretty
{
	"Hostname" : "pop-os",
	"StaticHostname" : "pop-os",
	"PrettyHostname" : null,
	"DefaultHostname" : "localhost",
	"HostnameSource" : "static",
	"IconName" : "computer-desktop",
	"Chassis" : "desktop",
	"Deployment" : null,
	"Location" : null,
	"KernelName" : "Linux",
	"KernelRelease" : "6.9.3-76060903-generic",
	"KernelVersion" : "#202405300957~1728589823~24.04~3d61696 SMP PREEMPT_DYNAMIC Thu O",
	"OperatingSystemPrettyName" : "Pop!_OS 24.04 LTS",
	"OperatingSystemCPEName" : null,
	"OperatingSystemHomeURL" : "https://pop.system76.com",
	"HardwareVendor" : "System76",
	"HardwareModel" : "Thelio",
	"HardwareSerial" : null,
	"FirmwareVersion" : "F15a Z5",
	"FirmwareVendor" : "System76",
	"FirmwareDate" : 1582156800000000,
	"MachineID" : "dfcbb39e233116762e17fd0666578a76",
	"BootID" : "7b5f89cae03a4b63aa7cf84a74e2c982",
	"ProductUUID" : null
}
aaronh@pop-os:~$ hostnamectl --json=short
{"Hostname":"pop-os","StaticHostname":"pop-os","PrettyHostname":null,"DefaultHostname":"localhost","HostnameSource":"static","IconName":"computer-desktop","Chassis":"desktop","Deployment":null,"Location":null,"KernelName":"Linux","KernelRelease":"6.9.3-76060903-generic","KernelVersion":"#202405300957~1728589823~24.04~3d61696 SMP PREEMPT_DYNAMIC Thu O","OperatingSystemPrettyName":"Pop!_OS 24.04 LTS","OperatingSystemCPEName":null,"OperatingSystemHomeURL":"https://pop.system76.com","HardwareVendor":"System76","HardwareModel":"Thelio","HardwareSerial":null,"FirmwareVersion":"F15a Z5","FirmwareVendor":"System76","FirmwareDate":1582156800000000,"MachineID":"dfcbb39e233116762e17fd0666578a76","BootID":"7b5f89cae03a4b63aa7cf84a74e2c982","ProductUUID":null}

@sungsphinx

Copy link
Copy Markdown
Member

Should have mentioned certain only lines/blocks/whatever it is in JSON files that relate to the motherboard lol.

@ahoneybun

Copy link
Copy Markdown
Member Author

It looks like inxi --machine might be better?

I can't seem to build the project though:

[2024-11-05T18:52:12Z WARN  sctk_adwaita::buttons] Ignoring unknown button type:
thread 'main' panicked at src/app.rs:386:77:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2024-11-05T18:52:12Z ERROR iced_winit::platform_specific::wayland::event_loop] SCTK failed to send Control::AboutToWait. TrySendError { kind: Disconnected }

@sungsphinx

Copy link
Copy Markdown
Member

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 long

@edfloreshz

Copy link
Copy Markdown
Member

How about getting the JSON a de-serializing it to a struct that only contains the fields we need?

@ahoneybun

Copy link
Copy Markdown
Member Author

How 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!

@edfloreshz

Copy link
Copy Markdown
Member

Refer to this, you can read a JSON and access specific untyped values by key.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants