summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorKris Moore <kmoore@FreeBSD.org>2014-12-05 20:46:03 +0000
committerKris Moore <kmoore@FreeBSD.org>2014-12-05 20:46:03 +0000
commitbd0cd2813b5642e848337deccaa1524d747931ef (patch)
treee8866612723be460ca8059e5362d7296b0c51b77 /sysutils
parentUpdate to version 3.12.2 (diff)
- 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
Notes
Notes: svn path=/head/; revision=374080
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/grub2-pcbsd/Makefile2
-rw-r--r--sysutils/grub2-pcbsd/files/00_header.in17
-rw-r--r--sysutils/grub2-pcbsd/files/10_ktrueos.in18
3 files changed, 18 insertions, 19 deletions
diff --git a/sysutils/grub2-pcbsd/Makefile b/sysutils/grub2-pcbsd/Makefile
index ed4662a28f3f..128b068dd580 100644
--- a/sysutils/grub2-pcbsd/Makefile
+++ b/sysutils/grub2-pcbsd/Makefile
@@ -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/
diff --git a/sysutils/grub2-pcbsd/files/00_header.in b/sysutils/grub2-pcbsd/files/00_header.in
index 443594ba6fa0..c1e86b147bee 100644
--- a/sysutils/grub2-pcbsd/files/00_header.in
+++ b/sysutils/grub2-pcbsd/files/00_header.in
@@ -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
diff --git a/sysutils/grub2-pcbsd/files/10_ktrueos.in b/sysutils/grub2-pcbsd/files/10_ktrueos.in
index 17fa866fc842..b3bdfcfc9d09 100644
--- a/sysutils/grub2-pcbsd/files/10_ktrueos.in
+++ b/sysutils/grub2-pcbsd/files/10_ktrueos.in
@@ -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}"`