Resubmit coreutils patchset
cover Resubmit coreutils patchset
Requested changes have been made
Martin
[PATCH 1/6] coreutils: converted to autotarget
[PATCH 2/6] coreutils: changed/removed some of the configure environmental variables [PATCH 3/6] coreutils: fixed missing hostname
[PATCH 4/6] coreutils: bump to 8.5
[PATCH 5/6] coreutils: changed/removed some of the configure environmental variables [PATCH 6/6] coreutils: add uname patch
PATCH 1/6 coreutils: converted to autotarget
--- package/coreutils/coreutils.mk | 107 ++++++++++----------------------------- 1 files changed, 28 insertions(+), 79 deletions(-)
package/coreutils/coreutils.mk +28 -79
@@ -3,37 +3,21 @@ # coreutils # ############################################################# -COREUTILS_VERSION:=7.4 -COREUTILS_SOURCE:=coreutils-$(COREUTILS_VERSION).tar.gz -#COREUTILS_SITE:=ftp://alpha.gnu.org/gnu/coreutils/ -COREUTILS_SITE:=$(BR2_GNU_MIRROR)/coreutils -COREUTILS_CAT:=$(ZCAT) -COREUTILS_DIR:=$(BUILD_DIR)/coreutils-$(COREUTILS_VERSION) -COREUTILS_BINARY:=src/vdir -COREUTILS_TARGET_BINARY:=bin/vdir -BIN_PROGS:=cat chgrp chmod chown cp date dd df dir echo false hostname \ - ln ls mkdir mknod mv pwd rm rmdir vdir sleep stty sync touch true \ - uname join +COREUTILS_VERSION = 7.4 +COREUTILS_SOURCE = coreutils-$(COREUTILS_VERSION).tar.gz +COREUTILS_SITE = $(BR2_GNU_MIRROR)/coreutils -$(DL_DIR)/$(COREUTILS_SOURCE): - $(call DOWNLOAD,$(COREUTILS_SITE),$(COREUTILS_SOURCE)) - -coreutils-source: $(DL_DIR)/$(COREUTILS_SOURCE) +# If both coreutils and busybox are selected, make certain coreutils +# wins the fight over who gets to have their utils actually installed. +ifeq ($(BR2_PACKAGE_BUSYBOX),y) +COREUTILS_DEPENDENCIES = busybox +endif -$(COREUTILS_DIR)/.unpacked: $(DL_DIR)/$(COREUTILS_SOURCE) - $(COREUTILS_CAT) $(DL_DIR)/$(COREUTILS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - toolchain/patch-kernel.sh $(COREUTILS_DIR) package/coreutils/ coreutils\*.patch - $(CONFIG_UPDATE) $(COREUTILS_DIR)/build-aux - # ensure rename.m4 file is older than configure / aclocal.m4 so - # auto* isn't rerun - touch -d '1979-01-01' $(@D)/m4/rename.m4 - touch $@ +COREUTILS_BIN_PROGS = cat chgrp chmod chown cp date dd df dir echo false hostname \ + ln ls mkdir mknod mv pwd rm rmdir vdir sleep stty sync touch true \ + uname join -$(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked - (cd $(COREUTILS_DIR); rm -rf config.cache; \ - $(TARGET_CONFIGURE_OPTS) \ - $(TARGET_CONFIGURE_ARGS) \ - ac_cv_func_strtod=yes \ +COREUTILS_CONF_ENV = ac_cv_func_strtod=yes \ ac_fsusage_space=yes \ fu_cv_sys_stat_statfs2_bsize=yes \ ac_cv_func_closedir_void=no \
@@ -81,68 +65,33 @@ $(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked ac_cv_func_working_mktime=yes \ jm_cv_func_working_re_compile_pattern=yes \ ac_use_included_regex=no \ - gl_cv_c_restrict=no \ - ./configure $(QUIET) \ - --target=$(GNU_TARGET_NAME) \ - --host=$(GNU_TARGET_NAME) \ - --build=$(GNU_HOST_NAME) \ - --prefix=/usr \ - --exec-prefix=/usr \ - --bindir=/usr/bin \ - --sbindir=/usr/sbin \ - --libdir=/lib \ - --libexecdir=/usr/lib \ - --sysconfdir=/etc \ - --datadir=/usr/share \ - --localstatedir=/var \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - $(DISABLE_NLS) \ - $(DISABLE_LARGEFILE) \ - --disable-rpath \ - --disable-dependency-tracking \ - ) - touch $@ + gl_cv_c_restrict=no -$(COREUTILS_DIR)/$(COREUTILS_BINARY): $(COREUTILS_DIR)/.configured - $(MAKE) -C $(COREUTILS_DIR) - rm -f $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY) +COREUTILS_CONF_OPT = --disable-rpath \ + --disable-dependency-tracking -$(TARGET_DIR)/$(COREUTILS_TARGET_BINARY): $(COREUTILS_DIR)/$(COREUTILS_BINARY) - $(MAKE) DESTDIR=$(TARGET_DIR) CC="$(TARGET_CC)" -C $(COREUTILS_DIR) install +define COREUTILS_TOUCH_RENAME_M4 + # ensure rename.m4 file is older than configure / aclocal.m4 so + # auto* isn't rerun + touch -d '1979-01-01' $(@D)/m4/rename.m4 +endef + +COREUTILS_POST_PATCH_HOOKS += COREUTILS_TOUCH_RENAME_M4 + +define COREUTILS_POST_INSTALL # some things go in root rather than usr - for f in $(BIN_PROGS); do \ + for f in $(COREUTILS_BIN_PROGS); do \ mv $(TARGET_DIR)/usr/bin/$$f $(TARGET_DIR)/bin/$$f; \ done # link for archaic shells ln -fs test $(TARGET_DIR)/usr/bin/[ # gnu thinks chroot is in bin, debian thinks it's in sbin mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin/chroot - $(STRIPCMD) $(TARGET_DIR)/usr/sbin/chroot > /dev/null 2>&1 - rm -rf $(TARGET_DIR)/share/locale +endef -# If both coreutils and busybox are selected, make certain coreutils -# wins the fight over who gets to have their utils actually installed. -ifeq ($(BR2_PACKAGE_BUSYBOX),y) -coreutils: busybox $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY) -else -coreutils: $(TARGET_DIR)/$(COREUTILS_TARGET_BINARY) -endif +COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_POST_INSTALL # If both coreutils and busybox are selected, the corresponding applets # may need to be reinstated by the clean targets. -coreutils-clean: - $(MAKE) DESTDIR=$(TARGET_DIR) CC="$(TARGET_CC)" -C $(COREUTILS_DIR) uninstall - -$(MAKE) -C $(COREUTILS_DIR) clean -coreutils-dirclean: - rm -rf $(COREUTILS_DIR) - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_PACKAGE_COREUTILS),y) -TARGETS+=coreutils -endif +$(eval $(call AUTOTARGETS,package,coreutils))
Signature · 1 line
1.7.3
PATCH 2/6 coreutils: changed/removed some of the configure environmental variables
In reply to Martin Bankyac_cv_func_closedir_void=no - no longer used
ac_cv_func_fnmatch_gnu=yes - no longer used
ac_cv_func_getcwd_null=yes - duplicate of gl_cv_func_getcwd_null ac_cv_func_mkstemp=yes - changed to gl_cv_func_working_mkstemp ac_cv_func_stat_empty_string_bug=no - no longer used ac_cv_func_utime_null=yes - no longer used
ac_cv_have_decl_euidaccess=no - no longer used
ac_cv_have_decl_nanosleep=yes - no longer used
ac_cv_struct_st_mtim_nsec=no - no longer used
am_cv_func_working_getline=yes - duplicate
am_getline_needs_run_time_check=no - changed to gl_getline_needs_run_time_check gl_cv_c_restrict=no - changed to ac_cv_c_restrict gl_cv_func_mkstemp_limitations=no - no longer used gl_cv_func_working_readdir=yes - no longer used jm_ac_cv_func_link_follows_symlink=no - changed to gl_ac_cv_func_link_follows_symlink jm_cv_func_gettimeofday_clobber=no - changed to gl_cv_func_gettimeofday_clobber jm_cv_func_nanosleep_works=yes - no longer used
jm_cv_func_svid_putenv=yes - changed to gl_cv_func_svid_putenv jm_cv_func_working_re_compile_pattern=yes - changed to gl_cv_func_re_compile_pattern_working utils_cv_func_mkdir_trailing_slash_bug=no - duplicate of gl_cv_func_mkdir_trailing_slash_bug utils_cv_func_mkstemp_limitations=no - duplicate of gl_cv_func_mkstemp_limitations
--- package/coreutils/coreutils.mk | 66 ++++++++++++++++------------------------ 1 files changed, 26 insertions(+), 40 deletions(-)
package/coreutils/coreutils.mk +26 -40
@@ -17,55 +17,41 @@ COREUTILS_BIN_PROGS = cat chgrp chmod chown cp date dd df dir echo false hostnam ln ls mkdir mknod mv pwd rm rmdir vdir sleep stty sync touch true \ uname join -COREUTILS_CONF_ENV = ac_cv_func_strtod=yes \ - ac_fsusage_space=yes \ - fu_cv_sys_stat_statfs2_bsize=yes \ - ac_cv_func_closedir_void=no \ - ac_cv_func_getloadavg=no \ - ac_cv_lib_util_getloadavg=no \ - ac_cv_lib_getloadavg_getloadavg=no \ - ac_cv_func_getgroups=yes \ - ac_cv_func_getgroups_works=yes \ +COREUTILS_CONF_ENV = ac_cv_c_restrict=no \ ac_cv_func_chown_works=yes \ - ac_cv_have_decl_euidaccess=no \ ac_cv_func_euidaccess=no \ - ac_cv_have_decl_strnlen=yes \ - ac_cv_func_strnlen_working=yes \ + ac_cv_func_getdelim=yes \ + ac_cv_func_getgroups=yes \ + ac_cv_func_getgroups_works=yes \ + ac_cv_func_getloadavg=no \ ac_cv_func_lstat_dereferences_slashed_symlink=yes \ ac_cv_func_lstat_empty_string_bug=no \ - ac_cv_func_stat_empty_string_bug=no \ - gl_cv_func_rename_trailing_slash_bug=no \ - ac_cv_have_decl_nanosleep=yes \ - jm_cv_func_nanosleep_works=yes \ - gl_cv_func_working_utimes=yes \ - ac_cv_func_utime_null=yes \ - ac_cv_have_decl_strerror_r=yes \ ac_cv_func_strerror_r_char_p=no \ - jm_cv_func_svid_putenv=yes \ - ac_cv_func_getcwd_null=yes \ - ac_cv_func_getdelim=yes \ - ac_cv_func_mkstemp=yes \ - utils_cv_func_mkstemp_limitations=no \ - utils_cv_func_mkdir_trailing_slash_bug=no \ - gl_cv_func_rename_dest_exists_bug=no \ - jm_cv_func_gettimeofday_clobber=no \ + ac_cv_func_strnlen_working=yes \ + ac_cv_func_strtod=yes \ + ac_cv_func_working_mktime=yes \ + ac_cv_have_decl_strerror_r=yes \ + ac_cv_have_decl_strnlen=yes \ + ac_cv_lib_getloadavg_getloadavg=no \ + ac_cv_lib_util_getloadavg=no \ + ac_fsusage_space=yes \ + ac_use_included_regex=no \ am_cv_func_working_getline=yes \ - gl_cv_func_working_readdir=yes \ - jm_ac_cv_func_link_follows_symlink=no \ - utils_cv_localtime_cache=no \ - ac_cv_struct_st_mtim_nsec=no \ - gl_cv_func_tzset_clobber=no \ + fu_cv_sys_stat_statfs2_bsize=yes \ + gl_ac_cv_func_link_follows_symlink=no \ gl_cv_func_getcwd_null=yes \ gl_cv_func_getcwd_path_max=yes \ - ac_cv_func_fnmatch_gnu=yes \ - am_getline_needs_run_time_check=no \ - am_cv_func_working_getline=yes \ + gl_cv_func_gettimeofday_clobber=no \ gl_cv_func_mkdir_trailing_slash_bug=no \ - gl_cv_func_mkstemp_limitations=no \ - ac_cv_func_working_mktime=yes \ - jm_cv_func_working_re_compile_pattern=yes \ - ac_use_included_regex=no \ - gl_cv_c_restrict=no + gl_cv_func_re_compile_pattern_working=yes \ + gl_cv_func_rename_dest_exists_bug=no \ + gl_cv_func_rename_trailing_slash_bug=no \ + gl_cv_func_svid_putenv=yes \ + gl_cv_func_tzset_clobber=no \ + gl_cv_func_working_mkstemp=yes \ + gl_cv_func_working_utimes=yes \ + gl_getline_needs_run_time_check=no \ + utils_cv_localtime_cache=no COREUTILS_CONF_OPT = --disable-rpath \ --disable-dependency-tracking
Signature · 1 line
1.7.3
PATCH 3/6 coreutils: fixed missing hostname
In reply to Martin Bankyhostname is no longer installed by default (ChangeLog-2007 - 2007-08-28), and has to be enabled with --enable-install-program=hostname. hostname's man file is not included, and because of this, during make, help2man is run against src/hostname to generate it's man file. src/hostname will not run on the host system, causing the build to fail.
Generated the hostname man file, after building coreutils on the host system, and generated this patch, which fixes the build error.
--- package/coreutils/coreutils-7.4-hostname-man.patch | 51 ++++++++++++++++++++ package/coreutils/coreutils.mk | 3 +- 2 files changed, 53 insertions(+), 1 deletions(-) create mode 100644 package/coreutils/coreutils-7.4-hostname-man.patch
package/coreutils/coreutils-7.4-hostname-man.patch new file +51 -0
@@ -0,0 +1,51 @@ +--- /dev/null 2010-09-18 00:21:07.280000001 -0700 ++++ b/man/hostname.1 2010-09-23 12:08:06.000000000 -0700 +@@ -0,0 +1,48 @@ ++.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. ++.TH HOSTNAME "1" "September 2010" "GNU coreutils 7.4" "User Commands" ++.SH NAME ++hostname \- set or print the name of the current host system ++.SH SYNOPSIS ++.B hostname ++[\fINAME\fR] ++.br ++.B hostname ++\fIOPTION\fR ++.SH DESCRIPTION ++.\" Add any additional description here ++.PP ++Print or set the hostname of the current system. ++.TP ++\fB\-\-help\fR ++display this help and exit ++.TP ++\fB\-\-version\fR ++output version information and exit ++.SH AUTHOR ++Written by Jim Meyering. ++.SH "REPORTING BUGS" ++Report hostname bugs to bug\-coreutils at gnu.org ++.br ++GNU coreutils home page: <http://www.gnu.org/software/coreutils/> ++.br ++General help using GNU software: <http://www.gnu.org/gethelp/> ++.br ++Report hostname translation bugs to <http://translationproject.org/team/> ++.SH COPYRIGHT ++Copyright \(co 2010 Free Software Foundation, Inc. ++License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. ++.br ++This is free software: you are free to change and redistribute it. ++There is NO WARRANTY, to the extent permitted by law. ++.SH "SEE ALSO" ++The full documentation for ++.B hostname ++is maintained as a Texinfo manual. If the ++.B info ++and ++.B hostname ++programs are properly installed at your site, the command ++.IP ++.B info coreutils \(aqhostname invocation\(aq ++.PP ++should give you access to the complete manual.
package/coreutils/coreutils.mk +2 -1
@@ -54,7 +54,8 @@ COREUTILS_CONF_ENV = ac_cv_c_restrict=no \ utils_cv_localtime_cache=no COREUTILS_CONF_OPT = --disable-rpath \ - --disable-dependency-tracking + --disable-dependency-tracking \ + --enable-install-program=hostname define COREUTILS_TOUCH_RENAME_M4 # ensure rename.m4 file is older than configure / aclocal.m4 so
Signature · 1 line
1.7.3
PATCH 4/6 coreutils: bump to 8.5
In reply to Martin Banky--- package/coreutils/coreutils-7.4-hostname-man.patch | 51 -------------------- .../coreutils/coreutils-7.4-rename-m4-fix.patch | 44 ----------------- package/coreutils/coreutils-8.5-hostname-man.patch | 51 ++++++++++++++++++++ package/coreutils/coreutils.mk | 10 +---- 4 files changed, 52 insertions(+), 104 deletions(-) delete mode 100644 package/coreutils/coreutils-7.4-hostname-man.patch delete mode 100644 package/coreutils/coreutils-7.4-rename-m4-fix.patch create mode 100644 package/coreutils/coreutils-8.5-hostname-man.patch
package/coreutils/coreutils-7.4-hostname-man.patch deleted +0 -51
@@ -1,51 +0,0 @@ ---- /dev/null 2010-09-18 00:21:07.280000001 -0700 -+++ b/man/hostname.1 2010-09-23 12:08:06.000000000 -0700 -@@ -0,0 +1,48 @@ -+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -+.TH HOSTNAME "1" "September 2010" "GNU coreutils 7.4" "User Commands" -+.SH NAME -+hostname \- set or print the name of the current host system -+.SH SYNOPSIS -+.B hostname -+[\fINAME\fR] -+.br -+.B hostname -+\fIOPTION\fR -+.SH DESCRIPTION -+.\" Add any additional description here -+.PP -+Print or set the hostname of the current system. -+.TP -+\fB\-\-help\fR -+display this help and exit -+.TP -+\fB\-\-version\fR -+output version information and exit -+.SH AUTHOR -+Written by Jim Meyering. -+.SH "REPORTING BUGS" -+Report hostname bugs to bug\-coreutils at gnu.org -+.br -+GNU coreutils home page: <http://www.gnu.org/software/coreutils/> -+.br -+General help using GNU software: <http://www.gnu.org/gethelp/> -+.br -+Report hostname translation bugs to <http://translationproject.org/team/> -+.SH COPYRIGHT -+Copyright \(co 2010 Free Software Foundation, Inc. -+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. -+.br -+This is free software: you are free to change and redistribute it. -+There is NO WARRANTY, to the extent permitted by law. -+.SH "SEE ALSO" -+The full documentation for -+.B hostname -+is maintained as a Texinfo manual. If the -+.B info -+and -+.B hostname -+programs are properly installed at your site, the command -+.IP -+.B info coreutils \(aqhostname invocation\(aq -+.PP -+should give you access to the complete manual.
package/coreutils/coreutils-7.4-rename-m4-fix.patch deleted +0 -44
44 lines not on this page · raw message
package/coreutils/coreutils-8.5-hostname-man.patch new file +51 -0
51 lines not on this page · raw message
package/coreutils/coreutils.mk +1 -9
@@ -3,7 +3,7 @@ # coreutils # ############################################################# -COREUTILS_VERSION = 7.4 +COREUTILS_VERSION = 8.5 COREUTILS_SOURCE = coreutils-$(COREUTILS_VERSION).tar.gz COREUTILS_SITE = $(BR2_GNU_MIRROR)/coreutils
@@ -57,14 +57,6 @@ COREUTILS_CONF_OPT = --disable-rpath \ --disable-dependency-tracking \ --enable-install-program=hostname -define COREUTILS_TOUCH_RENAME_M4 - # ensure rename.m4 file is older than configure / aclocal.m4 so - # auto* isn't rerun - touch -d '1979-01-01' $(@D)/m4/rename.m4 -endef - -COREUTILS_POST_PATCH_HOOKS += COREUTILS_TOUCH_RENAME_M4 - define COREUTILS_POST_INSTALL # some things go in root rather than usr for f in $(COREUTILS_BIN_PROGS); do \
Signature · 1 line
1.7.3
PATCH 5/6 coreutils: changed/removed some of the configure environmental variables
In reply to Martin Bankygl_ac_cv_func_link_follows_symlink=no - changed to gl_cv_func_link_follows_symlink gl_cv_func_mkdir_trailing_slash_bug=no - no longer used gl_cv_func_rename_dest_exists_bug=no - no longer used gl_cv_func_rename_trailing_slash_bug=no - no longer used
--- package/coreutils/coreutils.mk | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
package/coreutils/coreutils.mk +1 -4
@@ -38,14 +38,11 @@ COREUTILS_CONF_ENV = ac_cv_c_restrict=no \ ac_use_included_regex=no \ am_cv_func_working_getline=yes \ fu_cv_sys_stat_statfs2_bsize=yes \ - gl_ac_cv_func_link_follows_symlink=no \ gl_cv_func_getcwd_null=yes \ gl_cv_func_getcwd_path_max=yes \ gl_cv_func_gettimeofday_clobber=no \ - gl_cv_func_mkdir_trailing_slash_bug=no \ + gl_cv_func_link_follows_symlink=no \ gl_cv_func_re_compile_pattern_working=yes \ - gl_cv_func_rename_dest_exists_bug=no \ - gl_cv_func_rename_trailing_slash_bug=no \ gl_cv_func_svid_putenv=yes \ gl_cv_func_tzset_clobber=no \ gl_cv_func_working_mkstemp=yes \
Signature · 1 line
1.7.3
PATCH 6/6 coreutils: add uname patch
In reply to Martin BankyOn linux platforms, grok /proc/cpuinfo for the CPU/vendor info.
--- package/coreutils/coreutils-8.5-uname.patch | 173 +++++++++++++++++++++++++++ package/coreutils/coreutils.mk | 8 ++ 2 files changed, 181 insertions(+), 0 deletions(-) create mode 100644 package/coreutils/coreutils-8.5-uname.patch
package/coreutils/coreutils-8.5-uname.patch new file +173 -0
@@ -0,0 +1,173 @@ +On linux platforms, grok /proc/cpuinfo for the CPU/vendor info. + +Prob not suitable for upstream seeing as how it's 100% linux-specific +http://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html + +Patch originally by Carlos E. Gorges <[email protected]>, but +heavily reworked to suck less. + +To add support for additional platforms, check out the show_cpuinfo() +func in the linux/arch/<ARCH>/ source tree of the kernel. + +--- coreutils/src/uname.c ++++ coreutils/src/uname.c +@@ -50,6 +50,11 @@ + # include <mach-o/arch.h> + #endif + ++#if defined(__linux__) ++# define USE_PROCINFO ++# define UNAME_HARDWARE_PLATFORM ++#endif ++ + #include "system.h" + #include "error.h" + #include "quote.h" +@@ -138,6 +143,117 @@ + exit (status); + } + ++#if defined(USE_PROCINFO) ++ ++# if defined(__s390__) || defined(__s390x__) ++# define CPUINFO_FILE "/proc/sysinfo" ++# define CPUINFO_FORMAT "%64[^\t :]%*[ :]%256[^\n]%c" ++# else ++# define CPUINFO_FILE "/proc/cpuinfo" ++# define CPUINFO_FORMAT "%64[^\t:]\t:%256[^\n]%c" ++# endif ++ ++# define PROCINFO_PROCESSOR 0 ++# define PROCINFO_HARDWARE_PLATFORM 1 ++ ++static void __eat_cpuinfo_space(char *buf) ++{ ++ /* first eat trailing space */ ++ char *tmp = buf + strlen(buf) - 1; ++ while (tmp > buf && isspace(*tmp)) ++ *tmp-- = '\0'; ++ /* then eat leading space */ ++ tmp = buf; ++ while (*tmp && isspace(*tmp)) ++ tmp++; ++ if (tmp != buf) ++ memmove(buf, tmp, strlen(tmp)+1); ++ /* finally collapse whitespace */ ++ tmp = buf; ++ while (tmp[0] && tmp[1]) { ++ if (isspace(tmp[0]) && isspace(tmp[1])) { ++ memmove(tmp, tmp+1, strlen(tmp)); ++ continue; ++ } ++ ++tmp; ++ } ++} ++ ++static int __linux_procinfo(int x, char *fstr, size_t s) ++{ ++ FILE *fp; ++ ++ char *procinfo_keys[] = { ++ /* --processor --hardware-platform */ ++ #if defined(__alpha__) ++ "cpu model", "system type" ++ #elif defined(__arm__) ++ "Processor", "Hardware" ++ #elif defined(__avr32__) ++ "processor", "cpu family" ++ #elif defined(__bfin__) ++ "CPU", "BOARD Name" ++ #elif defined(__cris__) ++ "cpu", "cpu model" ++ #elif defined(__frv__) ++ "CPU-Core", "System" ++ #elif defined(__i386__) || defined(__x86_64__) ++ "model name", "vendor_id" ++ #elif defined(__ia64__) ++ "family", "vendor" ++ #elif defined(__hppa__) ++ "cpu", "model" ++ #elif defined(__m68k__) ++ "CPU", "MMU" ++ #elif defined(__mips__) ++ "cpu model", "system type" ++ #elif defined(__powerpc__) || defined(__powerpc64__) ++ "cpu", "machine" ++ #elif defined(__s390__) || defined(__s390x__) ++ "Type", "Manufacturer" ++ #elif defined(__sh__) ++ "cpu type", "machine" ++ #elif defined(sparc) || defined(__sparc__) ++ "type", "cpu" ++ #elif defined(__vax__) ++ "cpu type", "cpu" ++ #else ++ "unknown", "unknown" ++ #endif ++ }; ++ ++ if ((fp = fopen(CPUINFO_FILE, "r")) != NULL) { ++ char key[65], value[257], eol, *ret = NULL; ++ ++ while (fscanf(fp, CPUINFO_FORMAT, key, value, &eol) != EOF) { ++ __eat_cpuinfo_space(key); ++ if (!strcmp(key, procinfo_keys[x])) { ++ __eat_cpuinfo_space(value); ++ ret = value; ++ break; ++ } ++ if (eol != '\n') { ++ /* we need two fscanf's here in case the previous ++ * length limit caused us to read right up to the ++ * newline ... doing "%*[^\n]\n" wont eat the newline ++ */ ++ fscanf(fp, "%*[^\n]"); ++ fscanf(fp, "\n"); ++ } ++ } ++ fclose(fp); ++ ++ if (ret) { ++ strncpy(fstr, ret, s); ++ return 0; ++ } ++ } ++ ++ return -1; ++} ++ ++#endif ++ + /* Print ELEMENT, preceded by a space if something has already been + printed. */ + +@@ -250,10 +344,14 @@ main (int argc, char **argv) + if (toprint & PRINT_PROCESSOR) + { + char const *element = unknown; +-#if HAVE_SYSINFO && defined SI_ARCHITECTURE ++#if ( HAVE_SYSINFO && defined SI_ARCHITECTURE ) || defined(USE_PROCINFO) + { + static char processor[257]; ++#if defined(USE_PROCINFO) ++ if (0 <= __linux_procinfo (PROCINFO_PROCESSOR, processor, sizeof processor)) ++#else + if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) ++#endif + element = processor; + } + #endif +@@ -306,9 +404,13 @@ main (int argc, char **argv) + if (element == unknown) + { + static char hardware_platform[257]; ++#if defined(USE_PROCINFO) ++ if (0 <= __linux_procinfo (PROCINFO_HARDWARE_PLATFORM, hardware_platform, sizeof hardware_platform)) ++#else + size_t s = sizeof hardware_platform; + static int mib[] = { CTL_HW, UNAME_HARDWARE_PLATFORM }; + if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0) ++#endif + element = hardware_platform; + } + #endif
package/coreutils/coreutils.mk +8 -0
@@ -54,6 +54,14 @@ COREUTILS_CONF_OPT = --disable-rpath \ --disable-dependency-tracking \ --enable-install-program=hostname +define COREUTILS_TOUCH_UNAME_C + # ensure uname.c file's timestamp does not change, + # so help2man does not run + touch -d '2010-01-01' $(@D)/src/uname.c +endef + +COREUTILS_POST_PATCH_HOOKS += COREUTILS_TOUCH_UNAME_C + define COREUTILS_POST_INSTALL # some things go in root rather than usr for f in $(COREUTILS_BIN_PROGS); do \
Signature · 1 line
1.7.3
cover Resubmit coreutils patchset
In reply to Martin BankyQuoted 10 lines · Martin Banky
Requested changes have been made
Martin
[PATCH 1/6] coreutils: converted to autotarget
[PATCH 2/6] coreutils: changed/removed some of the configure environmental variables [PATCH 3/6] coreutils: fixed missing hostname
[PATCH 4/6] coreutils: bump to 8.5
[PATCH 5/6] coreutils: changed/removed some of the configure environmental variables [PATCH 6/6] coreutils: add uname patch
Aged but not forgotten :)
cover Resubmit coreutils patchset
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Gustavo" == Gustavo Zacarias <[email protected]> writes:
Quoted 10 lines · Martin Banky
Quoted 10 lines
Requested changes have been made
Martin
[PATCH 1/6] coreutils: converted to autotarget
[PATCH 2/6] coreutils: changed/removed some of the configure environmental variables [PATCH 3/6] coreutils: fixed missing hostname
[PATCH 4/6] coreutils: bump to 8.5
[PATCH 5/6] coreutils: changed/removed some of the configure environmental variables [PATCH 6/6] coreutils: add uname patch
Gustavo> Acked-by: Gustavo Zacarias <[email protected]>
Gustavo> Aged but not forgotten :)
Committed entire series, thanks both.
Signature · 1 line
Bye, Peter Korsgaard