Skip to content

uname: Map machine architecture to processor type (rebased)#10518

Open
naoNao89 wants to merge 1 commit intouutils:mainfrom
naoNao89:uname-processor-type-mapping
Open

uname: Map machine architecture to processor type (rebased)#10518
naoNao89 wants to merge 1 commit intouutils:mainfrom
naoNao89:uname-processor-type-mapping

Conversation

@naoNao89
Copy link
Contributor

Rebased from latest upstream. This combines the OsString improvements with the new map_processor() function that properly maps machine architectures (arm64, aarch64, x86_64, etc.) to processor types instead of returning "unknown".

Fixes #8659 where uname -p broke kdump-tools and other packages.

Reopen #8842

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/env/env-signal-handler is now passing!

@oech3
Copy link
Contributor

oech3 commented Jan 27, 2026

Please make a different flag. This is not compat with gnu.

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)

@collinfunk
Copy link

Fixes #8659 where uname -p broke kdump-tools and other packages.

Just to reiterate, there was no issue with any implementation of uname -p.

Canonical wrote a patch to kdump-tools [1] that relied on the behavior of their patch to GNU Coreutils [2]. They should have just used uname -m in the first place.

[1] https://launchpad.net/ubuntu/+source/kdump-tools/1:1.10.7ubuntu1
[2] https://git.launchpad.net/ubuntu/+source/coreutils/tree/debian/patches/80_fedora_sysinfo.patch?h=ubuntu/noble

@naoNao89
Copy link
Contributor Author

hmm they are non-standard extensions. POSIX defines only these options: -a, -m, -n, -r, -s, -v.but-p (processor) and -i (hardware platform) are not part of POSIX

@naoNao89 naoNao89 force-pushed the uname-processor-type-mapping branch from 3fc489f to 02ae4b3 Compare January 28, 2026 21:44
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@naoNao89 naoNao89 force-pushed the uname-processor-type-mapping branch from 02ae4b3 to bfd68ef Compare January 29, 2026 14:19
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/basenc/bounded-memory is now passing!

@naoNao89
Copy link
Contributor Author

  1. Ubuntu has patched GNU coreutils since 2009 (16+ years of proven demand)
  2. Maintainer already approved the concept in uname: return processor type instead of "unknown" #8842
  3. uutils aims to replace GNU in real deployments: on Ubuntu, uname -p returns real values
  4. Non-POSIX flags: no "correct" behavior exists, we should choose the useful one
  5. macOS already returns meaningful -p values
  6. Minimal code and maximum benefit just ~10 line

The Fedora reversion isn't relevant here, they wanted vanilla GNU alignment but uutils is free to make independent pragmatic choices

@oech3
Copy link
Contributor

oech3 commented Jan 30, 2026

Ubuntu should fix kdump-tools or maintain its own uutils patch.
Vanilla uutils should not be incompat deliberately.

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/tty/tty-eof (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/printf/printf-surprise is now being skipped but was previously passing.

@sylvestre
Copy link
Contributor

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/pr/bounded-memory is no longer failing!

@oech3
Copy link
Contributor

oech3 commented Feb 15, 2026

It seems this is already fixed at kdump-tools side.

@naoNao89 naoNao89 force-pushed the uname-processor-type-mapping branch 3 times, most recently from 19fa797 to 9a51485 Compare February 16, 2026 08:49
@github-actions
Copy link

GNU testsuite comparison:

Note: The gnu test tests/basenc/bounded-memory is now being skipped but was previously passing.

@naoNao89 naoNao89 force-pushed the uname-processor-type-mapping branch from 9a51485 to 07418f0 Compare February 16, 2026 14:11
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/cut/bounded-memory. tests/cut/bounded-memory is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/date/resolution. tests/date/resolution is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/rm/many-dir-entries-vs-OOM is now passing!
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

@naoNao89 naoNao89 force-pushed the uname-processor-type-mapping branch from 07418f0 to 7027792 Compare February 16, 2026 14:24
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/io-errors. tests/misc/io-errors is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/symlink (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/rm/many-dir-entries-vs-OOM is now passing!
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

@naoNao89 naoNao89 force-pushed the uname-processor-type-mapping branch from 7027792 to 60c9737 Compare February 16, 2026 14:36
Add map_processor() function to properly map machine architectures
(arm64, aarch64, x86_64, etc.) to processor types instead of returning
"unknown". This fixes uutils#8659 where 'uname -p' broke kdump-tools and
other packages that depend on processor type information.

Architecture mappings:
- ARM: arm64, aarch64, arm, armv7l, armv8l, armv7, armv8 -> arm
- x86: x86_64, amd64 -> x86_64; i386, i486, i586, i686 -> i386
- PowerPC: ppc, ppc64, ppc64le, ppc32 -> powerpc
- RISC-V: riscv32, riscv64 -> riscv
- SPARC: sparc, sparc64 -> sparc
- MIPS: mips, mipsel, mips64, mips64el -> mips
@naoNao89 naoNao89 force-pushed the uname-processor-type-mapping branch from 60c9737 to 67bf98d Compare February 16, 2026 14:43
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/misc/io-errors is no longer failing!
Note: The gnu test tests/expand/bounded-memory is now being skipped but was previously passing.

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.

uname -p should return arch

4 participants