-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
uname processor and hwplatform #2041
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
Comments
We'd have to think about how we should retrieve this information per platform. Anyway on my machine uname has no clue about any of those. |
maybe this can help |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still an issue. It'd be cool if we could do better than GNU in this area. Maybe to unblock this a bit, we could implement this for Linux first and think about other platforms later? |
@tertsdiepraam I'd care to work on this. Gotta have to find some free time first though. Maybe sometime later in this month. |
in linux you can get it from parsing here is how i do this |
This might be a bit harder than I thought. So I wasn't able to find any x86_64 machine of my own that had results for "processor" or "hwplatform". I had a few friends test their results for me, but it doesn't help that MacOS uses a different
My ryzen 3
M1 Macbook
Android
A different Android
Intel Macbook I think
So first we have to figure out what we want these flags to even do exactly. What does GNU do?processor (-p)Before this commit GNU relied on a Then it tries using So no wonder that it doesn't work on anything I tested it on. Man pages tell us to use hardware (-p)Exact same stuff. But it fetches So we're sailing uncharted waters here. Cool.I think we should maybe consider dropping these flags. They don't currently do anything in Edit: When it comes to MacOS, GNU just fetches Edit 2: This thread sylvestre linked in the source code is also interesting:https://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00053.html The discussion here mostly consists of "should these options produce an error or keep producing 'unknown'". Apparently Debian already uses a patch to remove these options entirely. The discussion resulted in a commit being made where the output of these options is not shown when it is unknown, which is where we are know. In our case I think it's best to hide them from the help page, but still have them function. I will make a PR with this change and also prevent "unknown" from being printed in the total overview like GNU. |
Uh oh!
There was an error while loading. Please reload this page.
for me
GNU uname
return correctprocessor
andhwplatform
in 3 of 5x86_64
machinescoreutils/src/uu/uname/src/uname.rs
Lines 139 to 150 in 20d071a
also here is code from
GNU uname
, it's actually do something to determine this info and not just print"unknown"
:The text was updated successfully, but these errors were encountered: