Skip to contentSkip to conversation

ver_linux: Print filesystems

PATCH Superseded Petr Vorel 2 participants 3 messages Oct 27, 2021 – Nov 3, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 ver_linux: Print filesystems

both available and mounted.

-T option is not implemented on all df implementations
(on busybox only with IF_FEATURE_HUMAN_READABLE, also aosp toybox does not support it), thus fallback without it.

---
 ver_linux | 12 ++++++++++++
 1 file changed, 12 insertions(+)
ver_linux +12 -0
index 824c39510..abaa30a4c 100755
@@ -138,6 +138,18 @@ echo
 echo 'cpuinfo:'
 tst_cmd_run lscpu || cat /proc/cpuinfo
 
+echo
+echo 'available filesystems:'
+echo $(cut -f2 -d$'\t' /proc/filesystems | sort -u)
+
+echo
+echo 'mounted filesystems (/proc/mounts):'
+cat /proc/mounts
+
+echo
+echo 'mounted filesystems (df):'
+df -hT 2>/dev/null || df -h
+
 echo
 if is_enabled /sys/module/apparmor/parameters/enabled; then
 	echo 'AppArmor enabled'
Signature · 5 lines
2.33.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#1 lore raw
Quoted 16 lines

both available and mounted.

-T option is not implemented on all df implementations
(on busybox only with IF_FEATURE_HUMAN_READABLE, also aosp toybox does not support it), thus fallback without it.

---
 ver_linux | 12 ++++++++++++
 1 file changed, 12 insertions(+)
ver_linux +0 -0
index 824c39510..abaa30a4c 100755

ver_linux echo · line 143

Quoted 6 lines
ver_linux +3 -0
@@ -138,6 +138,18 @@ echo
 echo 'cpuinfo:'
 tst_cmd_run lscpu || cat /proc/cpuinfo
 
+echo
+echo 'available filesystems:'
+echo $(cut -f2 -d$'\t' /proc/filesystems | sort -u)

Actually cut uses tab delimiter as the default
=> it can be just
cut -f2 /proc/filesystems

Quoted 12 lines
ver_linux +9 -0
+
+echo
+echo 'mounted filesystems (/proc/mounts):'
+cat /proc/mounts
+
+echo
+echo 'mounted filesystems (df):'
+df -hT 2>/dev/null || df -h
+
 echo
 if is_enabled /sys/module/apparmor/parameters/enabled; then
 	echo 'AppArmor enabled'
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp