Ignore:
Timestamp:
06/19/13 10:16:08 (14 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
5e24b28
Parents:
506d427
Message:

Make grub beadm detection script able to cope with installing from
chrooted /mnt, such as during system installation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pc-extractoverlay/ports-overlay/usr/local/etc/grub.d/10_ktrueos

    r5adc162 r293f64e  
    130130   which -s beadm 
    131131   if [ $? -ne 0 ] ; then return 0; fi 
     132 
     133   # Check if we are running from the installer and use its beadm 
     134   if [ -e "/root/beadm.install" ] ; then 
     135      BEADM="/root/beadm.install" 
     136   else 
     137      BEADM="`which beadm`" 
     138   fi 
     139 
     140   ${BEADM} list >/dev/null 2>/dev/null 
     141   if [ $? -ne 0 ] ; then return 0; fi 
     142 
     143 
    132144   if [ -e "/etc/defaults/pcbsd" ] ; then 
    133145      NICK="PC-BSD" 
     
    137149 
    138150   # Get list of beadm datasets 
    139    for b in `beadm list 2>/dev/null| grep -v "Created" | cut -d ' ' -f 1` 
     151   for b in `${BEADM} list 2>/dev/null| grep -v "Created" | cut -d ' ' -f 1` 
    140152   do 
    141153      # Got a beadm snapshot, lets get the complete dataset name 
    142       cdataset=`beadm list -a | grep "/ROOT/${b}" | awk '{print $1}'` 
     154      cdataset=`${BEADM} list -a | grep "/ROOT/${b}" | awk '{print $1}'` 
    143155      ztank=`echo $cdataset | cut -d '/' -f 1` 
    144156      shortdataset="/`echo $cdataset | cut -d '/' -f 2-5`" 
     
    158170      loadPrefix="${shortdataset}" 
    159171      # If this is the current mounted dataset, we can skip mounting it 
    160       mount | grep -q "$cdataset on / (" 
     172      mount | grep -q -e "$cdataset on / (" -e "$cdataset on /mnt (" 
    161173      if [ $? -eq 0 ] ; then 
    162174        display_loaderopts 
Note: See TracChangeset for help on using the changeset viewer.