bin/149749: pc-sysinstall patch to add support for install to memory disks

John Hixson john at ixsystems.com
Tue Aug 17 19:40:06 UTC 2010


>Number:         149749
>Category:       bin
>Synopsis:       pc-sysinstall patch to add support for install to memory disks
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 17 19:40:05 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     John Hixson
>Release:        9.0-CURRENT
>Organization:
iXsystems
>Environment:
FreeBSD thinkbsd 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Tue Jul 13 09:31:39 PDT 2010     john at thinkbsd:/usr/src/sys/amd64/compile/THINKBSD  amd64
>Description:
Added "-m" option to "disk-list" to list memory disks along with standard disks.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -urN usr.sbin/pc-sysinstall.zpool/backend-query/disk-info.sh usr.sbin/pc-sysinstall/backend-query/disk-info.sh
--- usr.sbin/pc-sysinstall.zpool/backend-query/disk-info.sh	2010-06-27 09:46:11.000000000 -0700
+++ usr.sbin/pc-sysinstall/backend-query/disk-info.sh	2010-08-16 19:06:18.000000000 -0700
@@ -54,15 +54,18 @@
 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 -urN usr.sbin/pc-sysinstall.zpool/backend-query/disk-list.sh usr.sbin/pc-sysinstall/backend-query/disk-list.sh
--- usr.sbin/pc-sysinstall.zpool/backend-query/disk-list.sh	2010-06-27 09:46:11.000000000 -0700
+++ usr.sbin/pc-sysinstall/backend-query/disk-list.sh	2010-08-17 12:27:39.000000000 -0700
@@ -25,8 +25,18 @@
 #
 # $FreeBSD: src/usr.sbin/pc-sysinstall/backend-query/disk-list.sh,v 1.2 2010/06/27 16:46:11 imp Exp $
 
+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 @@
   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 -urN usr.sbin/pc-sysinstall.zpool/pc-sysinstall/pc-sysinstall.sh usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh
--- usr.sbin/pc-sysinstall.zpool/pc-sysinstall/pc-sysinstall.sh	2010-07-19 16:16:12.000000000 -0700
+++ usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	2010-08-16 18:52:27.000000000 -0700
@@ -143,7 +143,7 @@
   ;;
 
   # 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


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list