16 lines
486 B
Bash
16 lines
486 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
# Docker exposes the filesystem source after the separator in mountinfo.
|
|
# A bind mount whose host source is an ext4 filesystem on zram retains that
|
|
# source; a plain host directory on the HDD must not pass this check.
|
|
awk '
|
|
$5 == "/hw/tests/tmp" {
|
|
for (i = 6; i <= NF - 2; i++) {
|
|
if ($i == "-" && $(i + 1) == "ext4" && $(i + 2) ~ /^\/dev\/zram[0-9]+$/)
|
|
found = 1
|
|
}
|
|
}
|
|
END { exit !found }
|
|
' /proc/self/mountinfo
|