Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Dec 2014 20:46:04 +0000 (UTC)
From:      Kris Moore <kmoore@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r374080 - in head/sysutils/grub2-pcbsd: . files
Message-ID:  <201412052046.sB5Kk4BK030613@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmoore
Date: Fri Dec  5 20:46:03 2014
New Revision: 374080
URL: https://svnweb.freebsd.org/changeset/ports/374080
QAT: https://qat.redports.org/buildarchive/r374080/

Log:
  - Update the order in which BE's are listed in generated GRUB menus
    The first item listed will be the one we are booting by default now
  - 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	Fri Dec  5 19:12:32 2014	(r374079)
+++ head/sysutils/grub2-pcbsd/Makefile	Fri Dec  5 20:46:03 2014	(r374080)
@@ -3,7 +3,7 @@
 
 PORTNAME=	grub2-pcbsd
 PORTVERSION=	2.02p
-PORTREVISION=	13
+PORTREVISION=	14
 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	Fri Dec  5 19:12:32 2014	(r374079)
+++ head/sysutils/grub2-pcbsd/files/00_header.in	Fri Dec  5 20:46:03 2014	(r374080)
@@ -44,25 +44,8 @@ else
   BEADM="beadm"
 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

Modified: head/sysutils/grub2-pcbsd/files/10_ktrueos.in
==============================================================================
--- head/sysutils/grub2-pcbsd/files/10_ktrueos.in	Fri Dec  5 19:12:32 2014	(r374079)
+++ head/sysutils/grub2-pcbsd/files/10_ktrueos.in	Fri Dec  5 20:46:03 2014	(r374080)
@@ -200,8 +200,24 @@ detect_beadm()
       NICK="TrueOS"
    fi
 
+   # Figure out which BE to list first
+   $BEADM list -H >/tmp/.grub-beadm.$$ 2>/dev/null
+   while read line
+   do
+     be=`echo $line | awk '{print $1}'`
+     flags=`echo $line | awk '{print $2}'`
+
+     # Is this BE marked as wanting to be used for next boot? Make it the first one if so
+     if [ "$flags" = "NR" -o "$flags" = "R" ] ; then
+        BE_LIST="$be $BE_LIST"
+        continue
+     fi
+     BE_LIST="$BE_LIST $be"
+   done < /tmp/.grub-beadm.$$
+   rm /tmp/.grub-beadm.$$
+
    # Get list of beadm datasets
-   for b in `${BEADM} list -H 2>/dev/null | awk '{print $1}'`
+   for b in $BE_LIST
    do 
       # Got a beadm snapshot, lets get the complete dataset name
       beLine=`${BEADM} list -a | grep "/$BEDS/${b}"`



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