diff options
author | Simon Rettberg | 2013-11-26 19:25:41 +0100 |
---|---|---|
committer | Simon Rettberg | 2013-11-26 19:25:41 +0100 |
commit | 12de3fe8d8616efb2b7da0e557b17982020f490f (patch) | |
tree | d863829a0716fbc3a42f396b4cb47f3c9f3af1ff /remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions | |
parent | [rfs-stage32] Add 'slxlog', a utility for remote logging (diff) | |
download | tm-scripts-12de3fe8d8616efb2b7da0e557b17982020f490f.tar.gz tm-scripts-12de3fe8d8616efb2b7da0e557b17982020f490f.tar.xz tm-scripts-12de3fe8d8616efb2b7da0e557b17982020f490f.zip |
[rfs-stage32] Add remote logging to mount_export and setup_partitions
Diffstat (limited to 'remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions')
-rwxr-xr-x | remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions | 14 |
1 files changed, 11 insertions, 3 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 0f419366..07bd628e 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,6 +14,7 @@ ############################################################################# +# Mount point for persistent scratch partition (type 45) PERSISTENT="/opt/openslx/persistent" # General formatter for the /tmp partition on a local harddisk @@ -105,20 +106,23 @@ echo "Partitions:" cat "/etc/disk.partition" # Check for standard swap partitions and make them available to the system +HAVE_SWAP=no for hdpartnr in $(sed -n -e "/ 82 /p" "/etc/disk.partition" | sed -e "s/[[:space:]].*//"); do echo -e "$hdpartnr\tswap\t\tswap\t\tdefaults\t 0 0" >> "/etc/fstab" - swapon "$hdpartnr" -p 10 + swapon "$hdpartnr" -p 10 && HAVE_SWAP=yes done # We use special non assigned partition type (id44) for harddisk scratch # space, thus no normal filesystem will be incidentally deleted or # corrupted +HAVE_TEMP=no for hdpartnr in $(sed -n -e "/ 44 /p" "/etc/disk.partition" | sed -e "s/[[:space:]].*//"); do # check for supported filesystem and formatter if diskfm "$hdpartnr"; then # echo "$hdpartnr is mounted to /mnt/tmp at $(sysup)" >/tmp/tmpready mount_temp "$mopt" "$hdpartnr" || continue echo -e "${hdpartnr}\t/tmp\t\tauto\t\tnoexec\t 0 0" >> "/etc/fstab" + HAVE_TEMP=yes break else echo "formatting failed for some reason" @@ -155,8 +159,12 @@ done mount -a # Make huge tmpfs if nothing could be mounted for /tmp -if [ "$(mount | grep -c "on /tmp ")" = "0" ]; then - mount_temp -t tmpfs -o size=10G none +if [ "$HAVE_TEMP" = "no" ]; then + mount_temp -t tmpfs -o size=20G none + slxlog "partition-temp" "Running /tmp on tmpfs only!" "/etc/disk.partition" +fi +if [ "$HAVE_SWAP" = "no" ]; then + slxlog "partition-swap" "Have no (formatted) swap partition, using zram swap only!" "/etc/disk.partition" fi # Add zram swap |