summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiago2014-08-06 15:40:49 +0200
committerMichael Pereira Neves2014-10-28 14:19:55 +0100
commit3ca99e519e3aec5027474a9fe89c646036bafb8c (patch)
tree87b4a9d729b11cf43cab923fefd199e8d563430a
parent[dnbd3-cache]include dnbd-server add service file (diff)
downloadtm-scripts-3ca99e519e3aec5027474a9fe89c646036bafb8c.tar.gz
tm-scripts-3ca99e519e3aec5027474a9fe89c646036bafb8c.tar.xz
tm-scripts-3ca99e519e3aec5027474a9fe89c646036bafb8c.zip
[dnbd3-cache] partition script changed
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions49
-rw-r--r--server/modules/dnbd3-cache/opt/openslx/dnbd3-cache/server.conf2
-rwxr-xr-xserver/modules/dnbd3-cache/opt/openslx/scripts/systemd-setup_dnbd3_cache2
3 files changed, 40 insertions, 13 deletions
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
index f9640589..26d1c753 100755
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
+++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
@@ -14,8 +14,10 @@
#############################################################################
-# Mount point for persistent scratch partition (type 45)
-PERSISTENT="/opt/openslx/persistent"
+# Mount point for persistent scratch partition (type 43 for BOOT, type42 for CACHE, type 41 for HOME)
+PERSISTENT_BOOT="/boot"
+PERSISTENT_CACHE="/cache"
+PERSISTENT_HOME="/home"
# General formatter for the /tmp partition on a local harddisk
diskfm () {
@@ -120,20 +122,43 @@ done
# Put detected linux partitions (83) into /etc/fstab with "noauto", special
# partition 45 (persistent scratch) to /var/scratch and 46 to /var/openslx
-HAVE_PERSISTENT=no
-for partid in 83 45 46 ; do
+HAVE_PERSISTENT_BOOT=no
+HAVE_PERSISTENT_CACHE=no
+HAVE_PERSISTENT_HOME=no
+for partid in 83 49 48 47 46 44 ; do
for hdpartnr in $(sed -n -e "/ ${partid} /p" "/etc/disk.partition" | sed -e "s/[[:space:]].*//"); do
if [ "${partid}" -eq 83 ]; then
mkdir -p "/media/${hdpartnr#/dev/*}"
echo -e "${hdpartnr}\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto,noexec\t 0 0" >> "/etc/fstab"
- elif [ "${partid}" -eq 45 -a "$HAVE_PERSISTENT" = "no" ]; then
- mkdir -p "$PERSISTENT"
- if ! mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT"; then
+
+ elif [ "${partid}" -eq 49 -a "$HAVE_PERSISTENT_BOOT" = "no" ]; then
+ mkdir -p "$PERSISTENT_BOOT"
+ if ! mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT_BOOT"; then
diskfm "$hdpartnr" "jfs xfs ext3" || continue
- mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT" || continue
+ mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT_BOOT" || continue
fi
- HAVE_PERSISTENT=yes
- echo -e "${hdpartnr}\t${PERSISTENT}\tauto\t\tnoauto,noexec\t\t 0 0" >> "/etc/fstab"
+ HAVE_PERSISTENT_BOOT=yes
+ echo -e "${hdpartnr}\t${PERSISTENT_BOOT}\tauto\t\tnoauto,noexec\t\t 0 0" >> "/etc/fstab"
+
+ elif [ "${partid}" -eq 48 -a "$HAVE_PERSISTENT_CACHE" = "no" ]; then
+ mkdir -p "$PERSISTENT_CACHE"
+ if ! mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT_CACHE"; then
+ diskfm "$hdpartnr" "jfs xfs ext3" || continue
+ mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT_CACHE" || continue
+ fi
+ HAVE_PERSISTENT_CACHE=yes
+ echo -e "${hdpartnr}\t${PERSISTENT_CACHE}\tauto\t\tnoauto,noexec\t\t 0 0" >> "/etc/fstab"
+
+ elif [ "${partid}" -eq 47 -a "$HAVE_PERSISTENT_HOME" = "no" ]; then
+ mkdir -p "$PERSISTENT_HOME"
+ if ! mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT_HOME"; then
+ diskfm "$hdpartnr" "jfs xfs ext3" || continue
+ mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT_HOME" || continue
+ fi
+ HAVE_PERSISTENT_HOME=yes
+ echo -e "${hdpartnr}\t${PERSISTENT_HOME}\tauto\t\tnoauto,noexec\t\t 0 0" >> "/etc/fstab"
+
+
elif [ "${partid}" -eq 46 ]; then
mkdir -p "/media/${hdpartnr#/dev/*}"
#mount -t auto ${hdpartnr} /mnt/media/${hdpartnr#/dev/*} \n\
@@ -143,7 +168,9 @@ for partid in 83 45 46 ; do
fi
done
done
-[ "$HAVE_PERSISTENT" = "no" -a -d "$PERSISTENT" ] && rm -f "$PERSISTENT"
+[ "$HAVE_PERSISTENT_BOOT" = "no" -a -d "$PERSISTENT_BOOT" ] && rm -f "$PERSISTENT_BOOT"
+[ "$HAVE_PERSISTENT_CACHE" = "no" -a -d "$PERSISTENT_CACHE" ] && rm -f "$PERSISTENT_CACHE"
+[ "$HAVE_PERSISTENT_HOME" = "no" -a -d "$PERSISTENT_HOME" ] && rm -f "$PERSISTENT_HOME"
mount -a
diff --git a/server/modules/dnbd3-cache/opt/openslx/dnbd3-cache/server.conf b/server/modules/dnbd3-cache/opt/openslx/dnbd3-cache/server.conf
index 53f5902d..c0820ea1 100644
--- a/server/modules/dnbd3-cache/opt/openslx/dnbd3-cache/server.conf
+++ b/server/modules/dnbd3-cache/opt/openslx/dnbd3-cache/server.conf
@@ -2,7 +2,7 @@
#vmdkLegacyMode=TRUE
#clientPenalty=300000
clientPenalty=0
-basePath=/tmp/export/dnbd3
+basePath=/cache/export/dnbd3
isProxy=true
proxyPrivateOnly=true
uplinkTimeout=5000
diff --git a/server/modules/dnbd3-cache/opt/openslx/scripts/systemd-setup_dnbd3_cache b/server/modules/dnbd3-cache/opt/openslx/scripts/systemd-setup_dnbd3_cache
index 472a4622..705c5c89 100755
--- a/server/modules/dnbd3-cache/opt/openslx/scripts/systemd-setup_dnbd3_cache
+++ b/server/modules/dnbd3-cache/opt/openslx/scripts/systemd-setup_dnbd3_cache
@@ -1,6 +1,6 @@
#!/bin/ash
-[ -d "/tmp/export/dnbd3" ] || mkdir -p /tmp/export/dnbd3/
+[ -d "/cache/export/dnbd3" ] || mkdir -p /cache/export/dnbd3/
exec dnbd3-server -c /opt/openslx/dnbd3-cache -n
slxlog "dnbd3-server" "Error launching dnbd3-server"