usr/src/cmd/install-tools/usbcopy
changeset 1769 36ef49b30618
parent 1617 0a764388bf3b
--- a/usr/src/cmd/install-tools/usbcopy	Thu Aug 23 11:38:47 2012 -0700
+++ b/usr/src/cmd/install-tools/usbcopy	Thu Aug 23 14:23:37 2012 -0700
@@ -96,7 +96,7 @@
     # 191  0      0     0     0    0     0     0    (a)+(b):(c)   diskblocks-(c)
     solstart=$(($mbrnblocks + $uefinblocks))
     solnblocks=$(($devblocks - $solstart))
-    addsolpart="191:0:0:0:0:0:0:0:$solstart:$solnblocks"
+    addsolpart="191:128:0:0:0:0:0:0:$solstart:$solnblocks"
     fdisk -A $addsolpart $dev
 
     # fdisk is stupid and overwrites the MBR boot code region with mboot so we
@@ -189,6 +189,8 @@
 bdev=${dev/rdsk/dsk}
 s0cdev=${dev/p0/s0}
 s0bdev=${s0cdev/rdsk/dsk}
+p2cdev=${dev/p0/p2}
+p2bdev=${p2cdev/rdsk/dsk}
 mountdev=${s0bdev/s0}
 if [ ! -b $s0bdev ] || [ ! -c $s0cdev ]; then
 	echo "Missing device nodes for $dev"
@@ -280,6 +282,11 @@
     error_handler "Failed to find boot loader configuration"
 fi
 
+# Remove the PBR from the Solaris partition to ensure no stray data confuses
+# some BIOSes
+dd if=/dev/zero of=${p2bdev} count=1 > /dev/null 2>&1
+[[ $? -ne 0 ]] && { echo Failed to zero Solaris PBR on USB device. ; exit 1; }
+ 
 # Now create root partition.  We want to find number of cylinders in backup
 # partition from label created by fdisk and then generate root partition
 # using whole disk minus cylinder 1