Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Dec 2017 23:16:27 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326883 - head/tools/boot
Message-ID:  <201712152316.vBFNGRZ4041100@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri Dec 15 23:16:27 2017
New Revision: 326883
URL: https://svnweb.freebsd.org/changeset/base/326883

Log:
  For now, make the gpart commands verbose so we know exactly what's
  being installed.
  
  Fix problem with gpt + zfs installing the wrong loader...
  
  Sponsored by: Netflix

Modified:
  head/tools/boot/install-boot.sh

Modified: head/tools/boot/install-boot.sh
==============================================================================
--- head/tools/boot/install-boot.sh	Fri Dec 15 19:14:21 2017	(r326882)
+++ head/tools/boot/install-boot.sh	Fri Dec 15 23:16:27 2017	(r326883)
@@ -15,6 +15,11 @@ die() {
     exit 1
 }
 
+doit() {
+    echo $*
+    eval $*
+}
+
 find-part() {
     dev=$1
     part=$2
@@ -30,7 +35,7 @@ boot_nogeli_gpt_zfs_legacy() {
     if [ -z "$idx" ] ; then
 	die "No freebsd-boot partition found"
     fi
-    gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev
+    doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev
     exit 0
 }
 
@@ -42,7 +47,7 @@ boot_nogeli_gpt_ufs_legacy() {
     if [ -z "$idx" ] ; then
 	die "No freebsd-boot partition found"
     fi
-    gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev
+    doit gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev
     exit 0
 }
 
@@ -58,9 +63,9 @@ boot_nogeli_mbr_zfs_legacy() {
     # search to find the freebsd-zfs partition within the slice
     # Or just assume it is 'a' because it has to be since it fails otherwise
     dd if=${dst}/boot/zfsboot of=/tmp/zfsboot1 count=1
-    gpart bootcode -b /tmp/zfsboo1 ${dev}s${s}	# Put boot1 into the start of part
+    doit gpart bootcode -b /tmp/zfsboo1 ${dev}s${s}	# Put boot1 into the start of part
     sysctl kern.geom.debugflags=0x10		# Put boot2 into ZFS boot slot
-    dd if=${dst}/boot/zfsboot of=/dev/${dev}s${s} iseek=1 seek=1024
+    doit dd if=${dst}/boot/zfsboot of=/dev/${dev}s${s} iseek=1 seek=1024
     sysctl kern.geom.debugflags=0x0
 
     exit 0
@@ -70,12 +75,12 @@ boot_nogeli_mbr_ufs_legacy() {
     dev=$1
     dst=$2
 
-    gpart bootcode -b ${mbr0} ${dev}
+    doit gpart bootcode -b ${mbr0} ${dev}
     s=$(findpart $dev "freebsd-ufs")
     if [ -z "$s" ] ; then
 	die "No freebsd-zfs slice found"
     fi
-    gpart bootcode -p ${mbr2} ${dev}s${s}
+    doit gpart bootcode -p ${mbr2} ${dev}s${s}
     exit 0
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712152316.vBFNGRZ4041100>