summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdinstall
diff options
context:
space:
mode:
authorallanjude <allanjude@FreeBSD.org>2016-04-08 15:05:06 +0000
committerallanjude <allanjude@FreeBSD.org>2016-04-08 15:05:06 +0000
commit0a0494372684565b3d6af4647d46f2976e2700e4 (patch)
tree69c186de44353896eeb9cb7b44e85dcbe3973543 /usr.sbin/bsdinstall
parentfd12934507d1f2052285453bdeda0a52941182ed (diff)
downloadFreeBSD-src-0a0494372684565b3d6af4647d46f2976e2700e4.zip
FreeBSD-src-0a0494372684565b3d6af4647d46f2976e2700e4.tar.gz
Do not add swap to fstab when swapsize is 0
If a user requested encrypted swap, but 0 sized, it would still be added to fstab PR: 208630 Submitted by: Ganael LAPLANCHE <ganael.laplanche@corp.ovh.com> MFC after: 2 weeks Sponsored by: ScaleEngine Inc.
Diffstat (limited to 'usr.sbin/bsdinstall')
-rwxr-xr-xusr.sbin/bsdinstall/scripts/zfsboot4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index 4dedbf0..c3b2137 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -964,6 +964,8 @@ zfs_create_diskpart()
f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize
if [ "$isswapmirror" ]; then
# This is not the first disk in the mirror, do nothing
+ elif [ ${swapsize:-0} -eq 0 ]; then
+ # If swap is 0 sized, don't add it to fstab
elif [ "$ZFSBOOT_SWAP_ENCRYPTION" -a "$ZFSBOOT_SWAP_MIRROR" ]; then
f_eval_catch $funcname printf "$PRINTF_FSTAB" \
/dev/mirror/swap.eli none swap sw 0 0 \
@@ -981,8 +983,6 @@ zfs_create_diskpart()
/dev/$disk${swappart}.eli none swap sw 0 0 \
$BSDINSTALL_TMPETC/fstab ||
return $FAILURE
- elif [ ${swapsize:-0} -eq 0 ]; then
- # 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 \
OpenPOWER on IntegriCloud