Add 'linux_mounts_enable' rc.conf(5) variable, to make it possible

to disable mounting Linux-specific filesystems under /compat/linux
when 'linux_enable' is set to YES.

Reviewed by:	netchild, ian (earlier version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D22320
This commit is contained in:
Edward Tomasz Napierala 2019-11-13 20:27:38 +00:00
parent 4e0706cbdf
commit 5dece9b25a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=354690
2 changed files with 10 additions and 6 deletions

View File

@ -640,6 +640,8 @@ firstboot_sentinel="/firstboot" # Scripts with "firstboot" keyword are run if
# the file can be deleted after the boot completes.
sysvipc_enable="NO" # Load System V IPC primitives at startup (or NO).
linux_enable="NO" # Linux binary compatibility loaded at startup (or NO).
linux_mounts_enable="YES" # If linux_enable is set to YES, mount Linux-specific
# filesystems at startup.
clear_tmp_enable="NO" # Clear /tmp at startup.
clear_tmp_X="YES" # Clear and recreate X11-related directories in /tmp
ldconfig_insecure="NO" # Set to YES to disable ldconfig security checks

View File

@ -46,12 +46,14 @@ linux_start()
sysctl kern.elf32.fallback_brand=3 > /dev/null
fi
_emul_path="/compat/linux"
mount -o nocover -t linprocfs linprocfs "${_emul_path}/proc"
mount -o nocover -t linsysfs linsysfs "${_emul_path}/sys"
mount -o nocover -t devfs devfs "${_emul_path}/dev"
mount -o nocover -t fdescfs fdescfs "${_emul_path}/dev/fd"
mount -o nocover,mode=1777 -t tmpfs tmpfs "${_emul_path}/dev/shm"
if checkyesno linux_mounts_enable; then
_emul_path="/compat/linux"
mount -o nocover -t linprocfs linprocfs "${_emul_path}/proc"
mount -o nocover -t linsysfs linsysfs "${_emul_path}/sys"
mount -o nocover -t devfs devfs "${_emul_path}/dev"
mount -o nocover -t fdescfs fdescfs "${_emul_path}/dev/fd"
mount -o nocover,mode=1777 -t tmpfs tmpfs "${_emul_path}/dev/shm"
fi
}
load_rc_config $name