#!/sbin/sh -- # # Inspired by begin script from Glenn Satchell # # Label/format disks so that jumpstart will work properly # (doesn't like unlabeled disks or those with other OS's on them) # # This is BSD Licensed. # See http://www.sysdoc.org/bsd-license.html # # $Id$ set +e # don't exit on errors CMD_FILE="/tmp/format.commands" ARCH=`isainfo -k` if [ ${ARCH} = "sparcv9" ]; then echo "label" > ${CMD_FILE} FORMAT="format -s -f ${CMD_FILE} -d" SLICE="s2" elif [ ${ARCH} = "i386" ]; then FORMAT="fdisk -B" SLICE="p0" else echo "Unknown architecture" exit 1 fi for rdisk in /dev/rdsk/*${SLICE}; do if [ -c "${rdisk}" ]; then if [ ${ARCH} = "sparcv9" ]; then # format needs a disk name in the form c?t?d? rdisk=`echo ${rdisk} | sed -e 's@/dev/rdsk/@@' -e 's@s2@@'` fi echo "Labeling ${rdisk}" ${FORMAT} ${rdisk} fi done exit 0