Ignore:
Timestamp:
06/20/13 18:57:11 (17 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
9787b71, 30fa08f
Parents:
d464bcc
Message:

Fix GRUB and GPT to place nice together

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pc-sysinstall/backend/functions-bsdlabel.sh

    r1620346 racdd4b9  
    106106  _nZFS="" 
    107107 
     108  # Check if the target disk is using GRUB 
     109  grep -q "/dev/$2" ${TMPDIR}/.grub-install 2>/dev/null 
     110  if [ $? -eq 0 ] ; then 
     111     _tBL="GRUB" 
     112  else 
     113     _tBL="bsd" 
     114  fi 
     115 
    108116  ZTYPE="`echo ${1} | awk '{print $1}'`" 
    109117 
     
    120128    if [ $? -eq 0 ] ; then 
    121129      echo "Setting up ZFS disk $_zvars" >>${LOGOUT} 
    122       init_gpt_full_disk "$_zvars" >/dev/null 2>/dev/null 
     130      init_gpt_full_disk "$_zvars" "$_tBL" >/dev/null 2>/dev/null 
    123131      rc_halt "gpart add -a 4k -t freebsd-zfs ${_zvars}" >/dev/null 2>/dev/null 
    124       rc_halt "gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${_zvars}" >/dev/null 2>/dev/null 
     132 
     133      # If we are not using GRUB we need to add pmbr / gptzfsboot 
     134      if [ "$_tBL" != "GRUB" ] ; then 
     135        rc_halt "gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${_zvars}" >/dev/null 2>/dev/null 
     136      fi 
    125137      _nZFS="$_nZFS ${_zvars}p2"         
    126138    else 
Note: See TracChangeset for help on using the changeset viewer.