summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-04-29 13:05:35 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-04-29 13:05:35 +0000
commit4bcfd070120eb8be014412089aee474b6b85a1ed (patch)
tree90a7aff38aa25a14fbfcbbf787d82c8f77ed0269
parentca32c5f76f5281b23fc93b8bc7ff6afdea5d23fc (diff)
downloadalpine-conf-4bcfd070120eb8be014412089aee474b6b85a1ed.zip
setup-disk: show more info about disk
-rw-r--r--setup-disk.in9
1 files 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
}