Index: arm/conf/JETSON-TK1 =================================================================== --- arm/conf/JETSON-TK1 (revision 306041) +++ arm/conf/JETSON-TK1 (working copy) @@ -26,7 +26,7 @@ options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=tegra124-jetson-tk1-fbsd.dts -makeoptions MODULES_OVERRIDE="" +# makeoptions MODULES_OVERRIDE="" #options BOOTVERBOSE #options BOOTHOWTO=RB_SINGLE Index: arm/conf/RPI2 =================================================================== --- arm/conf/RPI2 (revision 306041) +++ arm/conf/RPI2 (working copy) @@ -98,3 +98,4 @@ #options FDT_DTB_STATIC #makeoptions FDT_DTS_FILE=rpi2.dts makeoptions MODULES_EXTRA=dtb/rpi +options EVDEV Index: arm/conf/TEGRA124 =================================================================== --- arm/conf/TEGRA124 (revision 306041) +++ arm/conf/TEGRA124 (working copy) @@ -137,3 +137,4 @@ # SoC-specific devices #device hwpmc +options EVDEV # Configure using FDT/DTB data Index: kern/kern_cons.c =================================================================== --- kern/kern_cons.c (revision 306041) +++ kern/kern_cons.c (working copy) @@ -105,11 +105,16 @@ DATA_SET(cons_set, cons_consdev); SET_DECLARE(cons_set, struct consdev); +static char preferred_console[16]; + void cninit(void) { - struct consdev *best_cn, *cn, **list; + struct consdev *best_cn, *preferred_cn, *cn, **list; + TUNABLE_STR_FETCH("console.preferred", preferred_console, + sizeof(preferred_console)); + /* * Check if we should mute the console (for security reasons perhaps) * It can be changes dynamically using sysctl kern.consmute @@ -125,6 +130,7 @@ * Find the first console with the highest priority. */ best_cn = NULL; + preferred_cn = NULL; SET_FOREACH(list, cons_set) { cn = *list; cnremove(cn); @@ -134,6 +140,8 @@ cn->cn_ops->cn_probe(cn); if (cn->cn_pri == CN_DEAD) continue; + if (strcmp(preferred_console, cn->cn_name) == 0) + preferred_cn = cn; if (best_cn == NULL || cn->cn_pri > best_cn->cn_pri) best_cn = cn; if (boothowto & RB_MULTIPLE) { @@ -144,6 +152,10 @@ cnadd(cn); } } + + if (preferred_cn) + best_cn = preferred_cn; + if (best_cn == NULL) return; if ((boothowto & RB_MULTIPLE) == 0) { @@ -194,8 +206,11 @@ printf("WARNING: console at %p has no name\n", cn); } STAILQ_INSERT_TAIL(&cn_devlist, cnd, cnd_next); - if (STAILQ_FIRST(&cn_devlist) == cnd) + if ((STAILQ_FIRST(&cn_devlist) == cnd) || + (strcmp(preferred_console, cn->cn_name) == 0)) { + printf("Switching to console at %s\n", cn->cn_name); ttyconsdev_select(cnd->cnd_cn->cn_name); + } /* Add device to the active mask. */ cnavailable(cn, (cn->cn_flags & CN_FLAG_NOAVAIL) == 0);