mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 22:51:03 +02:00
fix(common): Read mounts from /proc/self/mounts
Just in case the filesystem view is slightly different.
This commit is contained in:
parent
ee3fc09057
commit
b9257ee2a8
@ -643,7 +643,7 @@ sub_mounts() {
|
|||||||
# will). As such, we have to unmount in reverse order to cleanly
|
# will). As such, we have to unmount in reverse order to cleanly
|
||||||
# unmount submounts (think /dev/pts and /dev).
|
# unmount submounts (think /dev/pts and /dev).
|
||||||
awk -v path=$1 -v len="${#1}" \
|
awk -v path=$1 -v len="${#1}" \
|
||||||
'(substr($2, 1, len) == path) { print $2 }' /proc/mounts | \
|
'(substr($2, 1, len) == path) { print $2 }' /proc/self/mounts | \
|
||||||
tac | \
|
tac | \
|
||||||
sed -e 's/\\040(deleted)$//'
|
sed -e 's/\\040(deleted)$//'
|
||||||
# Hack(zbehan): If a bind mount's source is mysteriously removed,
|
# Hack(zbehan): If a bind mount's source is mysteriously removed,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user