Skip to content

Correct detecting the right sdphost binary for linux#92

Merged
hathach merged 2 commits into
adafruit:masterfrom
jepler:sdphost-platform-detection
Mar 17, 2021
Merged

Correct detecting the right sdphost binary for linux#92
hathach merged 2 commits into
adafruit:masterfrom
jepler:sdphost-platform-detection

Conversation

@jepler
Copy link
Copy Markdown
Contributor

@jepler jepler commented Mar 16, 2021

On my Linux system, "uname -i" just prints "unknown". "uname -m" prints "x86_64".

@ladyada ladyada requested a review from hathach March 16, 2021 16:53
Copy link
Copy Markdown
Member

@ladyada ladyada left a comment

Choose a reason for hiding this comment

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

i think its ok but will also wait for thach to reply!

Copy link
Copy Markdown
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

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

It is odd, on my machine, both -i and -m has the same value x86_64. Accept for ?= false. I think it is good to merge

Comment thread ports/mimxrt10xx/Makefile Outdated
Copy link
Copy Markdown
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

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

perfect now

@hathach hathach merged commit 54cff8b into adafruit:master Mar 17, 2021
@jepler
Copy link
Copy Markdown
Contributor Author

jepler commented Mar 17, 2021

I researched the "why" a bit and found:

POSIX doesn't define -p or -i. In GNU coreutils they are marked as non-portable, as you indicate; the default implementation relies on two optional operating system features, the three-argument form of sysinfo(2) (from SunOS) and the six-argument form of sysctl(3) (from the BSDs; neither of which are available on Linux).

Thus on Debian and derived distributions (apart from Ubuntu and its derivatives), you simply get unknown.

On Fedora and related distributions, uname is patched to return the machine type (-m) as processor (-p) and hardware platform (-i), with the latter tweaked to produce i386 for any value of the form i?86.

On Ubuntu and derivatives, a variant of the Fedora patch is used, which additionally checks for AMD CPUs on i686 processors and produces athlon instead.

https://unix.stackexchange.com/questions/307955/uname-p-i-are-unknown

@hathach
Copy link
Copy Markdown
Member

hathach commented Mar 17, 2021

Thanks @jepler it is good reading 👍 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants