Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 3 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
16 src-sh/pc-sysinstall/backend/functions-bsdlabel.sh
@@ -105,6 +105,14 @@ setup_zfs_mirror_parts()
{
_nZFS=""
+ # Check if the target disk is using GRUB
+ grep -q "/dev/$2" ${TMPDIR}/.grub-install 2>/dev/null
+ if [ $? -eq 0 ] ; then
+ _tBL="GRUB"
+ else
+ _tBL="bsd"
+ fi
+
ZTYPE="`echo ${1} | awk '{print $1}'`"
# Using mirroring, setup boot partitions on each disk
@@ -119,9 +127,13 @@ setup_zfs_mirror_parts()
is_disk "$_zvars" >/dev/null 2>/dev/null
if [ $? -eq 0 ] ; then
echo "Setting up ZFS disk $_zvars" >>${LOGOUT}
- init_gpt_full_disk "$_zvars" >/dev/null 2>/dev/null
+ init_gpt_full_disk "$_zvars" "$_tBL" >/dev/null 2>/dev/null
rc_halt "gpart add -a 4k -t freebsd-zfs ${_zvars}" >/dev/null 2>/dev/null
- rc_halt "gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${_zvars}" >/dev/null 2>/dev/null
+
+ # If we are not using GRUB we need to add pmbr / gptzfsboot
+ if [ "$_tBL" != "GRUB" ] ; then
+ rc_halt "gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${_zvars}" >/dev/null 2>/dev/null
+ fi
_nZFS="$_nZFS ${_zvars}p2"
else
_nZFS="$_nZFS ${_zvars}"
View
3  src-sh/pc-sysinstall/backend/functions-disk.sh
@@ -663,12 +663,13 @@ init_gpt_full_disk()
echo_log "Running gpart on ${_intDISK}"
rc_halt "gpart create -s GPT ${_intDISK}"
- rc_halt "gpart add -b 34 -s 128 -t freebsd-boot ${_intDISK}"
if [ "${_intBOOT}" = "GRUB" ] ; then
+ rc_halt "gpart add -b 34 -s 1M -t bios-boot ${_intDISK}"
# Doing a GRUB stamp? Lets save it for post-install
echo "${_intDISK}" >> ${TMPDIR}/.grub-install
else
+ rc_halt "gpart add -b 34 -s 128 -t freebsd-boot ${_intDISK}"
echo_log "Stamping boot sector on ${_intDISK}"
rc_halt "gpart bootcode -b /boot/pmbr ${_intDISK}"
fi
View
43 src-sh/pc-sysinstall/backend/functions-newfs.sh
@@ -62,54 +62,17 @@ setup_zfs_filesystem()
# Check if we have some custom zpool arguments and use them if so
if [ ! -z "${ZPOOLOPTS}" ] ; then
- # Sort through devices and run gnop on them
- local gnopDev=""
- local newOpts=""
- for i in $ZPOOLOPTS
- do
- echo "$i" | grep -q '/dev/'
- if [ $? -eq 0 ] ; then
- rc_halt "gnop create -S 4096 ${i}"
- gnopDev="$gnopDev $i"
- newOpts="$newOpts ${i}.nop"
- else
- newOpts="$newOpts $i"
- fi
- done
-
- echo_log "Creating zpool ${ZPOOLNAME} with $newOpts"
- rc_halt "zpool create -m none -f ${ZPOOLNAME} ${newOpts}"
-
- # Export the pool
- rc_halt "zpool export ${ZPOOLNAME}"
-
- # Destroy the gnop devices
- for i in $gnopDev
- do
- rc_halt "gnop destroy ${i}.nop"
- done
-
- # And lastly re-import the pool
- rc_halt "zpool import ${ZPOOLNAME}"
+ echo_log "Creating zpool ${ZPOOLNAME} with $ZPOOLOPTS"
+ rc_halt "zpool create -m none -f ${ZPOOLNAME} ${ZPOOLOPTS}"
else
- # Lets do our pseudo-4k drive
- rc_halt "gnop create -S 4096 ${PART}${EXT}"
-
# No zpool options, create pool on single device
echo_log "Creating zpool ${ZPOOLNAME} on ${PART}${EXT}"
- rc_halt "zpool create -m none -f ${ZPOOLNAME} ${PART}${EXT}.nop"
-
- # Finish up the gnop 4k trickery
- rc_halt "zpool export ${ZPOOLNAME}"
- rc_halt "gnop destroy ${PART}${EXT}.nop"
- rc_halt "zpool import ${ZPOOLNAME}"
+ rc_halt "zpool create -m none -f ${ZPOOLNAME} ${PART}${EXT}"
fi
# Disable atime for this zfs partition, speed increase
rc_nohalt "zfs set atime=off ${ZPOOLNAME}"
-
-
};
# Runs newfs on all the partiions which we've setup with bsdlabel
View
5 src-sh/pc-sysinstall/backend/functions-unmount.sh
@@ -62,13 +62,14 @@ start_gmirror_sync()
# Unmounts all our mounted file-systems
unmount_all_filesystems()
{
- # Copy the logfile to disk before we unmount
- cp ${LOGOUT} ${FSMNT}/root/pc-sysinstall.log
cd /
# Check if we need to setup GRUB
if [ -e "${TMPDIR}/.grub-install" ] ; then setup_grub; fi
+ # Copy the logfile to disk before we unmount
+ cp ${LOGOUT} ${FSMNT}/root/pc-sysinstall.log
+
# Start by unmounting any ZFS partitions
zfs_cleanup_unmount

No commit comments for this range

Something went wrong with that request. Please try again.