Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
alpine-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
alpine-conf
Commits
a28728bc
Commit
a28728bc
authored
Oct 26, 2011
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-apkcache: search fstab for mount point first
ref #786
parent
ea514130
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
setup-apkcache.in
setup-apkcache.in
+20
-1
No files found.
setup-apkcache.in
View file @
a28728bc
...
...
@@ -22,15 +22,34 @@ is_mounted() {
awk
'{print $2}'
/proc/mounts |
grep
-q
"^
$1
$"
}
find_fstab_mount_point
()
{
local dir
=
"
$1
"
local
res
=
while
[
-n
"
$dir
"
]
;
do
res
=
$(
awk
"
\$
2 ==
\"
$dir
\"
{print
\$
2}"
/etc/fstab
)
if
[
-n
"
$res
"
]
;
then
echo
$res
return
fi
dir
=
${
dir
%/*
}
done
}
# figure out mount point
find_mount_point
()
{
local dir
=
$(
find_fstab_mount_point
$1
)
if
[
-d
"
$dir
"
]
&&
[
"
$dir
"
!=
"/"
]
;
then
echo
$dir
return
fi
local dir
=
"
$1
"
while
!
[
-d
"
$dir
"
]
;
do
dir
=
${
dir
%/*
}
done
local
fs_id
=
$(
stat
-f
-c
%i
"
$dir
"
)
local
parent
=
"
${
dir
%/*
}
"
while
[
-n
"
$
parent
"
]
&&
[
"
$(
stat
-f
-c
%i
$parent
)
"
=
"
$fs_id
"
]
;
do
while
[
-n
"
$
dir
"
]
&&
[
"
$(
stat
-f
-c
%i
$parent
/
)
"
=
"
$fs_id
"
]
;
do
dir
=
$parent
parent
=
${
parent
%/*
}
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