From 4bcfd070120eb8be014412089aee474b6b85a1ed Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 29 Apr 2011 13:05:35 +0000 Subject: setup-disk: show more info about disk --- setup-disk.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setup-disk.in b/setup-disk.in index 45eb653..5e36cd9 100644 --- a/setup-disk.in +++ b/setup-disk.in @@ -362,10 +362,13 @@ init_progs() { } show_disk_info() { - local disk= + local disk= vendor= model= d= for disk in $@; do - # TODO: extend ifo with size, model etc... - echo " $disk" + d=${disk##*/} + vendor=$(cat /sys/block/$d/device/vendor 2>/dev/null) + model=$(cat /sys/block/$d/device/model 2>/dev/null) + size=$(awk '{gb = ($1 * 512)/1000000000; printf "%.1f GB\n", gb}' /sys/block/$d/size 2>/dev/null) + echo " $disk ($size $vendor $model)" done } -- cgit v1.2.3