svn commit: r361988 - in head/sysutils/grub2-pcbsd: . files
Kris Moore
kmoore at FreeBSD.org
Tue Jul 15 17:52:11 UTC 2014
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}'`
More information about the svn-ports-all
mailing list