Changeset acdd4b9


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

Fix GRUB and GPT to place nice together

Location:
src-sh/pc-sysinstall/backend
Files:
2 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 
  • src-sh/pc-sysinstall/backend/functions-disk.sh

    r9caf430 racdd4b9  
    664664  echo_log "Running gpart on ${_intDISK}" 
    665665  rc_halt "gpart create -s GPT ${_intDISK}" 
    666   rc_halt "gpart add -b 34 -s 128 -t freebsd-boot ${_intDISK}" 
    667666   
    668667  if [ "${_intBOOT}" = "GRUB" ] ; then 
     668    rc_halt "gpart add -b 34 -s 1M -t bios-boot ${_intDISK}" 
    669669    # Doing a GRUB stamp? Lets save it for post-install 
    670670    echo "${_intDISK}" >> ${TMPDIR}/.grub-install 
    671671  else 
     672    rc_halt "gpart add -b 34 -s 128 -t freebsd-boot ${_intDISK}" 
    672673    echo_log "Stamping boot sector on ${_intDISK}" 
    673674    rc_halt "gpart bootcode -b /boot/pmbr ${_intDISK}" 
Note: See TracChangeset for help on using the changeset viewer.