We need all image parameters, even when the image already existed

This commit is contained in:
erdgeist 2007-10-08 02:04:59 +00:00
parent 472830e66e
commit f5c5e02160

View File

@ -373,6 +373,8 @@ create)
ezjail_devicelink="${ezjail_rootdir}.device" ezjail_devicelink="${ezjail_rootdir}.device"
[ $? -eq 0 ] || detach_images || exerr "Error: Could not attach image device. (Command failed was 'mdconfig -a -t vnode -f ${ezjail_image}')" [ $? -eq 0 ] || detach_images || exerr "Error: Could not attach image device. (Command failed was 'mdconfig -a -t vnode -f ${ezjail_image}')"
fi
case ${ezjail_imagetype} in case ${ezjail_imagetype} in
bde|eli) bde|eli)
# parse imageparams, generate attachparams # parse imageparams, generate attachparams
@ -388,11 +390,15 @@ create)
eli) init_cmd="geli init ${ezjail_imageparams} /dev/${ezjail_imagedevice}" eli) init_cmd="geli init ${ezjail_imageparams} /dev/${ezjail_imagedevice}"
attach_cmd="geli attach ${ezjail_attachparams} /dev/${ezjail_imagedevice}";; attach_cmd="geli attach ${ezjail_attachparams} /dev/${ezjail_imagedevice}";;
esac esac
if [ -z "${ezjail_exists} ]; then
[ "${ezjail_attachblocking}" ] && echo "Initialising crypto device. You will be asked to enter a new passphrase twice... " [ "${ezjail_attachblocking}" ] && echo "Initialising crypto device. You will be asked to enter a new passphrase twice... "
( echo ${init_cmd} | /bin/sh ) || detach_images || exerr "Error: Could not initialise crypto image." ( echo ${init_cmd} | /bin/sh ) || detach_images || exerr "Error: Could not initialise crypto image."
[ "${ezjail_attachblocking}" ] && echo "Attaching crypto device. You will be asked to enter the new passphrase... " [ "${ezjail_attachblocking}" ] && echo "Attaching crypto device. You will be asked to enter the new passphrase... "
( echo ${attach_cmd} | /bin/sh ) || detach_images || exerr "Error: Could not attach crypto image." ( echo ${attach_cmd} | /bin/sh ) || detach_images || exerr "Error: Could not attach crypto image."
fi
ezjail_device="${ezjail_imagedevice}.${ezjail_imagetype}" ezjail_device="${ezjail_imagedevice}.${ezjail_imagetype}"
;; ;;
simple) simple)
@ -400,6 +406,7 @@ create)
;; ;;
esac esac
if [ -z "${ezjail_exists} ]; then
# Format memory image # Format memory image
newfs -U "/dev/${ezjail_device}" || detach_images || exerr "Error: Could not newfs /dev/${ezjail_device}." newfs -U "/dev/${ezjail_device}" || detach_images || exerr "Error: Could not newfs /dev/${ezjail_device}."
# Create mount point and mount # Create mount point and mount