I am attempting to mount an ISO with specific options inside a jail.
I first created a new black iso
Then put on ext2fs on it
Ensure rc.conf & sysctl.conf allow for mounts
Created a simple startup script to handle mdconfig on the ISO
And accounted for it within the jail's fstab.name
I must be missing something... outside of the jail:
And inside the jail:
What am I missing?
I first created a new black iso
Code:
dd if=/dev/zero of=file.iso bs=1024 count=102040
Then put on ext2fs on it
Code:
mke2fs file.iso
Ensure rc.conf & sysctl.conf allow for mounts
Code:
jail_name_mount_enable="YES"
Code:
security.jail.mount_allowed=1
Created a simple startup script to handle mdconfig on the ISO
Code:
#!/bin/sh
# PROVIDE: jail_mount
# BEFORE: DAEMON
. /etc/rc.subr
name=jail_mount
rcvar=jail_mount_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop"
load_rc_config $name
eval "${rcvar}=\${${rcvar}:-'NO'}"
jail_mount_start()
{
/sbin/mdconfig -a -t vnode -f /jail/file.iso -u 0
}
jail_mount_stop()
{
/sbin/mdconfig -d -u 0
/bin/unlink /dev/md0
}
run_rc_command "$1"
And accounted for it within the jail's fstab.name
Code:
# Device Mountpoint FStype Options Dump Pass#
/dev/md0 /jail/tmp ext2fs rw,nosuid,noexec,nosymfollow 0 0
I must be missing something... outside of the jail:
Code:
/dev/md0 on /jail/tmp (ext2fs, local, noexec, nosuid, nosymfollow)
And inside the jail:
Code:
# jexec 1 mount
/dev/ada0p2 on / (ufs, local, journaled soft-updates)
What am I missing?