summaryrefslogtreecommitdiffstats
path: root/remote/modules/dnbd3
diff options
context:
space:
mode:
authorSimon Rettberg2013-07-22 15:35:56 +0200
committerSimon Rettberg2013-07-22 15:35:56 +0200
commite2b805c6aaf4e421950c166d139083b1c21b4540 (patch)
tree674f9ecb52310853855694647586343155b19cff /remote/modules/dnbd3
parent[mltk/server] Add status output between generating squashFS and generating in... (diff)
downloadtm-scripts-e2b805c6aaf4e421950c166d139083b1c21b4540.tar.gz
tm-scripts-e2b805c6aaf4e421950c166d139083b1c21b4540.tar.xz
tm-scripts-e2b805c6aaf4e421950c166d139083b1c21b4540.zip
[dnbd3] Add dnbd3 client + kernel module
Diffstat (limited to 'remote/modules/dnbd3')
-rw-r--r--remote/modules/dnbd3/data/etc/udev/rules.d/90-dnbd3.rules1
-rw-r--r--remote/modules/dnbd3/dnbd3.build41
-rw-r--r--remote/modules/dnbd3/dnbd3.conf12
3 files changed, 54 insertions, 0 deletions
diff --git a/remote/modules/dnbd3/data/etc/udev/rules.d/90-dnbd3.rules b/remote/modules/dnbd3/data/etc/udev/rules.d/90-dnbd3.rules
new file mode 100644
index 00000000..0eb1f52d
--- /dev/null
+++ b/remote/modules/dnbd3/data/etc/udev/rules.d/90-dnbd3.rules
@@ -0,0 +1 @@
+KERNEL=="dnbd*", SUBSYSTEM=="block", MODE="0664"
diff --git a/remote/modules/dnbd3/dnbd3.build b/remote/modules/dnbd3/dnbd3.build
new file mode 100644
index 00000000..5dd2769f
--- /dev/null
+++ b/remote/modules/dnbd3/dnbd3.build
@@ -0,0 +1,41 @@
+fetch_source() {
+ mkdir -p "src/kmod"
+ if [ ! -d "src/dnbd3" ]; then
+ git clone "$REQUIRED_GIT" "src/dnbd3" || perror "Could not clone dnbd3 git repo"
+ fi
+ cd src/dnbd3
+ #git checkout "$REQUIRED_BRANCH" || perror "Could not checkout requested branch $REQUIRED_BRANCH"
+ git checkout "$REQUIRED_COMMIT" || perror "Could not checkout requested commit $REQUIRED_COMMIT"
+ cd -
+ cp src/dnbd3/Kbuild.in src/dnbd3/src/*.{c,h} src/dnbd3/src/kernel/*.{c,h} src/kmod/ || perror "Could not copy kernel module source files"
+ cat > "src/kmod/Makefile" <<HEREEND
+include \$(PWD)/Kbuild.in
+
+ifndef KDIR
+ KDIR = /lib/modules/\$(shell uname -r)/build
+endif
+
+all:
+ make -C "\$(KDIR)" "M=\$(PWD)" modules
+
+clean:
+ make -C "\$(KDIR)" "M=\$(PWD)" clean
+HEREEND
+}
+
+build() {
+ cd "$MODULE_DIR/src/kmod" || perror "Could not CD to standalone dnbd3 kmod dir"
+ make MODULE_NAME=dnbd3 KDIR="$MODULES_DIR/kernel/ksrc" || perror "Could not compile kernel module"
+ mkdir -p "$MODULE_BUILD_DIR/lib/modules/dnbd3" || perror "Could not create lib/modules/dnbd3"
+ mkdir -p "$MODULE_BUILD_DIR/opt/openslx/bin" || perror "Coould not create opt/openslx/bin"
+ cp "$MODULE_DIR/src/kmod/dnbd3.ko" "$MODULE_BUILD_DIR/lib/modules/dnbd3/" || perror "could not cp dnbd3.ko"
+ cd "$MODULE_BUILD_DIR/opt/openslx/bin" || perror "Could not cd to build dir for client binary"
+ cmake "$MODULE_DIR/src/dnbd3" || perror "Could not cmake"
+ make dnbd3-client || perror "Could not make dnbd3-client"
+ cd "$MODULE_DIR"
+}
+
+post_copy() {
+ :
+}
+
diff --git a/remote/modules/dnbd3/dnbd3.conf b/remote/modules/dnbd3/dnbd3.conf
new file mode 100644
index 00000000..943e7f78
--- /dev/null
+++ b/remote/modules/dnbd3/dnbd3.conf
@@ -0,0 +1,12 @@
+#REQUIRED_INSTALLED_PACKAGES="libgconf-2-4 fontconfig-config"
+#REQUIRED_CONTENT_PACKAGES="libgconf-2-4 fontconfig-config"
+REQUIRED_MODULES="kernel"
+REQUIRED_GIT="git://git.openslx.org/dnbd3.git"
+REQUIRED_BRANCH="simon"
+REQUIRED_COMMIT="2a57d02723295cb688f1643ebabdbf549ad63fa3"
+REQUIRED_BINARIES="
+ dnbd3-client
+"
+REQUIRED_DIRECTORIES="
+ /lib/modules
+"