From 219a6dab8995aad9ac4860cc1a84d6f3509a03a4 Mon Sep 17 00:00:00 2001
From: wbx <wbx@hydrogenium.(none)>
Date: Sun, 17 May 2009 14:41:34 +0200
Subject: Initial import

---
 package/exmap/Config.in                       | 41 ++++++++++++++++++++++
 package/exmap/Makefile                        | 49 +++++++++++++++++++++++++++
 package/exmap/ipkg/exmap.control              |  4 +++
 package/exmap/ipkg/exmapd.control             |  4 +++
 package/exmap/ipkg/exmapserver.control        |  4 +++
 package/exmap/ipkg/kmod-exmap.control         |  4 +++
 package/exmap/patches/patch-Makefile_in       | 12 +++++++
 package/exmap/patches/patch-kernel_exmap_c    | 31 +++++++++++++++++
 package/exmap/patches/patch-src_exmapd_c      | 20 +++++++++++
 package/exmap/patches/patch-src_exmapserver_c | 22 ++++++++++++
 10 files changed, 191 insertions(+)
 create mode 100644 package/exmap/Config.in
 create mode 100644 package/exmap/Makefile
 create mode 100644 package/exmap/ipkg/exmap.control
 create mode 100644 package/exmap/ipkg/exmapd.control
 create mode 100644 package/exmap/ipkg/exmapserver.control
 create mode 100644 package/exmap/ipkg/kmod-exmap.control
 create mode 100644 package/exmap/patches/patch-Makefile_in
 create mode 100644 package/exmap/patches/patch-kernel_exmap_c
 create mode 100644 package/exmap/patches/patch-src_exmapd_c
 create mode 100644 package/exmap/patches/patch-src_exmapserver_c

(limited to 'package/exmap')

diff --git a/package/exmap/Config.in b/package/exmap/Config.in
new file mode 100644
index 000000000..18bd98582
--- /dev/null
+++ b/package/exmap/Config.in
@@ -0,0 +1,41 @@
+config ADK_COMPILE_EXMAP
+	tristate
+	default n
+
+config ADK_PACKAGE_EXMAP
+	prompt "exmap............................. exmap-console utility"
+	tristate
+	select ADK_COMPILE_EXMAP
+	select ADK_PACKAGE_GLIB2
+	select ADK_PACKAGE_LIBREADLINE
+	select ADK_PACKAGE_KMOD_EXMAP
+	default n
+	help
+	  http://labs.o-hand.com/exmap-console/
+
+config ADK_PACKAGE_EXMAPD
+	prompt "exmapd............................ exmap daemon"
+	tristate
+	select ADK_COMPILE_EXMAP
+	select ADK_PACKAGE_GLIB2
+	select ADK_PACKAGE_LIBREADLINE
+	select ADK_PACKAGE_KMOD_EXMAP
+	default n
+	help
+	  http://labs.o-hand.com/exmap-console/
+
+config ADK_PACKAGE_EXMAPSERVER
+	prompt "exmapserver....................... exmap server"
+	tristate
+	select ADK_COMPILE_EXMAP
+	select ADK_PACKAGE_GLIB2
+	select ADK_PACKAGE_LIBREADLINE
+	select ADK_PACKAGE_KMOD_EXMAP
+	default n
+	help
+	  http://labs.o-hand.com/exmap-console/
+
+config ADK_PACKAGE_KMOD_EXMAP
+	tristate
+	default n
+	help
diff --git a/package/exmap/Makefile b/package/exmap/Makefile
new file mode 100644
index 000000000..78f0cf13e
--- /dev/null
+++ b/package/exmap/Makefile
@@ -0,0 +1,49 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:=		exmap
+PKG_VERSION:=		0.4.1
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		55aec784e214037e61400287a55b5426
+
+DISTFILES:=		${PKG_NAME}-console-${PKG_VERSION}.tgz
+MASTER_SITES:=		http://labs.o-hand.com/sources/exmap-console/
+WRKDIST=		${WRKDIR}/${PKG_NAME}-console-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,EXMAP,exmap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,EXMAPD,exmapd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,EXMAPSERVER,exmapserver,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,KMOD_EXMAP,kmod-exmap,${KERNEL_VERSION}+${PKG_VERSION}-${DEVICE}-${PKG_RELEASE},${ARCH},kernel (${KERNEL_VERSION}-${DEVICE}-${KERNEL_RELEASE})))
+
+CONFIGURE_STYLE:=	gnu
+CONFIGURE_ARGS+=	--disable-doc
+CONFIGURE_ENV+=		LIBS="-lncurses"
+BUILD_STYLE:=		auto
+
+pre-build:
+	KERNEL_PATH=${LINUX_DIR} \
+	CROSS_COMPILE="${TARGET_CROSS}" \
+	V=1 ARCH="${ARCH}" KERNELVERSION="2.6" \
+	LDFLAGS="" \
+	$(MAKE) -C ${WRKBUILD}/kernel
+
+post-install:
+	${INSTALL_DIR} ${IDIR_KMOD_EXMAP}/etc/modules.d/
+	echo "exmap" > ${IDIR_KMOD_EXMAP}/etc/modules.d/90-exmap
+	${INSTALL_DIR} ${IDIR_KMOD_EXMAP}/lib/modules/${KERNEL_VERSION}/
+	${INSTALL_DATA} ${WRKBUILD}/kernel/exmap.ko \
+		${IDIR_KMOD_EXMAP}/lib/modules/${KERNEL_VERSION}
+	${INSTALL_DIR} ${IDIR_EXMAP}/usr/sbin
+	${INSTALL_BIN} ${WRKBUILD}/src/exmap ${IDIR_EXMAP}/usr/sbin
+	${INSTALL_DIR} ${IDIR_EXMAPD}/usr/sbin
+	${INSTALL_BIN} ${WRKBUILD}/src/exmapd ${IDIR_EXMAPD}/usr/sbin
+	${INSTALL_DIR} ${IDIR_EXMAPSERVER}/usr/sbin
+	${INSTALL_BIN} ${WRKBUILD}/src/exmapserver ${IDIR_EXMAPSERVER}/usr/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/exmap/ipkg/exmap.control b/package/exmap/ipkg/exmap.control
new file mode 100644
index 000000000..23c51313a
--- /dev/null
+++ b/package/exmap/ipkg/exmap.control
@@ -0,0 +1,4 @@
+Package: exmap
+Priority: optional
+Section: utils
+Description: memory analysing tool
diff --git a/package/exmap/ipkg/exmapd.control b/package/exmap/ipkg/exmapd.control
new file mode 100644
index 000000000..dbfe932a8
--- /dev/null
+++ b/package/exmap/ipkg/exmapd.control
@@ -0,0 +1,4 @@
+Package: exmapd
+Priority: optional
+Section: utils
+Description: memory analysing tool
diff --git a/package/exmap/ipkg/exmapserver.control b/package/exmap/ipkg/exmapserver.control
new file mode 100644
index 000000000..8d33fb53a
--- /dev/null
+++ b/package/exmap/ipkg/exmapserver.control
@@ -0,0 +1,4 @@
+Package: exmapserver
+Priority: optional
+Section: utils
+Description: memory analysing tool
diff --git a/package/exmap/ipkg/kmod-exmap.control b/package/exmap/ipkg/kmod-exmap.control
new file mode 100644
index 000000000..afae49276
--- /dev/null
+++ b/package/exmap/ipkg/kmod-exmap.control
@@ -0,0 +1,4 @@
+Package: kmod-exmap
+Priority: optional
+Section: utils
+Description: kernel module for a memory analysing tool
diff --git a/package/exmap/patches/patch-Makefile_in b/package/exmap/patches/patch-Makefile_in
new file mode 100644
index 000000000..cb3281aff
--- /dev/null
+++ b/package/exmap/patches/patch-Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- exmap-console-0.4.1.orig/Makefile.in	2007-02-26 12:44:02.000000000 +0100
++++ exmap-console-0.4.1/Makefile.in	2009-04-18 16:16:03.926793719 +0200
+@@ -155,7 +155,7 @@ sbindir = @sbindir@
+ sharedstatedir = @sharedstatedir@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
+-SUBDIRS = kernel src doc
++SUBDIRS = src
+ DISTCLEANFILES = *~ Makefile.in install-sh missing depcomp *.m4 config.log config.status Makefile
+ all: all-recursive
+ 
diff --git a/package/exmap/patches/patch-kernel_exmap_c b/package/exmap/patches/patch-kernel_exmap_c
new file mode 100644
index 000000000..8278e6510
--- /dev/null
+++ b/package/exmap/patches/patch-kernel_exmap_c
@@ -0,0 +1,31 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- exmap-console-0.4.1.orig/kernel/exmap.c	2006-10-24 20:45:11.000000000 +0200
++++ exmap-console-0.4.1/kernel/exmap.c	2008-12-14 13:34:01.000000000 +0100
+@@ -392,7 +392,11 @@ int setup_from_pid(pid_t pid)
+ 	struct task_struct *tsk;
+ 	int errcode = -EINVAL;
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++	tsk = find_task_by_vpid(pid);
++#else
+ 	tsk = find_task_by_pid(pid);
++#endif
+ 	if (tsk == NULL) {
+ 		printk (KERN_ALERT
+ 			"/proc/%s: can't find task for pid %d\n",
+@@ -507,7 +511,7 @@ int init_module ()
+ 							NULL);
+ 
+ 	if (exmap_proc_file == NULL) {
+-		remove_proc_entry (PROCFS_NAME, &proc_root);
++		remove_proc_entry (PROCFS_NAME, NULL);
+ 		printk (KERN_ALERT "/proc/%s: could not initialize\n",
+ 			PROCFS_NAME);
+ 		return -ENOMEM;
+@@ -532,5 +536,5 @@ int init_module ()
+ void cleanup_module ()
+ {
+ 	printk (KERN_INFO "/proc/%s: remove\n", PROCFS_NAME);
+-	remove_proc_entry (PROCFS_NAME, &proc_root);
++	remove_proc_entry (PROCFS_NAME, NULL);
+ }
diff --git a/package/exmap/patches/patch-src_exmapd_c b/package/exmap/patches/patch-src_exmapd_c
new file mode 100644
index 000000000..68921e5f4
--- /dev/null
+++ b/package/exmap/patches/patch-src_exmapd_c
@@ -0,0 +1,20 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- exmap-console-0.4.1.orig/src/exmapd.c	2006-12-11 08:50:23.000000000 +0100
++++ exmap-console-0.4.1/src/exmapd.c	2008-12-14 15:53:02.000000000 +0100
+@@ -257,6 +257,7 @@ main (int argc, char ** argv)
+     }
+ 
+   /* make sure that the exmap module is loaded */
++  /*
+   if (g_spawn_sync (NULL, (char**)&modp_args, NULL, G_SPAWN_SEARCH_PATH,
+                     NULL, NULL, NULL, NULL, &modp_status, &error))
+     {
+@@ -268,7 +269,7 @@ main (int argc, char ** argv)
+     {
+       g_error ("Could not spawn modprobe: %s", error ? error->message : "");
+     }
+-  
++  */ 
+   /* Initialise data for the timeout callback
+    *
+    * 4 == 3 + 1: 3 for the exec name + 2 params we feed exmap
diff --git a/package/exmap/patches/patch-src_exmapserver_c b/package/exmap/patches/patch-src_exmapserver_c
new file mode 100644
index 000000000..721ec2fa3
--- /dev/null
+++ b/package/exmap/patches/patch-src_exmapserver_c
@@ -0,0 +1,22 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- exmap-console-0.4.1.orig/src/exmapserver.c	2007-02-26 12:00:48.000000000 +0100
++++ exmap-console-0.4.1/src/exmapserver.c	2008-12-14 15:52:07.000000000 +0100
+@@ -532,9 +532,9 @@ main (int argc, char ** argv)
+ 	}
+     }
+ 
++  /* do not try to modprobe 
+   if (getuid() == 0)
+     {
+-      /* if running a root, we can make sure that the exmap module is loaded */
+       if (g_spawn_sync (NULL, (char**)&modp_args, NULL, G_SPAWN_SEARCH_PATH,
+                         NULL, NULL, NULL, NULL, &modp_status, &error))
+         {
+@@ -548,6 +548,7 @@ main (int argc, char ** argv)
+                    error ? error->message : "");
+         }
+     }
++   */
+   
+   /* handle SIGPIPE */
+   struct sigaction sa;
-- 
cgit v1.2.3