import sysfsutils-2.1.0-24.el8

This commit is contained in:
CentOS Sources 2019-08-01 14:35:32 -04:00 committed by Stepan Oksanichenko
commit 1bcaeac060
8 changed files with 3108 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
SOURCES/sysfsutils-2.1.0.tar.gz

1
.sysfsutils.metadata Normal file
View File

@ -0,0 +1 @@
b3cb316c652b09ec66f93f4ea98a93a7a1001678 SOURCES/sysfsutils-2.1.0.tar.gz

View File

@ -0,0 +1,12 @@
diff -puN lib/sysfs_class.c~sysfsutils_class_dup lib/sysfs_class.c
--- sysfsutils-2.1.0/lib/sysfs_class.c~sysfsutils_class_dup 2006-09-07 17:01:26.000000000 -0500
+++ sysfsutils-2.1.0-bjking1/lib/sysfs_class.c 2006-09-07 17:01:26.000000000 -0500
@@ -66,7 +66,7 @@ static int cdev_name_equal(void *a, void
return 0;
if (strncmp((char *)a, ((struct sysfs_class_device *)b)->name,
- strlen((char *)a)) == 0)
+ SYSFS_NAME_LEN) == 0)
return 1;
return 0;

View File

@ -0,0 +1,19 @@
diff -Nurp sysfsutils-1.2.0.bak/COPYING sysfsutils-1.2.0/COPYING
--- sysfsutils-1.2.0.bak/COPYING 2004-09-13 08:45:15.000000000 -0500
+++ sysfsutils-1.2.0/COPYING 2004-10-11 13:05:00.483795976 -0500
@@ -1,11 +1,10 @@
-The commands and utilities under the "test" directory are licensed under the
-GNU General Public License (GPL) Version 2, June 1991. The full text of the
-GPL is located at:
+The commands and utilities are licensed under the GNU General Public License
+(GPL) Version 2, June 1991. The full text of the GPL is located at:
-sysfsutils/cmd/GPL
+/usr/share/doc/sysfsutils-{version}/GPL
The sysfs library is licensed under the GNU Lesser Public License (LGPL)
Version 2.1, February 1999. The full text of the LGPL is located at:
-sysfsutils/lib/LGPL
+/usr/share/doc/sysfsutils-{version}/LGPL

View File

@ -0,0 +1,164 @@
diff -upr sysfsutils-2.1.0-old/lib/sysfs_utils.c sysfsutils-2.1.0/lib/sysfs_utils.c
--- sysfsutils-2.1.0-old/lib/sysfs_utils.c 2006-08-07 07:08:01.000000000 +0200
+++ sysfsutils-2.1.0/lib/sysfs_utils.c 2008-05-13 07:42:50.000000000 +0200
@@ -117,84 +117,104 @@ int sysfs_get_link(const char *path, cha
{
char devdir[SYSFS_PATH_MAX];
char linkpath[SYSFS_PATH_MAX];
- char temp_path[SYSFS_PATH_MAX];
- char *d = NULL, *s = NULL;
- int slashes = 0, count = 0;
+ char *d, *s;
+ int count;
if (!path || !target || len == 0) {
errno = EINVAL;
return -1;
}
- memset(devdir, 0, SYSFS_PATH_MAX);
- memset(linkpath, 0, SYSFS_PATH_MAX);
- memset(temp_path, 0, SYSFS_PATH_MAX);
- safestrcpy(devdir, path);
-
- if ((readlink(path, linkpath, SYSFS_PATH_MAX)) < 0) {
+ count = readlink(path, linkpath, SYSFS_PATH_MAX);
+ if (count < 0)
return -1;
- }
- d = linkpath;
+ else
+ linkpath[count] = '\0';
/*
* Three cases here:
* 1. relative path => format ../..
* 2. absolute path => format /abcd/efgh
* 3. relative path _from_ this dir => format abcd/efgh
*/
- switch (*d) {
- case '.':
+ if (*linkpath == '/') {
+ /* absolute path - copy as is */
+ safestrcpymax(target, linkpath, len);
+ return 0;
+ }
+
+ safestrcpy(devdir, path);
+ s = strrchr(devdir, '/');
+ if (s == NULL)
+ s = devdir - 1;
+ d = linkpath;
+ while (*d == '.') {
+ if (*(d+1) == '/') {
/*
* handle the case where link is of type ./abcd/xxx
*/
- safestrcpy(temp_path, devdir);
- if (*(d+1) == '/')
- d += 2;
- else if (*(d+1) == '.')
- goto parse_path;
- s = strrchr(temp_path, '/');
- if (s != NULL) {
- *(s+1) = '\0';
- safestrcat(temp_path, d);
- } else {
- safestrcpy(temp_path, d);
- }
- safestrcpymax(target, temp_path, len);
- break;
+ d += 2;
+ while (*d == '/')
+ d++;
+ continue;
+ } else if (*(d+1) != '.' || *(d+2) != '/')
/*
- * relative path, getting rid of leading "../.."
+ * relative path from this directory, starting
+ * with a hidden directory
*/
-parse_path:
- while (*d == '/' || *d == '.') {
- if (*d == '/')
- slashes++;
- d++;
- }
- d--;
- s = &devdir[strlen(devdir)-1];
- while (s != NULL && count != (slashes+1)) {
+ break;
+
+ /*
+ * relative path, getting rid of leading "../.."; must
+ * be careful here since any path component of devdir
+ * could be a symlink again
+ */
+ for (;;) {
+ while (s > devdir && *s == '/') {
s--;
- if (*s == '/')
- count++;
+ if (*s == '.'
+ && (s == devdir || *(s-1) == '/'))
+ s--;
}
- safestrcpymax(s, d, (SYSFS_PATH_MAX-strlen(devdir)));
- safestrcpymax(target, devdir, len);
- break;
- case '/':
- /* absolute path - copy as is */
- safestrcpymax(target, linkpath, len);
- break;
- default:
- /* relative path from this directory */
- safestrcpy(temp_path, devdir);
- s = strrchr(temp_path, '/');
- if (s != NULL) {
- *(s+1) = '\0';
- safestrcat(temp_path, linkpath);
- } else {
- safestrcpy(temp_path, linkpath);
+ *(s+1) = '\0';
+ if (*devdir == '\0' || sysfs_path_is_link(devdir))
+ /*
+ * condition will be true eventually
+ * because we already know that all
+ * but the last component of path
+ * resolve to a directory
+ */
+ break;
+ if (sysfs_get_link(devdir, devdir, SYSFS_PATH_MAX))
+ return -1;
+ s = devdir + strlen(devdir) - 1;
+ }
+ while (s >= devdir) {
+ if (*s == '/') {
+ if (*(s+1) != '.' || *(s+2) != '.'
+ || *(s+3) != '\0') {
+ d += 3;
+ while (*d == '/')
+ d++;
+ } else
+ s += 2;
+ break;
}
- safestrcpymax(target, temp_path, len);
+ s--;
+ }
+ if (s < devdir || *(s+1) == '\0')
+ break;
}
+
+ /*
+ * appending to devdir a slash and the (possibly shortened)
+ * relative path to the link source
+ */
+ s++;
+ if (s > devdir && *s == '\0')
+ *s++ = '/';
+ *s = '\0';
+ safestrcpymax(s, d, SYSFS_PATH_MAX-(s-devdir));
+ safestrcpymax(target, devdir, len);
return 0;
}

View File

@ -0,0 +1,12 @@
diff -urpN sysfsutils-2.1.0.orig/systool.1 sysfsutils-2.1.0/systool.1
--- sysfsutils-2.1.0.orig/systool.1 2011-03-22 18:15:40.775891943 +0100
+++ sysfsutils-2.1.0/systool.1 2011-03-22 18:16:05.158970786 +0100
@@ -14,7 +14,7 @@ classes, and root devices.
.P
When
.I device
-is supplied, the information reqested by
+is supplied, the information requested by
.I options
is shown only for the specified device, otherwise all present devices
are displayed.

File diff suppressed because it is too large Load Diff

217
SPECS/sysfsutils.spec Normal file
View File

@ -0,0 +1,217 @@
Name: sysfsutils
URL: http://sourceforge.net/projects/linux-diag/
License: GPLv2
Group: Development/Tools
Version: 2.1.0
Release: 24%{?dist}
Summary: Utilities for interfacing with sysfs
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0: http://prdownloads.sourceforge.net/linux-diag/%{name}-%{version}.tar.gz
Patch0: sysfsutils-2.0.0-redhatify.patch
Patch1: sysfsutils-2.0.0-class-dup.patch
Patch2: sysfsutils-2.1.0-get_link.patch
Patch3: sysfsutils-2.1.0-manpages.patch
Patch4: sysfsutils-aarch64.patch
%description
This package's purpose is to provide a set of utilities for interfacing
with sysfs.
%package -n libsysfs
Summary: Shared library for interfacing with sysfs
Group: System Environment/Libraries
License: LGPLv2+
%description -n libsysfs
Library used in handling linux kernel sysfs mounts and their various files.
%package -n libsysfs-devel
Summary: Static library and headers for libsysfs
Group: Development/Libraries
License: LGPLv2+
Requires: libsysfs = %{version}-%{release}
%description -n libsysfs-devel
libsysfs-devel provides the header files and static libraries required
to build programs using the libsysfs API.
%prep
%setup -q
%patch0 -p1 -b .redhatify
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
%configure --disable-static --prefix=/usr
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT%{_bindir}/dlist_test $RPM_BUILD_ROOT%{_bindir}/get_bus_devices_list $RPM_BUILD_ROOT%{_bindir}/get_class_dev $RPM_BUILD_ROOT%{_bindir}/get_classdev_parent $RPM_BUILD_ROOT%{_bindir}/get_device $RPM_BUILD_ROOT%{_bindir}/get_driver $RPM_BUILD_ROOT%{_bindir}/testlibsysfs $RPM_BUILD_ROOT%{_bindir}/write_attr
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
%post -n libsysfs -p /sbin/ldconfig
%postun -n libsysfs -p /sbin/ldconfig
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_bindir}/systool
%{_bindir}/get_module
%{_mandir}/man1/systool.1.gz
%doc COPYING AUTHORS README NEWS CREDITS ChangeLog docs/libsysfs.txt cmd/GPL
%files -n libsysfs
%defattr(-,root,root)
/%{_libdir}/libsysfs.so.*
%doc COPYING AUTHORS README NEWS CREDITS ChangeLog docs/libsysfs.txt lib/LGPL
%files -n libsysfs-devel
%defattr(-,root,root)
%dir %{_includedir}/sysfs
%{_includedir}/sysfs/libsysfs.h
%{_includedir}/sysfs/dlist.h
/%{_libdir}/libsysfs.so
%changelog
* Mon Oct 22 2018 Neil Horman <nhorman@redhat.com> 2.1.0-24
- Fix annocheck build issues (bz 1630632)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sat May 11 2013 Anton Arapov <anton@redhat.com> - 2.1.0-14
- We don't support aarch64, do the appropriate changes (#926600)
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Tue Mar 22 2011 Anton Arapov <anton@redhat.com> - 2.1.0-10
- Better manpages. (#673849)
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Thu Jun 17 2010 Anton Arapov <anton@redhat.com> - 2.1.0-8
- Move libraries from /usr/lib to /lib since we need them
during the system boot. (#605546)
* Mon Jan 18 2010 Anton Arapov <anton@redhat.com> - 2.1.0-7
- Don't build and ship statically linked library (#556096)
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Tue May 20 2008 Jarod Wilson <jwilson@redhat.com> - 2.1.0-4
- Fix up get_link on kernel 2.6.25+ (#447220)
* Mon Feb 25 2008 Jarod Wilson <jwilson@redhat.com> - 2.1.0-3
- Review cleanups from Todd Zullinger (#226447)
* Thu Feb 14 2008 Jarod Wilson <jwilson@redhat.com> - 2.1.0-2
- Bump and rebuild with gcc 4.3
* Mon Sep 29 2007 Jarod Wilson <jwilson@redhat.com> - 2.1.0-1
- Update to upstream release 2.1.0
* Mon Sep 11 2006 Neil Horman <nhorman@redhat.com> - 2.0.0-6
- Integrate patch for bz 205808
* Mon Jul 17 2006 Jesse Keating <jkeating@redhat.com> - 2.0.0-5
- rebuild
* Mon Jul 10 2006 Neil Horman <nhorman@redhat.com> - 2.0.0-4
- Obsoleting old sysfsutil-devel package for upgrade path (bz 198054)
* Fri Jul 7 2006 Doug Ledford <dledford@redhat.com> - 2.0.0-3
- Split the library and devel files out to libsysfs and leave the utils
in sysfsutils. This is for multilib arch requirements.
* Thu May 25 2006 Neil Horman <nhorman@redhat.com> - 2.0.0-2
- Fixed devel rpm to own sysfs include dir
- Fixed a typo in changelog
* Wed May 24 2006 Neil Horman <nhorman@redhat.com> - 2.0.0-1
- Rebase to sysfsutils-2.0.0 for RHEL5
* Thu Apr 27 2006 Jeremy Katz <katzj@redhat.com> - 1.3.0-2
- move .so to devel subpackage
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1.3.0-1.2.1
- bump again for double-long bug on ppc(64)
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.3.0-1.2
- rebuilt for new gcc4.1 snapshot and glibc changes
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt
* Fri Jul 08 2005 Bill Nottingham <notting@redhat.com> 1.3.0-1
- update to 1.3.0
* Wed Mar 02 2005 AJ Lewis <alewis@redhat.com> 1.2.0-4
- Rebuild
* Wed Feb 09 2005 AJ Lewis <alewis@redhat.com> 1.2.0-3
- start using %%configure instead of calling configure directly
* Wed Feb 09 2005 AJ Lewis <alewis@redhat.com> 1.2.0-2
- rebuild
* Mon Oct 11 2004 AJ Lewis <alewis@redhat.com> 1.2.0-1
- Update to upstream version 1.2.0
* Wed Sep 22 2004 Florian La Roche <Florian.LaRoche@redhat.de>
- added /sbin/ldconfig calls to post/postun
* Thu Sep 01 2004 AJ Lewis <alewis@redhat.com> 1.1.0-2
- Fix permissions on -devel files
* Fri Aug 13 2004 AJ Lewis <alewis@redhat.com> 1.1.0-1.1
- Rebuild
* Fri Aug 13 2004 AJ Lewis <alewis@redhat.com> 1.1.0-1
- Initial package for FC3