aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorkmoore <kmoore@FreeBSD.org>2014-07-16 01:52:10 +0800
committerkmoore <kmoore@FreeBSD.org>2014-07-16 01:52:10 +0800
commit143ac5e6c58d37a5f89164958bbb896f25d46a91 (patch)
treecdbc4d5d9556383d93b6b70b66c47b0ce2ccf7bc /sysutils
parentae03f1743c379b5fd150a3001efa0b1f17c9da24 (diff)
downloadfreebsd-ports-gnome-143ac5e6c58d37a5f89164958bbb896f25d46a91.tar.gz
freebsd-ports-gnome-143ac5e6c58d37a5f89164958bbb896f25d46a91.tar.zst
freebsd-ports-gnome-143ac5e6c58d37a5f89164958bbb896f25d46a91.zip
- Update patches to set default boot-environment based upon output of
the 'beadm' command - Bump PORTREV
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/grub2-pcbsd/Makefile2
-rw-r--r--sysutils/grub2-pcbsd/files/00_header.in21
-rw-r--r--sysutils/grub2-pcbsd/files/10_ktrueos.in4
3 files changed, 23 insertions, 4 deletions
diff --git a/sysutils/grub2-pcbsd/Makefile b/sysutils/grub2-pcbsd/Makefile
index cf4b5ecb6212..c383d56c4686 100644
--- a/sysutils/grub2-pcbsd/Makefile
+++ b/sysutils/grub2-pcbsd/Makefile
@@ -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/
diff --git a/sysutils/grub2-pcbsd/files/00_header.in b/sysutils/grub2-pcbsd/files/00_header.in
index 10d8b96f9606..7a5d27b3240a 100644
--- a/sysutils/grub2-pcbsd/files/00_header.in
+++ b/sysutils/grub2-pcbsd/files/00_header.in
@@ -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
diff --git a/sysutils/grub2-pcbsd/files/10_ktrueos.in b/sysutils/grub2-pcbsd/files/10_ktrueos.in
index d1d85a59e951..8cf299aa8dea 100644
--- a/sysutils/grub2-pcbsd/files/10_ktrueos.in
+++ b/sysutils/grub2-pcbsd/files/10_ktrueos.in
@@ -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}'`