+++ /dev/null
-#
-# Copyright (C) 2007-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=libnfnetlink
-PKG_VERSION:=1.0.0
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:= \
- http://www.netfilter.org/projects/libnfnetlink/files/ \
- ftp://ftp.netfilter.org/pub/libnfnetlink/ \
- http://mirrors.evolva.ro/netfilter.org/libnfnetlink/
-PKG_MD5SUM:=016fdec8389242615024c529acc1adb8
-
-PKG_FIXUP:=autoreconf
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/libnfnetlink
- SECTION:=libs
- CATEGORY:=Libraries
- TITLE:=A low-level library for netfilter related kernel/userspace communication
- URL:=http://netfilter.org/projects/libnfnetlink/
-endef
-
-define Package/libnfnetlink/description
- libnfnetlink is is the low-level library for netfilter related kernel/userspace communication.
- It provides a generic messaging infrastructure for in-kernel netfilter subsystems
- (such as nfnetlink_log, nfnetlink_queue, nfnetlink_conntrack) and their respective users
- and/or management tools in userspace.
-endef
-
-TARGET_CFLAGS += $(FPIC)
-
-CONFIGURE_ARGS += \
- --enable-static \
- --enable-shared
-
-define Build/InstallDev
- $(INSTALL_DIR) $(1)/usr/include/libnfnetlink
- $(CP) \
- $(PKG_INSTALL_DIR)/usr/include/libnfnetlink/{libnfnetlink,linux_nfnetlink,linux_nfnetlink_compat}.h \
- $(1)/usr/include/libnfnetlink/
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/libnfnetlink.{a,so*} \
- $(1)/usr/lib/
- $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
- $(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfnetlink.pc \
- $(1)/usr/lib/pkgconfig/
-endef
-
-define Package/libnfnetlink/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/libnfnetlink.so.* \
- $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,libnfnetlink))
+++ /dev/null
-#
-# Copyright (C) 2006-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=sysfsutils
-PKG_VERSION:=2.1.0
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/linux-diag
-PKG_MD5SUM:=14e7dcd0436d2f49aa403f67e1ef7ddc
-
-PKG_FIXUP:=autoreconf
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/libsysfs
- SECTION:=libs
- CATEGORY:=Libraries
- SUBMENU:=Filesystem
- TITLE:=Sysfs library
- URL:=http://linux-diag.sourceforge.net/Sysfsutils.html
-endef
-
-define Package/sysfsutils
- SECTION:=utils
- CATEGORY:=Utilities
- SUBMENU:=Filesystem
- DEPENDS:=+libsysfs
- TITLE:=System Utilities Based on Sysfs
- URL:=http://linux-diag.sourceforge.net/Sysfsutils.html
-endef
-
-define Package/libsysfs/description
-The library's purpose is to provide a consistant and stable interface for
-querying system device information exposed through sysfs.
-endef
-
-define Package/sysfsutils/description
-A utility built upon libsysfs that lists devices by bus, class, and topology.
-endef
-
-define Build/InstallDev
- $(INSTALL_DIR) $(1)/usr/include
- $(CP) $(PKG_INSTALL_DIR)/usr/include/sysfs $(1)/usr/include/
-
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysfs.{a,so*,la} $(1)/usr/lib/
-endef
-
-define Package/libsysfs/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysfs.so* $(1)/usr/lib/
-endef
-
-define Package/sysfsutils/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/systool $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,libsysfs))
-$(eval $(call BuildPackage,sysfsutils))
+++ /dev/null
---- a/lib/sysfs_utils.c
-+++ b/lib/sysfs_utils.c
-@@ -22,6 +22,7 @@
- */
- #include "libsysfs.h"
- #include "sysfs.h"
-+#include <mntent.h>
-
- /**
- * sysfs_remove_trailing_slash: Removes any trailing '/' in the given path
-@@ -53,6 +54,9 @@ int sysfs_get_mnt_path(char *mnt_path, s
- {
- static char sysfs_path[SYSFS_PATH_MAX] = "";
- const char *sysfs_path_env;
-+ FILE *mnt;
-+ struct mntent *mntent;
-+ int ret;
-
- if (len == 0 || mnt_path == NULL)
- return -1;
-@@ -64,12 +68,31 @@ int sysfs_get_mnt_path(char *mnt_path, s
- if (sysfs_path_env != NULL) {
- safestrcpymax(mnt_path, sysfs_path_env, len);
- sysfs_remove_trailing_slash(mnt_path);
-- return 0;
-+ } else {
-+ safestrcpymax(mnt_path, SYSFS_MNT_PATH, len);
- }
-- safestrcpymax(mnt_path, SYSFS_MNT_PATH, len);
- }
-
-- return 0;
-+ /* check that mount point is indeed mounted */
-+ ret = -1;
-+ if ((mnt = setmntent(SYSFS_PROC_MNTS, "r")) == NULL) {
-+ dprintf("Error getting mount information\n");
-+ return -1;
-+ }
-+ while ((mntent = getmntent(mnt)) != NULL) {
-+ if (strcmp(mntent->mnt_type, SYSFS_FSTYPE_NAME) == 0 &&
-+ strcmp(mntent->mnt_dir, mnt_path) == 0) {
-+ ret = 0;
-+ break;
-+ }
-+ }
-+
-+ endmntent(mnt);
-+
-+ if (ret < 0)
-+ errno = ENOENT;
-+
-+ return ret;
- }
-
- /**
--- /dev/null
+#
+# Copyright (C) 2006-2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=sysfsutils
+PKG_VERSION:=2.1.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/linux-diag
+PKG_MD5SUM:=14e7dcd0436d2f49aa403f67e1ef7ddc
+PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libsysfs
+ SECTION:=libs
+ CATEGORY:=Libraries
+ SUBMENU:=Filesystem
+ TITLE:=Sysfs library
+ URL:=http://linux-diag.sourceforge.net/Sysfsutils.html
+endef
+
+define Package/sysfsutils
+ SECTION:=utils
+ CATEGORY:=Utilities
+ SUBMENU:=Filesystem
+ DEPENDS:=+libsysfs
+ TITLE:=System Utilities Based on Sysfs
+ URL:=http://linux-diag.sourceforge.net/Sysfsutils.html
+endef
+
+define Package/libsysfs/description
+The library's purpose is to provide a consistant and stable interface for
+querying system device information exposed through sysfs.
+endef
+
+define Package/sysfsutils/description
+A utility built upon libsysfs that lists devices by bus, class, and topology.
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/sysfs $(1)/usr/include/
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysfs.{a,so*,la} $(1)/usr/lib/
+endef
+
+define Package/libsysfs/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysfs.so* $(1)/usr/lib/
+endef
+
+define Package/sysfsutils/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/systool $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libsysfs))
+$(eval $(call BuildPackage,sysfsutils))
--- /dev/null
+--- a/lib/sysfs_utils.c
++++ b/lib/sysfs_utils.c
+@@ -22,6 +22,7 @@
+ */
+ #include "libsysfs.h"
+ #include "sysfs.h"
++#include <mntent.h>
+
+ /**
+ * sysfs_remove_trailing_slash: Removes any trailing '/' in the given path
+@@ -53,6 +54,9 @@ int sysfs_get_mnt_path(char *mnt_path, s
+ {
+ static char sysfs_path[SYSFS_PATH_MAX] = "";
+ const char *sysfs_path_env;
++ FILE *mnt;
++ struct mntent *mntent;
++ int ret;
+
+ if (len == 0 || mnt_path == NULL)
+ return -1;
+@@ -64,12 +68,31 @@ int sysfs_get_mnt_path(char *mnt_path, s
+ if (sysfs_path_env != NULL) {
+ safestrcpymax(mnt_path, sysfs_path_env, len);
+ sysfs_remove_trailing_slash(mnt_path);
+- return 0;
++ } else {
++ safestrcpymax(mnt_path, SYSFS_MNT_PATH, len);
+ }
+- safestrcpymax(mnt_path, SYSFS_MNT_PATH, len);
+ }
+
+- return 0;
++ /* check that mount point is indeed mounted */
++ ret = -1;
++ if ((mnt = setmntent(SYSFS_PROC_MNTS, "r")) == NULL) {
++ dprintf("Error getting mount information\n");
++ return -1;
++ }
++ while ((mntent = getmntent(mnt)) != NULL) {
++ if (strcmp(mntent->mnt_type, SYSFS_FSTYPE_NAME) == 0 &&
++ strcmp(mntent->mnt_dir, mnt_path) == 0) {
++ ret = 0;
++ break;
++ }
++ }
++
++ endmntent(mnt);
++
++ if (ret < 0)
++ errno = ENOENT;
++
++ return ret;
+ }
+
+ /**