forked from microsoft/azurelinux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
coreutils - add patch to fix uname (microsoft#9420)
- Loading branch information
Showing
6 changed files
with
84 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
From e92876a5257bc762eb61c2f12f0338be493ab939 Mon Sep 17 00:00:00 2001 | ||
From: Rachel Menge <[email protected]> | ||
Date: Wed, 29 May 2024 22:27:32 +0000 | ||
Subject: [PATCH] coreutils-9.4 uname patch for -i and -p | ||
|
||
Original commit info: | ||
|
||
Submitted by: William Immendorf <[email protected]> | ||
Date: 2010-05-08 | ||
Inital Package Version: 8.5 | ||
Origin: http://cvs.fedoraproject.org/viewvc/devel/coreutils/coreutils-8.2-uname-processortype.patch | ||
Upstream Status: Rejected | ||
Description: Fixes the output of uname's -i and -p parameters | ||
--- | ||
src/uname.c | 18 ++++++++++++++++-- | ||
1 file changed, 16 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/uname.c b/src/uname.c | ||
index 883b9a4..78641bf 100644 | ||
--- a/src/uname.c | ||
+++ b/src/uname.c | ||
@@ -313,7 +313,7 @@ main (int argc, char **argv) | ||
|
||
if (toprint & PRINT_PROCESSOR) | ||
{ | ||
- char const *element = unknown; | ||
+ char *element = unknown; | ||
#ifdef __APPLE__ | ||
# if defined __arm__ || defined __arm64__ | ||
element = "arm"; | ||
@@ -330,6 +330,12 @@ main (int argc, char **argv) | ||
if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) | ||
element = processor; | ||
} | ||
+#else | ||
+ { | ||
+ struct utsname u; | ||
+ uname(&u); | ||
+ element = u.machine; | ||
+ } | ||
#endif | ||
#ifdef UNAME_PROCESSOR | ||
if (element == unknown) | ||
@@ -347,7 +353,7 @@ main (int argc, char **argv) | ||
|
||
if (toprint & PRINT_HARDWARE_PLATFORM) | ||
{ | ||
- char const *element = unknown; | ||
+ char *element = unknown; | ||
#if HAVE_SYSINFO && defined SI_PLATFORM | ||
{ | ||
static char hardware_platform[257]; | ||
@@ -355,6 +361,14 @@ main (int argc, char **argv) | ||
hardware_platform, sizeof hardware_platform)) | ||
element = hardware_platform; | ||
} | ||
+#else | ||
+ { | ||
+ struct utsname u; | ||
+ uname(&u); | ||
+ element = u.machine; | ||
+ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6') | ||
+ element[1]='3'; | ||
+ } | ||
#endif | ||
#ifdef UNAME_HARDWARE_PLATFORM | ||
if (element == unknown) | ||
-- | ||
2.34.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Summary: Basic system utilities | ||
Name: coreutils | ||
Version: 9.4 | ||
Release: 2%{?dist} | ||
Release: 3%{?dist} | ||
License: GPLv3 | ||
Vendor: Microsoft Corporation | ||
Distribution: Azure Linux | ||
|
@@ -11,6 +11,7 @@ Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz | |
# make this package to own serial console profile since it utilizes stty tool | ||
Source1: serial-console.sh | ||
Patch0: coreutils-9.4-i18n-1.patch | ||
Patch1: coreutils-9.4-uname-1.patch | ||
BuildRequires: libselinux-devel | ||
BuildRequires: libselinux-utils | ||
Requires: gmp | ||
|
@@ -91,6 +92,9 @@ LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 make -k check | |
%defattr(-,root,root) | ||
|
||
%changelog | ||
* Mon Jun 17 2024 Andrew Phelps <[email protected]> - 9.4-3 | ||
- add coreutils-9.4-uname-1.patch | ||
|
||
* Wed Mar 20 2024 Dan Streetman <[email protected]> - 9.4-2 | ||
- fix serial-console.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters