pakfire: use correct tree on x86_64.
[ipfire-2.x.git] / src / scripts / scanhd
CommitLineData
aa2870e6 1#!/bin/bash
aa2870e6
MT
2case "$1" in
3 ide)
44fb4038
AF
4 rm -f /var/ipfire/extrahd/scan
5 for DEV in `find /sys/block/* -maxdepth 0 ! -name sr* ! -name ram* ! -name loop* -exec basename {} \; | sort | uniq`
6 do
7 VENDOR=`cat /sys/block/$DEV/device/vendor 2>/dev/null`
8 MODEL=`cat /sys/block/$DEV/device/model 2>/dev/null`
9 REV=`cat /sys/block/$DEV/device/rev 2>/dev/null`
10 echo "$DEV;$VENDOR $MODEL $REV" >> /var/ipfire/extrahd/scan
11 done
aa2870e6
MT
12 ;;
13 partitions)
2e67687f 14 cat /proc/partitions | awk '{print $4 " " $3 }' | grep -v name | grep -v "^[[:space:]]*$" | \
784d72a2
MT
15 while read device size; do
16 [ -z "${device}" ] && continue
15834b62 17 echo "${device};${size};$(blkid -c /dev/null -s UUID -o value /dev/${device});"
784d72a2 18 done > /var/ipfire/extrahd/partitions
aa2870e6
MT
19 ;;
20 *)
21 echo "Usage: $0 (ide|partitions)"
22 ;;
23esac