1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-24 00:45:52 +00:00

- Update patches to set default boot-environment based upon output of

the 'beadm' command
- Bump PORTREV
This commit is contained in:
Kris Moore 2014-07-15 17:52:10 +00:00
parent a6d0bf0d28
commit 24da6a7641
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=361988
3 changed files with 23 additions and 4 deletions

View File

@ -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/

View File

@ -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

View File

@ -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}'`