diff options
author | Lucas Affonso Xavier de Morais | 2014-08-18 17:11:14 +0200 |
---|---|---|
committer | Michael Pereira Neves | 2014-10-28 14:14:49 +0100 |
commit | 004ee196601fc71dc6c80ca3e916639c0bd7f504 (patch) | |
tree | 4869ae732fe6b5f2e8ed44da93e82d53aa641d35 /remote/rootfs/rootfs-stage32 | |
parent | [partitioner] freespace check done. (diff) | |
download | tm-scripts-004ee196601fc71dc6c80ca3e916639c0bd7f504.tar.gz tm-scripts-004ee196601fc71dc6c80ca3e916639c0bd7f504.tar.xz tm-scripts-004ee196601fc71dc6c80ca3e916639c0bd7f504.zip |
[partitioner] setup_partitions changes copied from 'client-cache' branch.
Diffstat (limited to 'remote/rootfs/rootfs-stage32')
-rwxr-xr-x | remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions | 52 |
1 files changed, 39 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..8a541d56 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 49 for BOOT, type48 for CACHE, type 47 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; 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 @@ -156,5 +183,4 @@ if [ "$HAVE_SWAP" = "no" ]; then slxlog "partition-swap" "Have no (formatted) swap partition, using zram swap only!" "/etc/disk.partition" fi -exit 0 - +exit 0
\ No newline at end of file |