Compare commits

...

5 Commits

Author SHA1 Message Date
Ionut-Alex Oprea
0b861b97bb inteno-netmode: update repo hash 2017-12-19 10:37:24 +01:00
Reidar Cederqvist
ccb4e65f34 inteno-netmode: add repo for netmoded source code 2017-12-19 10:37:24 +01:00
Kenneth Johansson
011f586731 fatrace: we need to flush every line when using a pipe.
/sbin/fatrace -c -t -f W |  grep "/etc/"

produced no output until internal printf buffer full and that is not so
useful.
2017-12-18 21:03:37 +01:00
Kenneth Johansson
90aff84618 fatrace: add kernel config option and patch for correct O_LAGEFILE.
The program only worked on x86.
2017-12-18 20:24:44 +01:00
Kenneth Johansson
e81718ab54 Add fatrace program. 2017-12-18 17:49:31 +01:00
4 changed files with 96 additions and 13 deletions

58
fatrace/Makefile Normal file
View File

@@ -0,0 +1,58 @@
#
# 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
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=fatrace
PKG_VERSION:=0.12
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=98af6019a4a1b478a6fa35f74528cb3cd404ae40
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://git.launchpad.net/fatrace
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
# support parallel build
#PKG_BUILD_PARALLEL:=1
#re create configure scripts if not present.
#PKG_FIXUP:=autoreconf
# run install target when cross compiling. basically, make install DESTDIR=$(PKG_INSTALL_DIR)
# this way we don't need to pick out the resulting files from the build dir.
PKG_INSTALL:=1
PKG_CONFIG_DEPENDS := CONFIG_KERNEL_FANOTIFY
include $(INCLUDE_DIR)/package.mk
define Package/fatrace
CATEGORY:=Utilities
TITLE:=Report system wide file access events
URL:=
DEPENDS := +@KERNEL_FANOTIFY
endef
define Package/fatrace/description
Report system wide file access events.
endef
MAKE_INSTALL_FLAGS += PREFIX="/"
define Package/fatrace/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/fatrace $(1)/sbin/
# $(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,fatrace))

View File

@@ -0,0 +1,14 @@
diff --git a/fatrace.c b/fatrace.c
index 1c0899a..b7d1560 100644
--- a/fatrace.c
+++ b/fatrace.c
@@ -44,7 +44,8 @@
* http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1e2ee49f7
* O_LARGEFILE is usually 0, so hardcode it here
*/
-#define KERNEL_O_LARGEFILE 00100000
+//#define KERNEL_O_LARGEFILE 00100000
+#define KERNEL_O_LARGEFILE O_LARGEFILE
/* command line options */
static char* option_output = NULL;

View File

@@ -0,0 +1,12 @@
diff --git a/fatrace.c b/fatrace.c
index b7d1560..6179272 100644
--- a/fatrace.c
+++ b/fatrace.c
@@ -149,6 +149,7 @@ print_event(const struct fanotify_event_metadata *data,
printf ("%li.%06li ", event_time->tv_sec, event_time->tv_usec);
}
printf ("%s(%i): %s %s\n", procname, data->pid, mask2str (data->mask), pathname);
+ fflush(stdout);
}
/**

View File

@@ -5,29 +5,28 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=inteno-netmodes
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_VERSION:=0.1.0
PKG_SOURCE_VERSION:=8c97bebc03c1c61553c30b9fcdcd63bf9abe439d
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se:/netmoded
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/inteno-netmodes
CATEGORY:=Base system
DEPENDS:=+fping
TITLE:=Predefined Network Modes
CATEGORY:=Base system
DEPENDS:=+fping +ubus +libubox
TITLE:=Predefined Network Modes
endef
define Package/inteno-netmodes/description
Predefined Network Modes
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./files/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
endef
define Package/inteno-netmodes/install
$(CP) ./files/* $(1)/
endef