Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortWINE-old
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
PortWINE-old
Commits
9440a0d9
Unverified
Commit
9440a0d9
authored
Jul 21, 2024
by
Boris Yumankulov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finally fixed duplicates of sd cards and flash drives (SteamDeck)
parent
95f51b9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
16 deletions
+31
-16
functions_helper
data_from_portwine/scripts/functions_helper
+31
-16
No files found.
data_from_portwine/scripts/functions_helper
View file @
9440a0d9
...
...
@@ -1260,26 +1260,41 @@ check_dirs_and_files_in_pfx () {
fi
DRIVES
=(
d e f g i j k l m n o p q r s t u v w x y
)
DEF_MOUNT_DIRS
=(
'/media'
"/media/
$USER
"
'/mnt'
'/run/media'
"/run/media/
$USER
"
)
MOUNT_DIRS
=(
$(
find
"
${
DEF_MOUNT_DIRS
[@]
}
"
-maxdepth
1
-type
d 2>/dev/null |
sort
-u
)
)
DEF_MOUNT_DIRS
=(
'/media'
'/mnt'
'/run/media'
)
MOUNT_DIRS
=(
$(
find
"
${
DEF_MOUNT_DIRS
[@]
}
"
-maxdepth
1
-mindepth
1
-type
d 2>/dev/null |
sort
-u
)
)
rm
-f
"
${
WINEPREFIX
}
/dosdevices/com"
*
rm
-f
"
${
WINEPREFIX
}
/dosdevices/"
*
::
rm
-fv
"
${
WINEPREFIX
}
/dosdevices/"
*
::
for
drive
in
"
${
DRIVES
[@]
}
"
;
do
rm
-f
v
"
${
WINEPREFIX
}
/dosdevices/
${
drive
}
:"
2>/dev/null
rm
-f
"
${
WINEPREFIX
}
/dosdevices/
${
drive
}
:"
done
for
drive_dir
in
"
${
MOUNT_DIRS
[@]
}
"
;
do
if
[[
!
"
${
DEF_MOUNT_DIRS
[@]
}
"
=
~
"
$drive_dir
"
]]
\
&&
!
realpath
"
${
WINEPREFIX
}
/dosdevices"
/
*
: |
grep
-w
"
$drive_dir
$"
&>/dev/null
;
then
drive_num
=
0
while
[[
"
$drive_num
"
-lt
"
${#
DRIVES
[@]
}
"
]]
;
do
drive_path
=
"
${
WINEPREFIX
}
/dosdevices/
${
DRIVES
[
$drive_num
]
}
:"
if
[
!
-d
"
$drive_path
"
]
;
then
ln
-sf
"
$drive_dir
"
"
$drive_path
"
break
else
((
drive_num++
))
fi
done
if
mountpoint
-q
"
$drive_dir
"
;
then
if
!
realpath
"
${
WINEPREFIX
}
/dosdevices"
/
*
: |
grep
-w
"
$drive_dir
$"
&>/dev/null
;
then
drive_num
=
0
while
[[
"
$drive_num
"
-lt
"
${#
DRIVES
[@]
}
"
]]
;
do
drive_path
=
"
${
WINEPREFIX
}
/dosdevices/
${
DRIVES
[
$drive_num
]
}
:"
mount_point
=
$(
df
-P
"
$drive_dir
"
|
awk
'NR==2 {print $1}'
)
mount_name
=
$(
lsblk
-no
pkname
"
$mount_point
"
2>/dev/null
)
if
[[
!
-L
"
$drive_path
"
]]
;
then
if
[[
$(
cat
"/sys/class/block/
$mount_name
/removable"
)
!=
"1"
]]
2>/dev/null
;
then
if
[[
!
$(
echo
"
$mount_point
"
|
grep
"mmc"
)
]]
2>/dev/null
;
then
ln
-sf
"
$drive_dir
"
"
$drive_path
"
break
else
((
drive_num++
))
fi
else
((
drive_num++
))
fi
else
((
drive_num++
))
fi
done
fi
fi
done
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment