Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ev3-toolbox-matlab
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mindstorms
ev3-toolbox-matlab
Commits
5c97a606
Commit
5c97a606
authored
3 years ago
by
Dominik Mehlem
Browse files
Options
Downloads
Patches
Plain Diff
fix bug that deletes work directory on fully persistent USB drives
parent
aecd305b
No related branches found
No related tags found
1 merge request
!12
fix bug that deletes work directory on fully persistent USB drives
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/rc.local.sh
+4
-1
4 additions, 1 deletion
tools/rc.local.sh
with
4 additions
and
1 deletion
tools/rc.local.sh
+
4
−
1
View file @
5c97a606
...
@@ -19,6 +19,7 @@ sudo chown -R mindstorms:mindstorms ${DOCUMENTATION_DIR}
...
@@ -19,6 +19,7 @@ sudo chown -R mindstorms:mindstorms ${DOCUMENTATION_DIR}
# in any local partition.
# in any local partition.
# If it exists, mount it to /home/mindstorms/work.
# If it exists, mount it to /home/mindstorms/work.
# Also try to find mindstorms.swp files to use as swap space.
# 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
mkdir
-p
/mnt/localfs /home/mindstorms/work
chmod
700 /mnt
chmod
700 /mnt
...
@@ -45,6 +46,7 @@ shopt -u globstar # disallow '**' path expansion
...
@@ -45,6 +46,7 @@ shopt -u globstar # disallow '**' path expansion
# Look for partition labels "casper-rw" (Easy2Boot persistence)
# Look for partition labels "casper-rw" (Easy2Boot persistence)
echo
"Looking for Easy2Boot persistence partitions..."
echo
"Looking for Easy2Boot persistence partitions..."
E2BUDEV
=
"/etc/udev/rules.d/999-easy2boot-permissions.rules"
E2BUDEV
=
"/etc/udev/rules.d/999-easy2boot-permissions.rules"
PERSISTENT
=
false
rm
$E2BUDEV
rm
$E2BUDEV
for
PART
in
/dev/disk/by-id/
*
;
do
for
PART
in
/dev/disk/by-id/
*
;
do
DEVICE
=
"
$(
readlink
-f
"
$PART
"
)
"
DEVICE
=
"
$(
readlink
-f
"
$PART
"
)
"
...
@@ -55,6 +57,7 @@ for PART in /dev/disk/by-id/*; do
...
@@ -55,6 +57,7 @@ for PART in /dev/disk/by-id/*; do
echo
"KERNEL==
\"
$EASY2BOOT
\"
, SUBSYSTEM==
\"
block
\"
, SUBSYSTEMS==
\"
usb
\"
, ENV{UDISKS_IGNORE}=
\"
1
\"
"
>>
$E2BUDEV
echo
"KERNEL==
\"
$EASY2BOOT
\"
, SUBSYSTEM==
\"
block
\"
, SUBSYSTEMS==
\"
usb
\"
, ENV{UDISKS_IGNORE}=
\"
1
\"
"
>>
$E2BUDEV
# gnome is stupid and seems to need an fstab entry
# gnome is stupid and seems to need an fstab entry
echo
"
$DEVICE
/mnt/persist auto nosuid,nodev,nofail,noauto 0 0"
>>
/etc/fstab
echo
"
$DEVICE
/mnt/persist auto nosuid,nodev,nofail,noauto 0 0"
>>
/etc/fstab
PERSISTENT
=
true
break
break
fi
fi
done
done
...
@@ -134,7 +137,7 @@ for SWP in /mnt/localfs/*/mindstorms.swp; do
...
@@ -134,7 +137,7 @@ for SWP in /mnt/localfs/*/mindstorms.swp; do
done
done
# Remove work directory if not mounted
# 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."
echo
"Removing work directory as no available mountpoint found."
rm
-rf
/home/mindstorms/work
rm
-rf
/home/mindstorms/work
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment