diff options
author | gw25295 <none@none> | 2008-07-07 17:08:29 -0700 |
---|---|---|
committer | gw25295 <none@none> | 2008-07-07 17:08:29 -0700 |
commit | cec46707a82764ff5f9b843964ebdf86ffd0e4d6 (patch) | |
tree | 7bfe80cddfccf82306b93ef8757fd9e5124c986b /usr/src | |
parent | 56d55a5391b4507b679f3d8e08cc28fbe2be62b9 (diff) | |
download | illumos-gate-cec46707a82764ff5f9b843964ebdf86ffd0e4d6.tar.gz |
6680633 zfs SPARC disk layout causes boot header and bootblk to claim blocks 15-31
6718165 installboot usage not updated to include changes to support ZFS boot
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/psm/stand/bootblks/ufs/sparc/installboot.sh | 21 | ||||
-rw-r--r-- | usr/src/psm/stand/bootblks/zfs/common/boot-zfs.fth | 4 | ||||
-rw-r--r-- | usr/src/tools/scripts/bfu.sh | 9 |
3 files changed, 27 insertions, 7 deletions
diff --git a/usr/src/psm/stand/bootblks/ufs/sparc/installboot.sh b/usr/src/psm/stand/bootblks/ufs/sparc/installboot.sh index 98a0571c9e..85dcfb2bd4 100644 --- a/usr/src/psm/stand/bootblks/ufs/sparc/installboot.sh +++ b/usr/src/psm/stand/bootblks/ufs/sparc/installboot.sh @@ -32,21 +32,21 @@ away() { } COUNT=15 +FSTYPE=ufs while getopts F: a; do + case $a in F) case $OPTARG in - ufs) COUNT=15;; - hsfs) COUNT=15;; - zfs) COUNT=31;; + ufs|hsfs|zfs) FSTYPE=$OPTARG;; *) away 1 "$OPTARG: Unknown fstype";; esac;; - ?) away 1 "unknows fstype: $fs" + ?) away 1 "unknown fstype: $fs" esac done shift `expr $OPTIND - 1` -Usage="Usage: `basename $0` bootblk raw-device" +Usage="Usage: `basename $0` [-F fstype] bootblk raw-device" test $# -ne 2 && away 1 "$Usage" @@ -59,4 +59,15 @@ test ! -w $DEVICE && away 1 "$DEVICE: Not writeable" # label at block 0, bootblk from block 1 through 15 stderr=`dd if=$BOOTBLK of=$DEVICE bs=1b oseek=1 count=$COUNT conv=sync 2>&1` err=$? ; test $err -ne 0 && away $err "$stderr" + +# +# The ZFS boot block is larger than what will fit into the first 7.5K so +# we break it up and write the remaining portion into the ZFS provided boot +# block region at offset 512K +# +if [ $FSTYPE = "zfs" ]; then + stderr=`dd if=$BOOTBLK of=$DEVICE bs=1b iseek=$COUNT oseek=1024 \ + count=16 conv=sync 2>&1` + err=$? ; test $err -ne 0 && away $err "$stderr" +fi exit 0 diff --git a/usr/src/psm/stand/bootblks/zfs/common/boot-zfs.fth b/usr/src/psm/stand/bootblks/zfs/common/boot-zfs.fth index 2f64847f90..a3ba4b790a 100644 --- a/usr/src/psm/stand/bootblks/zfs/common/boot-zfs.fth +++ b/usr/src/psm/stand/bootblks/zfs/common/boot-zfs.fth @@ -33,7 +33,9 @@ copyright: Copyright 2006 Sun Microsystems, Inc. All Rights Reserved create doheaders create bigbootblk d# 8192 constant /fs-fcode -d# 8192 constant fs-offset + +\ Set the offset to the correct zfs boot block area. This area is at offset 512K +d# 512 d# 1024 * constant fs-offset \ for [ifdef] zfs create zfs diff --git a/usr/src/tools/scripts/bfu.sh b/usr/src/tools/scripts/bfu.sh index a2ec3fa399..c4b6f1e7a6 100644 --- a/usr/src/tools/scripts/bfu.sh +++ b/usr/src/tools/scripts/bfu.sh @@ -7442,11 +7442,18 @@ mondo_loop() { case $target_isa in sparc) if [[ "$rootfstype" = zfs ]]; then + print "Extracting usr/sbin/installboot for " \ + "zfs boot block installation ... \c" | + tee -a $EXTRACT_LOG + do_extraction $cpiodir/generic.usr$ZFIX \ + 'usr/sbin/installboot' | \ + tee -a $EXTRACT_LOG cd $usr/platform/$karch/lib/fs/zfs get_rootdev_list | while read physlice do print "Installing bootblk on $physlice." - installboot -F zfs ./bootblk $physlice + $usr/sbin/installboot -F zfs ./bootblk \ + $physlice done elif [[ "$rootslice" = /dev/rdsk/* ]]; then print "Installing boot block on $rootslice." |