681ee7d49f
- Update to 8.26 (for details see included NEWS file) - coreutils.spec (%description): Add b2sum, a new utility. (BuildRequires): Add timezone to enable new 'date-debug.sh' test. - coreutils-i18n.patch: Sync I18N patch from Fedora, as the diff for the old i18n implementation of expand/unexpand has become unmaintainable: git://pkgs.fedoraproject.org/coreutils.git - Remove now-upstream patches: * coreutils-df-hash-in-filter.patch * coreutils-diagnose-fts-readdir-failure.patch * coreutils-m5sum-sha-sum-fix-ignore-missing-with-00-checksums.patch * coreutils-maint-fix-dependency-of-man-arch.1.patch - Refresh/merge all other patches: * coreutils-invalid-ids.patch * coreutils-ocfs2_reflinks.patch * coreutils-remove_hostname_documentation.patch * coreutils-remove_kill_documentation.patch * coreutils-skip-gnulib-test-tls.patch * coreutils-sysinfo.patch * coreutils-tests-shorten-extreme-factor-tests.patch OBS-URL: https://build.opensuse.org/request/show/443228 OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=278
65 lines
1.8 KiB
Diff
65 lines
1.8 KiB
Diff
---
|
|
src/uname.c | 42 ++++++++++++++++++++++++++++++++++++++++++
|
|
1 file changed, 42 insertions(+)
|
|
|
|
Index: src/uname.c
|
|
===================================================================
|
|
--- src/uname.c.orig
|
|
+++ src/uname.c
|
|
@@ -338,6 +338,36 @@ main (int argc, char **argv)
|
|
# endif
|
|
}
|
|
#endif
|
|
+ if (element == unknown)
|
|
+ {
|
|
+ struct utsname name;
|
|
+ static char processor[sizeof (name.machine)];
|
|
+ if (uname (&name) != 0)
|
|
+ error (EXIT_FAILURE, errno, _("cannot get system name"));
|
|
+ strcpy (processor, name.machine);
|
|
+ element = processor;
|
|
+#ifdef __linux__
|
|
+ if (!strcmp (element, "i686"))
|
|
+ {
|
|
+ /* Check for Athlon */
|
|
+ char line[1024];
|
|
+ FILE *f = fopen ("/proc/cpuinfo", "r");
|
|
+ if (f)
|
|
+ {
|
|
+ while (fgets (line, sizeof (line), f) > 0)
|
|
+ {
|
|
+ if (strncmp (line, "vendor_id", 9) == 0)
|
|
+ {
|
|
+ if (strstr (line, "AuthenticAMD"))
|
|
+ element = "athlon";
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+ fclose (f);
|
|
+ }
|
|
+ }
|
|
+#endif
|
|
+ }
|
|
if (! (toprint == UINT_MAX && element == unknown))
|
|
print_element (element);
|
|
}
|
|
@@ -363,6 +393,18 @@ main (int argc, char **argv)
|
|
element = hardware_platform;
|
|
}
|
|
#endif
|
|
+ if (element == unknown)
|
|
+ {
|
|
+ struct utsname name;
|
|
+ static char hardware_platform[sizeof (name.machine)];
|
|
+ if (uname (&name) != 0)
|
|
+ error (EXIT_FAILURE, errno, _("cannot get system name"));
|
|
+ strcpy (hardware_platform, name.machine);
|
|
+ if (hardware_platform[0] == 'i' && hardware_platform[2] == '8'
|
|
+ && hardware_platform[3] == '6' && hardware_platform[4] == 0)
|
|
+ hardware_platform[1] = '3';
|
|
+ element = hardware_platform;
|
|
+ }
|
|
if (! (toprint == UINT_MAX && element == unknown))
|
|
print_element (element);
|
|
}
|