Commit 5cdbc3d5 authored by Oliver Christoph Johannes Rippel's avatar Oliver Christoph Johannes Rippel
Browse files

Merge branch 'dev_bugfix-fully-persistent-sticks' into 'master'

fix bug that deletes work directory on fully persistent USB drives

See merge request !12
parents aecd305b 5c97a606
......@@ -19,6 +19,7 @@ sudo chown -R mindstorms:mindstorms ${DOCUMENTATION_DIR}
# in any local partition.
# If it exists, mount it to /home/mindstorms/work.
# Also try to find mindstorms.swp files to use as swap space.
# Also checks for persistent drives on E2B-USB-stick
mkdir -p /mnt/localfs /home/mindstorms/work
chmod 700 /mnt
......@@ -45,6 +46,7 @@ shopt -u globstar # disallow '**' path expansion
# Look for partition labels "casper-rw" (Easy2Boot persistence)
echo "Looking for Easy2Boot persistence partitions..."
E2BUDEV="/etc/udev/rules.d/999-easy2boot-permissions.rules"
PERSISTENT=false
rm $E2BUDEV
for PART in /dev/disk/by-id/*; do
DEVICE="$( readlink -f "$PART" )"
......@@ -55,6 +57,7 @@ for PART in /dev/disk/by-id/*; do
echo "KERNEL==\"$EASY2BOOT\", SUBSYSTEM==\"block\", SUBSYSTEMS==\"usb\", ENV{UDISKS_IGNORE}=\"1\"" >> $E2BUDEV
# gnome is stupid and seems to need an fstab entry
echo "$DEVICE /mnt/persist auto nosuid,nodev,nofail,noauto 0 0" >> /etc/fstab
PERSISTENT=true
break
fi
done
......@@ -134,7 +137,7 @@ for SWP in /mnt/localfs/*/mindstorms.swp; do
done
# Remove work directory if not mounted
if ! mountpoint -q /home/mindstorms/work; then
if [! mountpoint -q /home/mindstorms/work] && [! PERSISTENT]; then
echo "Removing work directory as no available mountpoint found."
rm -rf /home/mindstorms/work
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment