From 114eb6b5bc8f45285a4c76dfd9a66e0b7f82a30f Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Thu, 3 Nov 2011 10:33:37 +0800 Subject: [PATCH] new package: bonnie: useful tool to determine the speed of your filesystem --- bonnie/Makefile | 52 ++++++++++++++++++++++ bonnie/patches/001-remove-asm-page.h.patch | 33 ++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 bonnie/Makefile create mode 100644 bonnie/patches/001-remove-asm-page.h.patch diff --git a/bonnie/Makefile b/bonnie/Makefile new file mode 100644 index 0000000..42c7899 --- /dev/null +++ b/bonnie/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) Xiangfu Liu +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bonnie +PKG_VERSION:=1.4 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.garloff.de/kurt/linux/bonnie/ +PKG_RELEASE:=1 +PKG_INSTALL:=1 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/bonnie + TITLE:=Bonnie + SECTION:=utils + CATEGORY:=Utilities + URL:=http://www.garloff.de/kurt/linux/bonnie/ +endef + +define Package/bonnie/description +Bonnie is a simple but useful tool to determine the speed of your filesystem, +your OS caching, the underlying device and your libc +endef + +define Build/Configure + $(call Build/Configure/Default) +endef + +define Build/Compile + $(call Build/Compile/Default) +endef + +define Build/Install +endef + +define Package/bonnie/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/Bonnie $(1)/usr/bin/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,bonnie)) + +# The following comments configure the Bonnie editor. Just ignore them. +# Local Variables: +# compile-command: "make -C ~/openwrt-xburst.full_system package/bonnie/{clean,compile} V=99" +# End: diff --git a/bonnie/patches/001-remove-asm-page.h.patch b/bonnie/patches/001-remove-asm-page.h.patch new file mode 100644 index 0000000..77d8e74 --- /dev/null +++ b/bonnie/patches/001-remove-asm-page.h.patch @@ -0,0 +1,33 @@ +diff --git a/Bonnie.c b/Bonnie.c +index 909ca4a..b3a782a 100644 +--- a/Bonnie.c ++++ b/Bonnie.c +@@ -77,11 +77,6 @@ + #include + #include + +-#ifdef __linux__ +-/* for o_direct */ +-#include +-#endif +- + #ifdef unix + #include + #endif +@@ -197,13 +192,13 @@ int main( + int volcnt; + register off_t words; + +- __buf = malloc(Chunk + ~PAGE_MASK); ++ __buf = malloc(Chunk + ~(sysconf(_SC_PAGE_SIZE)-1)); + if (!__buf) + { +- fprintf(stderr, "unable to malloc %d bytes\n", Chunk + ~PAGE_MASK); ++ fprintf(stderr, "unable to malloc %d bytes\n", Chunk + ~(sysconf(_SC_PAGE_SIZE)-1)); + exit(1) ; + } +- buf = (int *)((unsigned long)(__buf + ~PAGE_MASK) & PAGE_MASK); ++ buf = (int *)((unsigned long)(__buf + ~(sysconf(_SC_PAGE_SIZE)-1)) & sysconf(_SC_PAGE_SIZE)-1); + + basetime = (int) time((time_t *) NULL); + size = 100;