From 56f79ffcec367af0269b5ac646136f76d1405252 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sun, 7 May 2006 22:25:25 +0000 Subject: Add a forceful blocking option to ezjail creation --- ezjail-admin | 9 ++++++--- 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"} 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" +# Synopsis messages ezjail_usage_ezjailadmin="Usage: `basename -- $0` [config|create|delete|install|list|update] {params}" -ezjail_usage_create="Usage: `basename -- $0` create [-xi] [-f flavour] [-r jailroot] [-s size] [-c bde|eli] [-u passurl] [-C args] jailname jailip" +ezjail_usage_create="Usage: `basename -- $0` create [-xbi] [-f flavour] [-r jailroot] [-s size] [-c bde|eli] [-u passurl] [-C args] jailname jailip" ezjail_usage_delete="Usage: `basename -- $0` delete [-w] jailname" ezjail_usage_list="Usage: `basename -- $0` list" ezjail_usage_update="Usage: `basename -- $0` update [-s sourcetree] [-i] [-pP]" @@ -148,13 +149,14 @@ case "$1" in ######################## ezjail-admin CREATE ######################## create) # Clean variables, prevent polution - 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 - shift; while getopts :f:r:s:xic:u:C: arg; do case ${arg} in + 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 + shift; while getopts :f:r:s:xbic:u:C: arg; do case ${arg} in x) ezjail_exists="YES";; r) ezjail_rootdir="${OPTARG}";; f) ezjail_flavour="${OPTARG}";; c) ezjail_imagetype="${OPTARG}";; C) ezjail_imageparams="${OPTARG}";; + b) ezjail_forceblocking="YES";; i) ezjail_imagetype=${ezjail_imagetype:-"simple"};; s) ezjail_imagesize="${OPTARG}";; u) ezjail_urlpass="${OPTARG}";; @@ -325,6 +327,7 @@ create) echo export jail_${ezjail_safename}_imagetype=\"${ezjail_imagetype}\" >> ${ezjail_config} echo export jail_${ezjail_safename}_attachparams=\"${ezjail_attachparams}\" >> ${ezjail_config} echo export jail_${ezjail_safename}_attachblocking=\"${ezjail_attachblocking}\" >> ${ezjail_config} + echo export jail_${ezjail_safename}_forceblocking=\"${ezjail_forceblocking}\" >> ${ezjail_config} echo export jail_${ezjail_safename}_passphraseurl=\"${ezjail_passphraseurl}\" >> ${ezjail_config} # Final steps for flavour installation diff --git a/ezjail.sh b/ezjail.sh index 7029848..313831a 100755 --- a/ezjail.sh +++ b/ezjail.sh @@ -63,12 +63,15 @@ do_cmd() eval ezjail_imagetype=\"\$jail_${ezjail}_imagetype\" eval ezjail_attachparams=\"\$jail_${ezjail}_attachparams\" eval ezjail_attachblocking=\"\$jail_${ezjail}_attachblocking\" + eval ezjail_forceblocking=\"\$jail_${ezjail}_forceblocking\" - # Cannot auto mount blocking crypto jails without interrupting boot process - [ "${ezjail_fromrc}" = "YES" -a "${action}" = "start" -a "${ezjail_attachblocking}" = "YES" ] && continue + [ ${ezjail_attachblocking} = "YES" -o ${ezjail_forceblocking} = "YES" ] && ezjail_blocking="YES" || unset ezjail_blocking + + # Cannot auto mount blocking jails without interrupting boot process + [ "${ezjail_fromrc}" = "YES" -a "${action}" = "start" -a "${ezjail_blocking}" = "YES" ] && continue # Explicitely do only run blocking crypto jails when *crypto is requested - [ "${action%crypto}" != "${action}" -a -z "${ezjail_attachblocking}" ] && continue + [ "${action%crypto}" != "${action}" -a -z "${ezjail_blocking}" ] && continue # Try to attach (crypto) devices [ -n "${ezjail_image}" ] && attach_detach_pre -- cgit v1.2.3