summaryrefslogtreecommitdiffstats
path: root/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
diff options
context:
space:
mode:
Diffstat (limited to 'remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions')
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions49
1 files changed, 38 insertions, 11 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