diff options
author | ray <ray@FreeBSD.org> | 2014-06-18 22:30:22 +0000 |
---|---|---|
committer | ray <ray@FreeBSD.org> | 2014-06-18 22:30:22 +0000 |
commit | dd840c3fbc84000fa3fd282a7d2131a01489aa4b (patch) | |
tree | e0ad193322628544762ba01a86b202b124f9a8d0 | |
parent | 2da67a405f1856d6effff8df70070c98c5a24878 (diff) | |
download | FreeBSD-src-dd840c3fbc84000fa3fd282a7d2131a01489aa4b.zip FreeBSD-src-dd840c3fbc84000fa3fd282a7d2131a01489aa4b.tar.gz |
Suspend vt(4) initialization if "kern.vt.disable" kenv is set.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
-rw-r--r-- | sys/dev/vt/vt_consolectl.c | 2 | ||||
-rw-r--r-- | sys/dev/vt/vt_core.c | 11 | ||||
-rw-r--r-- | sys/dev/vt/vt_sysmouse.c | 2 |
3 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/vt/vt_consolectl.c b/sys/dev/vt/vt_consolectl.c index df8b341..be3ef75 100644 --- a/sys/dev/vt/vt_consolectl.c +++ b/sys/dev/vt/vt_consolectl.c @@ -73,6 +73,8 @@ static void consolectl_drvinit(void *unused) { + if (getenv("kern.vt.disable")) + return; make_dev(&consolectl_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "consolectl"); } diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 80aa777..e0bde1f4 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -215,6 +215,8 @@ static void vt_update_static(void *dummy) { + if (getenv("kern.vt.disable")) + return; if (main_vd->vd_driver != NULL) printf("VT: running with driver \"%s\".\n", main_vd->vd_driver->vd_name); @@ -957,6 +959,9 @@ vtterm_cnprobe(struct terminal *tm, struct consdev *cp) struct vt_device *vd = vw->vw_device; struct winsize wsz; + if (getenv("kern.vt.disable")) + return; + if (vd->vd_flags & VDF_INITIALIZED) /* Initialization already done. */ return; @@ -1991,6 +1996,9 @@ vt_upgrade(struct vt_device *vd) struct vt_window *vw; unsigned int i; + if (getenv("kern.vt.disable")) + return; + for (i = 0; i < VT_MAXWINDOWS; i++) { vw = vd->vd_windows[i]; if (vw == NULL) { @@ -2056,6 +2064,9 @@ vt_allocate(struct vt_driver *drv, void *softc) struct vt_device *vd; struct winsize wsz; + if (getenv("kern.vt.disable")) + return; + if (main_vd->vd_driver == NULL) { main_vd->vd_driver = drv; printf("VT: initialize with new VT driver \"%s\".\n", diff --git a/sys/dev/vt/vt_sysmouse.c b/sys/dev/vt/vt_sysmouse.c index 92eee3c..9186212 100644 --- a/sys/dev/vt/vt_sysmouse.c +++ b/sys/dev/vt/vt_sysmouse.c @@ -405,6 +405,8 @@ static void sysmouse_drvinit(void *unused) { + if (getenv("kern.vt.disable")) + return; mtx_init(&sysmouse_lock, "sysmouse", NULL, MTX_DEF); cv_init(&sysmouse_sleep, "sysmrd"); make_dev(&sysmouse_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, |