Let's make loop-mouning filesystem images (like ISO files and hard disk images) easier.
Consider adding a loopmount script that would allow all filesystems in a given image file to be mounted with automount.
Something along these lines:
IMAGE="${1}"
if [ ! -f "${IMAGE}" ] ; then
echo "${IMAGE} does not exist"
exit 1
fi
md=$(sudo -A -E mdconfig -a -t vnode -o readonly -f "${IMAGE}")
# DEVICES=
for DEVICE in $(ls "/dev/${md}" "/dev/${md}p"* "/dev/${md}s"* 2>/dev/null) ; do
echo sudo -A -E /usr/local/sbin/automount $(echo "${DEVICE}" | sed -e 's|/dev/||g') attach
sudo -A -E /usr/local/sbin/automount $(echo "${DEVICE}" | sed -e 's|/dev/||g') attach
done
# TODO: Sleep until all partitions have been unmounted, then
# mdconfig -d -u ${md}
What do you think?
Let's make loop-mouning filesystem images (like ISO files and hard disk images) easier.
Consider adding a loopmount script that would allow all filesystems in a given image file to be mounted with automount.
Something along these lines:
What do you think?