diff options
author | imp <imp@FreeBSD.org> | 2010-08-19 06:07:49 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2010-08-19 06:07:49 +0000 |
commit | f8dbfee9a2b610cc9256feb35d8ef196203535d9 (patch) | |
tree | f8c407a1ab6e18628e8df649e2720869050bdb5a /usr.sbin | |
parent | 3f6646190ffb4805ef690bf3522b69f940a71a09 (diff) | |
download | FreeBSD-src-f8dbfee9a2b610cc9256feb35d8ef196203535d9.zip FreeBSD-src-f8dbfee9a2b610cc9256feb35d8ef196203535d9.tar.gz |
Added "-m" option to "disk-list" to list memory disks along with
standard disks.
PR: 149749
Submitted by: John Hixson
Diffstat (limited to 'usr.sbin')
-rwxr-xr-x | usr.sbin/pc-sysinstall/backend-query/disk-info.sh | 11 | ||||
-rwxr-xr-x | usr.sbin/pc-sysinstall/backend-query/disk-list.sh | 14 | ||||
-rwxr-xr-x | usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh | 2 |
3 files changed, 22 insertions, 5 deletions
diff --git a/usr.sbin/pc-sysinstall/backend-query/disk-info.sh b/usr.sbin/pc-sysinstall/backend-query/disk-info.sh index 643ae71..75b0cd4 100755 --- a/usr.sbin/pc-sysinstall/backend-query/disk-info.sh +++ b/usr.sbin/pc-sysinstall/backend-query/disk-info.sh @@ -54,15 +54,18 @@ HEADS="${VAL}" get_disk_sectors "${DISK}" SECS="${VAL}" -echo "cylinders=${CYLS}" -echo "heads=${HEADS}" -echo "sectors=${SECS}" # Now get the disks size in MB KB="`diskinfo -v ${1} | grep 'bytes' | cut -d '#' -f 1 | tr -s '\t' ' ' | tr -d ' '`" MB=$(convert_byte_to_megabyte ${KB}) -echo "size=$MB" # Now get the Controller Type CTYPE="`dmesg | grep "^${1}:" | grep "B <" | cut -d '>' -f 2 | cut -d ' ' -f 3-10`" + + +echo "cylinders=${CYLS}" +echo "heads=${HEADS}" +echo "sectors=${SECS}" +echo "size=$MB" echo "type=$CTYPE" + diff --git a/usr.sbin/pc-sysinstall/backend-query/disk-list.sh b/usr.sbin/pc-sysinstall/backend-query/disk-list.sh index 1b59baf..4694b1a 100755 --- a/usr.sbin/pc-sysinstall/backend-query/disk-list.sh +++ b/usr.sbin/pc-sysinstall/backend-query/disk-list.sh @@ -25,8 +25,18 @@ # # $FreeBSD$ +ARGS=$1 + # Create our device listing SYSDISK=$(sysctl -n kern.disks) +if [ "${ARGS}" = "-m" ] +then + MDS=`mdconfig -l` + if [ -n "${MDS}" ] + then + SYSDISK="${SYSDISK} ${MDS}" + fi +fi # Now loop through these devices, and list the disk drives for i in ${SYSDISK} @@ -45,6 +55,10 @@ do if [ -z "$NEWLINE" ]; then NEWLINE=" <Unknown Device>" fi + if echo "${DEV}" | grep -E '^md[0-9]+' >/dev/null 2>/dev/null + then + NEWLINE=" <Memory Disk>" + fi # Save the disk list if [ ! -z "$DLIST" ] diff --git a/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh b/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh index 3c48c48..bae78c1 100755 --- a/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh +++ b/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh @@ -143,7 +143,7 @@ case $1 in ;; # The user is wanting to query which disks are available - disk-list) ${QUERYDIR}/disk-list.sh + disk-list) ${QUERYDIR}/disk-list.sh "${2}" ;; # The user is wanting to query a disk's partitions |