From owner-svn-ports-all@FreeBSD.ORG Tue Jul 15 17:52:11 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC7234F3; Tue, 15 Jul 2014 17:52:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0C1421D5; Tue, 15 Jul 2014 17:52:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6FHqBA6010164; Tue, 15 Jul 2014 17:52:11 GMT (envelope-from kmoore@svn.freebsd.org) Received: (from kmoore@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6FHqBBR010160; Tue, 15 Jul 2014 17:52:11 GMT (envelope-from kmoore@svn.freebsd.org) Message-Id: <201407151752.s6FHqBBR010160@svn.freebsd.org> From: Kris Moore Date: Tue, 15 Jul 2014 17:52:11 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r361988 - in head/sysutils/grub2-pcbsd: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 17:52:11 -0000 Author: kmoore Date: Tue Jul 15 17:52:10 2014 New Revision: 361988 URL: http://svnweb.freebsd.org/changeset/ports/361988 QAT: https://qat.redports.org/buildarchive/r361988/ Log: - Update patches to set default boot-environment based upon output of the 'beadm' command - Bump PORTREV Modified: head/sysutils/grub2-pcbsd/Makefile head/sysutils/grub2-pcbsd/files/00_header.in head/sysutils/grub2-pcbsd/files/10_ktrueos.in Modified: head/sysutils/grub2-pcbsd/Makefile ============================================================================== --- head/sysutils/grub2-pcbsd/Makefile Tue Jul 15 17:48:40 2014 (r361987) +++ head/sysutils/grub2-pcbsd/Makefile Tue Jul 15 17:52:10 2014 (r361988) @@ -3,7 +3,7 @@ PORTNAME= grub2-pcbsd PORTVERSION= 2.02p -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= http://www.pcbsd.org/~kris/software/ \ ftp://ftp.pcbsd.org/pub/software/ Modified: head/sysutils/grub2-pcbsd/files/00_header.in ============================================================================== --- head/sysutils/grub2-pcbsd/files/00_header.in Tue Jul 15 17:48:40 2014 (r361987) +++ head/sysutils/grub2-pcbsd/files/00_header.in Tue Jul 15 17:52:10 2014 (r361988) @@ -38,7 +38,26 @@ for i in ${GRUB_PRELOAD_MODULES} ; do echo "insmod $i" done -if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi +# If GRUB_DEFAULT is unset, lets figure out which beadm wants to use by default +if [ "x${GRUB_DEFAULT}" = "x" ] ; then + GRUB_DEFAULT=0 + beCount=0 + beadm list -H >/tmp/.grub-beadm.$$ 2>/dev/null + while read line + do + flags=`echo $line | awk '{print $2}'` + + # Is this BE marked as wanting to be used for next boot? Make it default if so + if [ "$flags" = "NR" -o "$flags" = "R" ] ; then + GRUB_DEFAULT="$beCount" + break + fi + + # Moving onto next target + beCount=`expr $beCount + 1` + done < /tmp/.grub-beadm.$$ + rm /tmp/.grub-beadm.$$ +fi if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then GRUB_DEFAULT='${saved_entry}' ; fi if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=auto ; fi Modified: head/sysutils/grub2-pcbsd/files/10_ktrueos.in ============================================================================== --- head/sysutils/grub2-pcbsd/files/10_ktrueos.in Tue Jul 15 17:48:40 2014 (r361987) +++ head/sysutils/grub2-pcbsd/files/10_ktrueos.in Tue Jul 15 17:52:10 2014 (r361988) @@ -156,8 +156,8 @@ detect_beadm() fi # Get list of beadm datasets - for b in `${BEADM} list 2>/dev/null| grep -v "Created" | cut -d ' ' -f 1` - do + for b in `${BEADM} list -H 2>/dev/null | awk '{print $1}'` + do # Got a beadm snapshot, lets get the complete dataset name beLine=`${BEADM} list -a | grep "/$BEDS/${b}"` cdataset=`echo $beLine | awk '{print $1}'`