Advertisement
devinteske

quickfix

May 22nd, 2014
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.67 KB | None | 0 0
  1. Index: zfsboot
  2. ===================================================================
  3. --- zfsboot     (revision 266552)
  4. +++ zfsboot     (working copy)
  5. @@ -45,6 +45,11 @@ f_include $BSDCFG_SHARE/variable.subr
  6.  : ${ZFSBOOT_POOL_NAME:=zroot}
  7.  
  8.  #
  9. +# Default options to use when creating zroot pool
  10. +#
  11. +: ${ZFSBOOT_POOL_CREATE_OPTIONS:=-O compress=lz4 -O atime=off}
  12. +
  13. +#
  14.  # Default name for the boot environment parent dataset
  15.  #
  16.  : ${ZFSBOOT_BEROOT_NAME:=ROOT}
  17. @@ -82,6 +87,11 @@ f_include $BSDCFG_SHARE/variable.subr
  18.  : ${ZFSBOOT_BOOT_POOL=}
  19.  
  20.  #
  21. +# Options to use when creating separate boot pool (if any)
  22. +#
  23. +: ${ZFSBOOT_BOOT_POOL_CREATE_OPTIONS:=}
  24. +
  25. +#
  26.  # Default name for boot pool when enabled (e.g., geli(8) or MBR)
  27.  #
  28.  : ${ZFSBOOT_BOOT_POOL_NAME:=bootpool}
  29. @@ -942,6 +952,7 @@ zfs_create_boot()
  30.         local disks="$*" disk
  31.         local isswapmirror
  32.         local bootpart targetpart swappart # Set by zfs_create_diskpart() below
  33. +       local create_options
  34.  
  35.         #
  36.         # Pedantic checks; should never be seen
  37. @@ -1066,7 +1077,9 @@ zfs_create_boot()
  38.                 f_count nvdevs $boot_vdevs
  39.                 [ $nvdevs -gt 1 ] && bootpool_vdevtype=mirror
  40.  
  41. +               create_options="$ZFSBOOT_BOOT_POOL_CREATE_OPTIONS"
  42.                 bootpool_options="-o altroot=$BSDINSTALL_CHROOT"
  43. +               bootpool_options="$bootpool_options $create_options"
  44.                 bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f"
  45.                 f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \
  46.                              "$bootpool_options" "$bootpool_name" \
  47. @@ -1148,20 +1161,12 @@ zfs_create_boot()
  48.         # Create the ZFS root pool with desired type and disk devices
  49.         #
  50.         f_dprintf "$funcname: Creating root pool..."
  51. +       create_options="$ZFSBOOT_POOL_CREATE_OPTIONS"
  52.         f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \
  53. -                    "-o altroot=$BSDINSTALL_CHROOT -O compress=lz4
  54. -                    -m none -f" \
  55. -                    "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" ||
  56. -                    return $FAILURE
  57. +               "-o altroot=$BSDINSTALL_CHROOT $create_options -m none -f" \
  58. +               "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" ||
  59. +               return $FAILURE
  60.  
  61. -       # Customize the zroot a bit...
  62. -       local option
  63. -       f_dprintf "$funcname: Setting miscellaneous options on root pool..."
  64. -       for option in atime=off; do
  65. -               f_eval_catch $funcname zfs "$ZFS_SET" $option "$zroot_name" ||
  66. -                       return $FAILURE
  67. -       done
  68. -
  69.         #
  70.         # Create ZFS dataset layout within the new root pool
  71.         #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement