From 5acda3eaeabae9045609539303a8c12c4ce401f1 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 25 Apr 2016 12:01:08 +0200 Subject: merge with latest dev version --- core/modules/dnbd3/TODO | 1 + core/modules/dnbd3/data/etc/fuse.conf | 8 ++++ .../data/etc/systemd/system/setup-dnbd3.service | 11 ++++++ .../sysinit.target.wants/setup-dnbd3.service | 1 + .../dnbd3/data/etc/udev/rules.d/90-dnbd3.rules | 1 + .../opt/openslx/scripts/pam_script_auth.d/10-fuse | 6 +++ .../data/opt/openslx/scripts/systemd-setup_dnbd3 | 16 ++++++++ core/modules/dnbd3/module.build | 45 ++++++++++++++++++++++ core/modules/dnbd3/module.conf | 10 +++++ core/modules/dnbd3/module.conf.debian | 8 ++++ core/modules/dnbd3/module.conf.opensuse | 8 ++++ core/modules/dnbd3/module.conf.ubuntu | 9 +++++ 12 files changed, 124 insertions(+) create mode 100644 core/modules/dnbd3/TODO create mode 100644 core/modules/dnbd3/data/etc/fuse.conf create mode 100644 core/modules/dnbd3/data/etc/systemd/system/setup-dnbd3.service create mode 120000 core/modules/dnbd3/data/etc/systemd/system/sysinit.target.wants/setup-dnbd3.service create mode 100644 core/modules/dnbd3/data/etc/udev/rules.d/90-dnbd3.rules create mode 100644 core/modules/dnbd3/data/opt/openslx/scripts/pam_script_auth.d/10-fuse create mode 100755 core/modules/dnbd3/data/opt/openslx/scripts/systemd-setup_dnbd3 create mode 100644 core/modules/dnbd3/module.build create mode 100644 core/modules/dnbd3/module.conf create mode 100644 core/modules/dnbd3/module.conf.debian create mode 100644 core/modules/dnbd3/module.conf.opensuse create mode 100644 core/modules/dnbd3/module.conf.ubuntu (limited to 'core/modules/dnbd3') diff --git a/core/modules/dnbd3/TODO b/core/modules/dnbd3/TODO new file mode 100644 index 00000000..6203c18f --- /dev/null +++ b/core/modules/dnbd3/TODO @@ -0,0 +1 @@ +update to new config scheme diff --git a/core/modules/dnbd3/data/etc/fuse.conf b/core/modules/dnbd3/data/etc/fuse.conf new file mode 100644 index 00000000..926d936f --- /dev/null +++ b/core/modules/dnbd3/data/etc/fuse.conf @@ -0,0 +1,8 @@ +# /etc/fuse.conf - Configuration file for Filesystem in Userspace (FUSE) + +# Set the maximum number of FUSE mounts allowed to non-root users. +# The default is 1000. +#mount_max = 1000 + +# Allow non-root users to specify the allow_other or allow_root mount options. +user_allow_other diff --git a/core/modules/dnbd3/data/etc/systemd/system/setup-dnbd3.service b/core/modules/dnbd3/data/etc/systemd/system/setup-dnbd3.service new file mode 100644 index 00000000..516cbfa2 --- /dev/null +++ b/core/modules/dnbd3/data/etc/systemd/system/setup-dnbd3.service @@ -0,0 +1,11 @@ +[Unit] +Description=Setup dnbd3 kernel module and user space daemon +After=sysinit.target +Before=shutdown.target +DefaultDependencies=no + +[Service] +ExecStart=/opt/openslx/scripts/systemd-setup_dnbd3 +ExecStop=/opt/openslx/bin/dnbd3-client --kill +ExecStopPost=/opt/openslx/bin/rm /var/run/dnbd3.socket +Restart=on-abort diff --git a/core/modules/dnbd3/data/etc/systemd/system/sysinit.target.wants/setup-dnbd3.service b/core/modules/dnbd3/data/etc/systemd/system/sysinit.target.wants/setup-dnbd3.service new file mode 120000 index 00000000..05dd4ac2 --- /dev/null +++ b/core/modules/dnbd3/data/etc/systemd/system/sysinit.target.wants/setup-dnbd3.service @@ -0,0 +1 @@ +../setup-dnbd3.service \ No newline at end of file diff --git a/core/modules/dnbd3/data/etc/udev/rules.d/90-dnbd3.rules b/core/modules/dnbd3/data/etc/udev/rules.d/90-dnbd3.rules new file mode 100644 index 00000000..0eb1f52d --- /dev/null +++ b/core/modules/dnbd3/data/etc/udev/rules.d/90-dnbd3.rules @@ -0,0 +1 @@ +KERNEL=="dnbd*", SUBSYSTEM=="block", MODE="0664" diff --git a/core/modules/dnbd3/data/opt/openslx/scripts/pam_script_auth.d/10-fuse b/core/modules/dnbd3/data/opt/openslx/scripts/pam_script_auth.d/10-fuse new file mode 100644 index 00000000..85d8a75a --- /dev/null +++ b/core/modules/dnbd3/data/opt/openslx/scripts/pam_script_auth.d/10-fuse @@ -0,0 +1,6 @@ + +adduser "${PAM_USER}" "fuse" +ret=$? +[ "$ret" -ne "0" ] && slxlog "pam-auth-fuse" "Could not add $PAM_USER to group 'fuse'" +true + diff --git a/core/modules/dnbd3/data/opt/openslx/scripts/systemd-setup_dnbd3 b/core/modules/dnbd3/data/opt/openslx/scripts/systemd-setup_dnbd3 new file mode 100755 index 00000000..e519b1b8 --- /dev/null +++ b/core/modules/dnbd3/data/opt/openslx/scripts/systemd-setup_dnbd3 @@ -0,0 +1,16 @@ +#!/bin/ash + +if ! insmod /lib/modules/dnbd3/dnbd3.ko; then + slxlog "dnbd3-kernel" "Error loading dnbd3 client kernel module" + exit 1 +fi + +[ -e "/dev/dnbd0" ] || exit 1 +for i in /dev/dnbd*; do + echo 8192 > "/sys/block/dnbd${i#/dev/dnbd}/queue/nr_requests" +done + +exec /opt/openslx/bin/dnbd3-client --daemon +slxlog "dnbd3-daemon" "Error launching dnbd3-client daemon" +exit 1 + diff --git a/core/modules/dnbd3/module.build b/core/modules/dnbd3/module.build new file mode 100644 index 00000000..e7c91f45 --- /dev/null +++ b/core/modules/dnbd3/module.build @@ -0,0 +1,45 @@ +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" <