Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 May 2015 00:55:44 +0000 (UTC)
From:      Allan Jude <allanjude@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r283023 - head/usr.sbin/bsdinstall/scripts
Message-ID:  <201505170055.t4H0tiJk017038@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: allanjude (doc committer)
Date: Sun May 17 00:55:44 2015
New Revision: 283023
URL: https://svnweb.freebsd.org/changeset/base/283023

Log:
  bsdinstall/zfsboot: Skip adding swap lines to /etc/fstab if swap is 0 sized
  
  Differential Revision:	https://reviews.freebsd.org/D2571
  Reviewed by:	dim
  Approved by:	eadler (mentor)
  Sponsored by:	ScaleEngine Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/zfsboot

Modified: head/usr.sbin/bsdinstall/scripts/zfsboot
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/zfsboot	Sat May 16 23:51:24 2015	(r283022)
+++ head/usr.sbin/bsdinstall/scripts/zfsboot	Sun May 17 00:55:44 2015	(r283023)
@@ -953,6 +953,8 @@ zfs_create_diskpart()
 	esac # $ZFSBOOT_PARTITION_SCHEME
 
 	# Update fstab(5)
+	local swapsize
+	f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize
 	if [ "$isswapmirror" ]; then
 		# This is not the first disk in the mirror, do nothing
 	elif [ "$ZFSBOOT_SWAP_ENCRYPTION" -a "$ZFSBOOT_SWAP_MIRROR" ]; then
@@ -972,6 +974,8 @@ zfs_create_diskpart()
 		             /dev/$disk${swappart}.eli none swap sw 0 0 \
 		             $BSDINSTALL_TMPETC/fstab ||
 		             return $FAILURE
+	elif [ ${swapsize:-0} -eq 0 ]
+		# If swap is 0 sized, don't add it to fstab
 	else
 		f_eval_catch $funcname printf "$PRINTF_FSTAB" \
 		             /dev/$disk$swappart none swap sw 0 0 \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505170055.t4H0tiJk017038>