chiark / gitweb /
[PATCH] add test for make -j4 to build-check
[elogind.git] / test / show_all_devices.sh
1 #! /bin/bash
2 #
3 # Directory where sysfs is mounted
4 SYSFS_DIR=/sys
5
6 # handle block devices and their partitions
7 for i in ${SYSFS_DIR}/block/*; do
8         # each drive
9         echo ${i#${SYSFS_DIR}/block/}
10
11         # each partition, on each device
12         for j in $i/*; do
13                 if [ -f $j/dev ]; then
14                         echo ${j#${SYSFS_DIR}} | cut --delimiter='/' --fields=4-
15                 fi
16         done
17 done
18
19 # all other device classes
20 for i in ${SYSFS_DIR}/class/*; do
21         for j in $i/*; do
22                 if [ -f $j/dev ]; then
23                         echo ${j#${SYSFS_DIR}} | cut --delimiter='/' --fields=4-
24                 fi
25         done
26 done
27