Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/github/pr/7'
Browse files Browse the repository at this point in the history
  • Loading branch information
mika committed Aug 27, 2023
2 parents 6487a61 + 6146f5a commit 7397995
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions grml-hwinfo
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,9 @@ exectest() {
fi
}

# based on https://github.com/faiproject/fai/blob/master/lib/fai-disk-info
checkdisk() {
local isdisk device
while read _ _ _ device _ ; do
isdisk=1
# skip CDROMs
[ "$(stat -c %G /dev/"${device}")" = "disk" ] || isdisk=0
[ "$isdisk" -eq 1 ] && echo "$device"
done
}

disk_info() {
# the variable holds a newline separated list of devices
disklist=$(egrep ' etherd/e[[:digit:]]+\.[[:digit:]]+\b| i2o/hd.+\b| cciss/c.+d.+\b| ida/c.+d.+\b| rd/c.+d.+\b| fio.\b| hd.\b| sd[a-z]{1,2}\b|/disc\b| vd.\b| xvd.\b' /proc/partitions | checkdisk)
# the variable holds a newline separated list of disk block devices, excluding loopback and CD-ROM devices
disklist=$(lsblk -nd -o NAME -e 7,11)
}


Expand Down

0 comments on commit 7397995

Please sign in to comment.