diff options
author | erdgeist <erdgeist@erdgeist.org> | 2006-05-07 22:25:25 +0000 |
---|---|---|
committer | erdgeist <erdgeist@erdgeist.org> | 2006-05-07 22:25:25 +0000 |
commit | 56f79ffcec367af0269b5ac646136f76d1405252 (patch) | |
tree | ddb7e1f392a3cc125cff21fa0c6e238e5ece6077 | |
parent | 48a4ad0891b43b296853f550f4560d05ca123f47 (diff) |
Add a forceful blocking option to ezjail creation
-rwxr-xr-x | ezjail-admin | 9 | ||||
-rwxr-xr-x | ezjail.sh | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/ezjail-admin b/ezjail-admin index 91c58f1..857dcae 100755 --- a/ezjail-admin +++ b/ezjail-admin | |||
@@ -30,8 +30,9 @@ ezjail_fdescfs_enable=${ezjail_fdescfs_enable:-"YES"} | |||
30 | 30 | ||
31 | ezjail_dirlist="bin boot lib libexec rescue sbin usr/bin usr/games usr/include usr/lib usr/libdata usr/libexec usr/sbin usr/src usr/share" | 31 | ezjail_dirlist="bin boot lib libexec rescue sbin usr/bin usr/games usr/include usr/lib usr/libdata usr/libexec usr/sbin usr/src usr/share" |
32 | 32 | ||
33 | # Synopsis messages | ||
33 | ezjail_usage_ezjailadmin="Usage: `basename -- $0` [config|create|delete|install|list|update] {params}" | 34 | ezjail_usage_ezjailadmin="Usage: `basename -- $0` [config|create|delete|install|list|update] {params}" |
34 | ezjail_usage_create="Usage: `basename -- $0` create [-xi] [-f flavour] [-r jailroot] [-s size] [-c bde|eli] [-u passurl] [-C args] jailname jailip" | 35 | ezjail_usage_create="Usage: `basename -- $0` create [-xbi] [-f flavour] [-r jailroot] [-s size] [-c bde|eli] [-u passurl] [-C args] jailname jailip" |
35 | ezjail_usage_delete="Usage: `basename -- $0` delete [-w] jailname" | 36 | ezjail_usage_delete="Usage: `basename -- $0` delete [-w] jailname" |
36 | ezjail_usage_list="Usage: `basename -- $0` list" | 37 | ezjail_usage_list="Usage: `basename -- $0` list" |
37 | ezjail_usage_update="Usage: `basename -- $0` update [-s sourcetree] [-i] [-pP]" | 38 | ezjail_usage_update="Usage: `basename -- $0` update [-s sourcetree] [-i] [-pP]" |
@@ -148,13 +149,14 @@ case "$1" in | |||
148 | ######################## ezjail-admin CREATE ######################## | 149 | ######################## ezjail-admin CREATE ######################## |
149 | create) | 150 | create) |
150 | # Clean variables, prevent polution | 151 | # Clean variables, prevent polution |
151 | unset ezjail_rootdir ezjail_flavour ezjail_softlink ezjail_image ezjail_imagetype ezjail_imageparams ezjail_imagesize ezjail_device ezjail_config ezjail_attachparams ezjail_passphraseurl ezjail_exists ezjail_attachblocking | 152 | unset ezjail_rootdir ezjail_flavour ezjail_softlink ezjail_image ezjail_imagetype ezjail_imageparams ezjail_imagesize ezjail_device ezjail_config ezjail_attachparams ezjail_passphraseurl ezjail_exists ezjail_attachblocking ezjail_forceblocking |
152 | shift; while getopts :f:r:s:xic:u:C: arg; do case ${arg} in | 153 | shift; while getopts :f:r:s:xbic:u:C: arg; do case ${arg} in |
153 | x) ezjail_exists="YES";; | 154 | x) ezjail_exists="YES";; |
154 | r) ezjail_rootdir="${OPTARG}";; | 155 | r) ezjail_rootdir="${OPTARG}";; |
155 | f) ezjail_flavour="${OPTARG}";; | 156 | f) ezjail_flavour="${OPTARG}";; |
156 | c) ezjail_imagetype="${OPTARG}";; | 157 | c) ezjail_imagetype="${OPTARG}";; |
157 | C) ezjail_imageparams="${OPTARG}";; | 158 | C) ezjail_imageparams="${OPTARG}";; |
159 | b) ezjail_forceblocking="YES";; | ||
158 | i) ezjail_imagetype=${ezjail_imagetype:-"simple"};; | 160 | i) ezjail_imagetype=${ezjail_imagetype:-"simple"};; |
159 | s) ezjail_imagesize="${OPTARG}";; | 161 | s) ezjail_imagesize="${OPTARG}";; |
160 | u) ezjail_urlpass="${OPTARG}";; | 162 | u) ezjail_urlpass="${OPTARG}";; |
@@ -325,6 +327,7 @@ create) | |||
325 | echo export jail_${ezjail_safename}_imagetype=\"${ezjail_imagetype}\" >> ${ezjail_config} | 327 | echo export jail_${ezjail_safename}_imagetype=\"${ezjail_imagetype}\" >> ${ezjail_config} |
326 | echo export jail_${ezjail_safename}_attachparams=\"${ezjail_attachparams}\" >> ${ezjail_config} | 328 | echo export jail_${ezjail_safename}_attachparams=\"${ezjail_attachparams}\" >> ${ezjail_config} |
327 | echo export jail_${ezjail_safename}_attachblocking=\"${ezjail_attachblocking}\" >> ${ezjail_config} | 329 | echo export jail_${ezjail_safename}_attachblocking=\"${ezjail_attachblocking}\" >> ${ezjail_config} |
330 | echo export jail_${ezjail_safename}_forceblocking=\"${ezjail_forceblocking}\" >> ${ezjail_config} | ||
328 | echo export jail_${ezjail_safename}_passphraseurl=\"${ezjail_passphraseurl}\" >> ${ezjail_config} | 331 | echo export jail_${ezjail_safename}_passphraseurl=\"${ezjail_passphraseurl}\" >> ${ezjail_config} |
329 | 332 | ||
330 | # Final steps for flavour installation | 333 | # Final steps for flavour installation |
@@ -63,12 +63,15 @@ do_cmd() | |||
63 | eval ezjail_imagetype=\"\$jail_${ezjail}_imagetype\" | 63 | eval ezjail_imagetype=\"\$jail_${ezjail}_imagetype\" |
64 | eval ezjail_attachparams=\"\$jail_${ezjail}_attachparams\" | 64 | eval ezjail_attachparams=\"\$jail_${ezjail}_attachparams\" |
65 | eval ezjail_attachblocking=\"\$jail_${ezjail}_attachblocking\" | 65 | eval ezjail_attachblocking=\"\$jail_${ezjail}_attachblocking\" |
66 | eval ezjail_forceblocking=\"\$jail_${ezjail}_forceblocking\" | ||
66 | 67 | ||
67 | # Cannot auto mount blocking crypto jails without interrupting boot process | 68 | [ ${ezjail_attachblocking} = "YES" -o ${ezjail_forceblocking} = "YES" ] && ezjail_blocking="YES" || unset ezjail_blocking |
68 | [ "${ezjail_fromrc}" = "YES" -a "${action}" = "start" -a "${ezjail_attachblocking}" = "YES" ] && continue | 69 | |
70 | # Cannot auto mount blocking jails without interrupting boot process | ||
71 | [ "${ezjail_fromrc}" = "YES" -a "${action}" = "start" -a "${ezjail_blocking}" = "YES" ] && continue | ||
69 | 72 | ||
70 | # Explicitely do only run blocking crypto jails when *crypto is requested | 73 | # Explicitely do only run blocking crypto jails when *crypto is requested |
71 | [ "${action%crypto}" != "${action}" -a -z "${ezjail_attachblocking}" ] && continue | 74 | [ "${action%crypto}" != "${action}" -a -z "${ezjail_blocking}" ] && continue |
72 | 75 | ||
73 | # Try to attach (crypto) devices | 76 | # Try to attach (crypto) devices |
74 | [ -n "${ezjail_image}" ] && attach_detach_pre | 77 | [ -n "${ezjail_image}" ] && attach_detach_pre |