mirror of
https://github.com/BastilleBSD/bastille.git
synced 2025-12-11 09:29:55 +01:00
Merge pull request #888 from BastilleBSD/create-custom-zfs-options
create: Allow setting zfs options on creating jail
This commit is contained in:
@@ -48,3 +48,27 @@ Also, uname does not work from within a jail. Much like MOTD, it gives you the
|
|||||||
information about the host system instead of the jail. If you need to check the version
|
information about the host system instead of the jail. If you need to check the version
|
||||||
of freebsd running on the jail use the freebsd-version command to get accurate information.
|
of freebsd running on the jail use the freebsd-version command to get accurate information.
|
||||||
|
|
||||||
|
|
||||||
|
Bastille can create many different types of jails, along with many different options. See
|
||||||
|
the below help output.
|
||||||
|
|
||||||
|
.. code-block:: shell
|
||||||
|
|
||||||
|
ishmael ~ # bastille create help
|
||||||
|
|
||||||
|
Usage: bastille create [option(s)] NAME RELEASE IP_ADDRESS [interface]"
|
||||||
|
|
||||||
|
Options:
|
||||||
|
|
||||||
|
-B | --bridge Enables VNET, VNET containers are attached to a specified, already existing external bridge.
|
||||||
|
-C | --clone Creates a clone container, they are duplicates of the base release, consume low space and preserves changing data.
|
||||||
|
-D | --dual Creates the jails with both IPv4 and IPv6 networking ('inherit' and 'ip_hostname' only).
|
||||||
|
-E | --empty Creates an empty container, intended for custom jail builds (thin/thick/linux or unsupported).
|
||||||
|
-L | --linux This option is intended for testing with Linux jails, this is considered experimental.
|
||||||
|
-M | --static-mac Generate a static MAC address for jail (VNET only).
|
||||||
|
--no-validate Do not validate the release when creating the jail.
|
||||||
|
-T | --thick Creates a thick container, they consume more space as they are self contained and independent.
|
||||||
|
-V | --vnet Enables VNET, VNET containers are attached to a virtual bridge interface for connectivity.
|
||||||
|
-x | --debug Enable debug mode.
|
||||||
|
-Z | --zfs-opts [zfs,options] Comma separated list of ZFS options to create the jail with. This overrides the defaults.
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ usage() {
|
|||||||
error_notify "Usage: bastille bootstrap [option(s)] [RELEASE|TEMPLATE] [update|arch]"
|
error_notify "Usage: bastille bootstrap [option(s)] [RELEASE|TEMPLATE] [update|arch]"
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
-x | --debug Enable debug mode.
|
-x | --debug Enable debug mode.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -40,15 +40,18 @@ usage() {
|
|||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
-D | --dual Creates the jails with both IPv4 and IPv6 networking ('inherit' and 'ip_hostname' only).
|
-B | --bridge Enables VNET, VNET containers are attached to a specified, already existing external bridge.
|
||||||
-M | --static-mac Generate a static MAC address for jail (VNET only).
|
-C | --clone Creates a clone container, they are duplicates of the base release, consume low space and preserves changing data.
|
||||||
-E | --empty Creates an empty container, intended for custom jail builds (thin/thick/linux or unsupported).
|
-D | --dual Creates the jails with both IPv4 and IPv6 networking ('inherit' and 'ip_hostname' only).
|
||||||
-L | --linux This option is intended for testing with Linux jails, this is considered experimental.
|
-E | --empty Creates an empty container, intended for custom jail builds (thin/thick/linux or unsupported).
|
||||||
-T | --thick Creates a thick container, they consume more space as they are self contained and independent.
|
-L | --linux This option is intended for testing with Linux jails, this is considered experimental.
|
||||||
-V | --vnet Enables VNET, VNET containers are attached to a virtual bridge interface for connectivity.
|
-M | --static-mac Generate a static MAC address for jail (VNET only).
|
||||||
-C | --clone Creates a clone container, they are duplicates of the base release, consume low space and preserves changing data.
|
--no-validate Do not validate the release when creating the jail.
|
||||||
-B | --bridge Enables VNET, VNET containers are attached to a specified, already existing external bridge.
|
-T | --thick Creates a thick container, they consume more space as they are self contained and independent.
|
||||||
|
-V | --vnet Enables VNET, VNET containers are attached to a virtual bridge interface for connectivity.
|
||||||
|
-x | --debug Enable debug mode.
|
||||||
|
-Z | --zfs-opts zfs,options Comma separated list of ZFS options to create the jail with. This overrides the defaults.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
@@ -671,12 +674,17 @@ while [ $# -gt 0 ]; do
|
|||||||
-h|--help|help)
|
-h|--help|help)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
-D|--dual)
|
-B|--bridge)
|
||||||
DUAL_STACK="1"
|
VNET_JAIL="1"
|
||||||
|
VNET_JAIL_BRIDGE="1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-M|--static-mac)
|
-C|--clone)
|
||||||
STATIC_MAC="1"
|
CLONE_JAIL="1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-D|--dual)
|
||||||
|
DUAL_STACK="1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-E|--empty)
|
-E|--empty)
|
||||||
@@ -687,6 +695,14 @@ while [ $# -gt 0 ]; do
|
|||||||
LINUX_JAIL="1"
|
LINUX_JAIL="1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-M|--static-mac)
|
||||||
|
STATIC_MAC="1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--no-validate|no-validate)
|
||||||
|
VALIDATE_RELEASE=""
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-T|--thick)
|
-T|--thick)
|
||||||
THICK_JAIL="1"
|
THICK_JAIL="1"
|
||||||
shift
|
shift
|
||||||
@@ -695,18 +711,13 @@ while [ $# -gt 0 ]; do
|
|||||||
VNET_JAIL="1"
|
VNET_JAIL="1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-B|--bridge)
|
-x|--debug)
|
||||||
VNET_JAIL="1"
|
enable_debug
|
||||||
VNET_JAIL_BRIDGE="1"
|
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-C|--clone)
|
-Z|--zfs-opts)
|
||||||
CLONE_JAIL="1"
|
bastille_zfs_options="${2}"
|
||||||
shift
|
shift 2
|
||||||
;;
|
|
||||||
--no-validate|no-validate)
|
|
||||||
VALIDATE_RELEASE=""
|
|
||||||
shift
|
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
for _opt in $(echo ${1} | sed 's/-//g' | fold -w1); do
|
for _opt in $(echo ${1} | sed 's/-//g' | fold -w1); do
|
||||||
|
|||||||
Reference in New Issue
Block a user