Deleted Added
full compact
zfsboot (296988) zfsboot (297712)
1#!/bin/sh
2#-
3# Copyright (c) 2013-2015 Allan Jude
4# Copyright (c) 2013-2015 Devin Teske
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26# SUCH DAMAGE.
27#
1#!/bin/sh
2#-
3# Copyright (c) 2013-2015 Allan Jude
4# Copyright (c) 2013-2015 Devin Teske
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26# SUCH DAMAGE.
27#
28# $FreeBSD: head/usr.sbin/bsdinstall/scripts/zfsboot 296988 2016-03-17 17:53:38Z allanjude $
28# $FreeBSD: head/usr.sbin/bsdinstall/scripts/zfsboot 297712 2016-04-08 15:05:06Z allanjude $
29#
30############################################################ INCLUDES
31
32BSDCFG_SHARE="/usr/share/bsdconfig"
33. $BSDCFG_SHARE/common.subr || exit 1
34f_dprintf "%s: loading includes..." "$0"
35f_include $BSDCFG_SHARE/device.subr
36f_include $BSDCFG_SHARE/dialog.subr

--- 922 unchanged lines hidden (view full) ---

959
960 esac # $ZFSBOOT_PARTITION_SCHEME
961
962 # Update fstab(5)
963 local swapsize
964 f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize
965 if [ "$isswapmirror" ]; then
966 # This is not the first disk in the mirror, do nothing
29#
30############################################################ INCLUDES
31
32BSDCFG_SHARE="/usr/share/bsdconfig"
33. $BSDCFG_SHARE/common.subr || exit 1
34f_dprintf "%s: loading includes..." "$0"
35f_include $BSDCFG_SHARE/device.subr
36f_include $BSDCFG_SHARE/dialog.subr

--- 922 unchanged lines hidden (view full) ---

959
960 esac # $ZFSBOOT_PARTITION_SCHEME
961
962 # Update fstab(5)
963 local swapsize
964 f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize
965 if [ "$isswapmirror" ]; then
966 # This is not the first disk in the mirror, do nothing
967 elif [ ${swapsize:-0} -eq 0 ]; then
968 # If swap is 0 sized, don't add it to fstab
967 elif [ "$ZFSBOOT_SWAP_ENCRYPTION" -a "$ZFSBOOT_SWAP_MIRROR" ]; then
968 f_eval_catch $funcname printf "$PRINTF_FSTAB" \
969 /dev/mirror/swap.eli none swap sw 0 0 \
970 $BSDINSTALL_TMPETC/fstab ||
971 return $FAILURE
972 isswapmirror=1
973 elif [ "$ZFSBOOT_SWAP_MIRROR" ]; then
974 f_eval_catch $funcname printf "$PRINTF_FSTAB" \
975 /dev/mirror/swap none swap sw 0 0 \
976 $BSDINSTALL_TMPETC/fstab ||
977 return $FAILURE
978 isswapmirror=1
979 elif [ "$ZFSBOOT_SWAP_ENCRYPTION" ]; then
980 f_eval_catch $funcname printf "$PRINTF_FSTAB" \
981 /dev/$disk${swappart}.eli none swap sw 0 0 \
982 $BSDINSTALL_TMPETC/fstab ||
983 return $FAILURE
969 elif [ "$ZFSBOOT_SWAP_ENCRYPTION" -a "$ZFSBOOT_SWAP_MIRROR" ]; then
970 f_eval_catch $funcname printf "$PRINTF_FSTAB" \
971 /dev/mirror/swap.eli none swap sw 0 0 \
972 $BSDINSTALL_TMPETC/fstab ||
973 return $FAILURE
974 isswapmirror=1
975 elif [ "$ZFSBOOT_SWAP_MIRROR" ]; then
976 f_eval_catch $funcname printf "$PRINTF_FSTAB" \
977 /dev/mirror/swap none swap sw 0 0 \
978 $BSDINSTALL_TMPETC/fstab ||
979 return $FAILURE
980 isswapmirror=1
981 elif [ "$ZFSBOOT_SWAP_ENCRYPTION" ]; then
982 f_eval_catch $funcname printf "$PRINTF_FSTAB" \
983 /dev/$disk${swappart}.eli none swap sw 0 0 \
984 $BSDINSTALL_TMPETC/fstab ||
985 return $FAILURE
984 elif [ ${swapsize:-0} -eq 0 ]; then
985 # If swap is 0 sized, don't add it to fstab
986 else
987 f_eval_catch $funcname printf "$PRINTF_FSTAB" \
988 /dev/$disk$swappart none swap sw 0 0 \
989 $BSDINSTALL_TMPETC/fstab ||
990 return $FAILURE
991 fi
992
993 return $SUCCESS

--- 642 unchanged lines hidden ---
986 else
987 f_eval_catch $funcname printf "$PRINTF_FSTAB" \
988 /dev/$disk$swappart none swap sw 0 0 \
989 $BSDINSTALL_TMPETC/fstab ||
990 return $FAILURE
991 fi
992
993 return $SUCCESS

--- 642 unchanged lines hidden ---