Changeset 9caf430


Ignore:
Timestamp:
06/18/13 07:15:04 (14 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
1105519
Parents:
fdb75b86
Message:

Add bootManager=GRUB option to pc-sysinstall. Using this will require that
you ship grub-install && grub-mkconfig with your install image,
or just install the package during installation time.

Location:
src-sh/pc-sysinstall
Files:
3 edited

Legend:

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

    r754b73a5 r9caf430  
    384384}; 
    385385 
     386# Script which stamps grub on the specified disks 
     387setup_grub()  
     388{ 
     389  # Mount devfs 
     390  rc_halt "mount -t devfs devfs ${FSMNT}/dev" 
     391 
     392  # Read through our list and stamp grub for each device 
     393  while read line 
     394  do 
     395    # Make sure we have a /dev in front of the disk name 
     396    echo $line | grep -q '/dev/' 
     397    if [ $? -eq 0 ] ; then 
     398      gDisk="$line" 
     399    else 
     400      gDisk="/dev/$line" 
     401    fi 
     402 
     403    # Stamp GRUB now 
     404    rc_halt "chroot ${FSMNT} grub-install --force $gDisk" 
     405  done < ${TMPDIR}/.grub-install 
     406 
     407  # Make sure we re-create the default grub.cfg 
     408  rc_halt "chroot ${FSMNT} grub-mkconfig -o /boot/grub/grub.cfg" 
     409 
     410  # Sleep and cleanup 
     411  sleep 5 
     412  rc_halt "umount ${FSMNT}/dev" 
     413}; 
    386414 
    387415run_final_cleanup() 
     
    411439  # Generate the fstab for the installed system 
    412440  setup_fstab 
    413 }; 
     441 
     442  # Check if we need to setup GRUB 
     443  if [ -e "${TMPDIR}/.grub-install" ] ; then setup_grub; fi 
     444 
     445}; 
  • src-sh/pc-sysinstall/backend/functions-disk.sh

    r1620346 r9caf430  
    649649{ 
    650650  _intDISK=$1 
     651  _intBOOT=$2 
    651652  
    652653  # Set our sysctl so we can overwrite any geom using drives 
     
    665666  rc_halt "gpart add -b 34 -s 128 -t freebsd-boot ${_intDISK}" 
    666667   
    667   echo_log "Stamping boot sector on ${_intDISK}" 
    668   rc_halt "gpart bootcode -b /boot/pmbr ${_intDISK}" 
     668  if [ "${_intBOOT}" = "GRUB" ] ; then 
     669    # Doing a GRUB stamp? Lets save it for post-install 
     670    echo "${_intDISK}" >> ${TMPDIR}/.grub-install 
     671  else 
     672    echo_log "Stamping boot sector on ${_intDISK}" 
     673    rc_halt "gpart bootcode -b /boot/pmbr ${_intDISK}" 
     674  fi 
    669675 
    670676} 
     
    706712    echo_log "Stamping boot0 on ${_intDISK}" 
    707713    rc_halt "gpart bootcode -b /boot/boot0 ${_intDISK}" 
     714  elif [ "$_intBOOT" = "GRUB" ] ; then 
     715    # Doing a GRUB stamp? Lets save it for post-install 
     716    echo "${_intDISK}" >> ${TMPDIR}/.grub-install 
    708717  else 
    709718    echo_log "Stamping boot1 on ${_intDISK}" 
     
    727736    slice=`echo "${DISK}:1:mbr" | sed 's|/|-|g'` 
    728737  else 
    729     init_gpt_full_disk "$DISK" 
     738    init_gpt_full_disk "$DISK" "$BOOT" 
    730739    slice=`echo "${DISK}:1:gpt" | sed 's|/|-|g'` 
    731740  fi 
     
    837846  sleep 1 
    838847 
    839   if [ "${BMANAGER}" = "bsd" ] 
    840   then 
     848  if [ "${BMANAGER}" = "bsd" ]; then 
    841849    echo_log "Stamping boot sector on ${DISK}" 
    842850    rc_halt "gpart bootcode -b /boot/boot0 ${DISK}" 
     851  elif [ "${BMANAGER}" = "GRUB" ] ; then 
     852    # Doing a GRUB stamp? Lets save it for post-install 
     853    echo "${DISK}" >> ${TMPDIR}/.grub-install 
    843854  fi 
    844855 
     
    890901  sleep 1 
    891902 
    892   if [ "${BMANAGER}" = "bsd" ] 
    893   then 
     903  if [ "${BMANAGER}" = "bsd" ]; then 
    894904    echo_log "Stamping boot sector on ${DISK}" 
    895905    rc_halt "gpart bootcode -b /boot/boot0 ${DISK}" 
     906  elif [ "${BMANAGER}" = "GRUB" ] ; then 
     907    # Doing a GRUB stamp? Lets save it for post-install 
     908    echo "${DISK}" >> ${TMPDIR}/.grub-install 
    896909  fi 
    897910 
  • src-sh/pc-sysinstall/examples/README

    r1620346 r9caf430  
    162162specified this defaults to "round-robin" 
    163163 
    164 # bootManager=(none, bsd) 
     164# bootManager=(none, bsd, GRUB) 
    165165 
    166166Setting this option will instruct pc-sysinstall to install the BSD boot Manager, 
    167 or leave it empty 
     167GRUB boot-manager, or leave it empty 
    168168 
    169169# image=(/path/to/image/file) (/mountpoint) 
Note: See TracChangeset for help on using the changeset viewer.