From owner-svn-src-head@FreeBSD.ORG Thu May 1 00:12:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 881659F0; Thu, 1 May 2014 00:12:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B2BB1865; Thu, 1 May 2014 00:12:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s410CPPh031010; Thu, 1 May 2014 00:12:25 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s410CPpX031008; Thu, 1 May 2014 00:12:25 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201405010012.s410CPpX031008@svn.freebsd.org> From: Peter Grehan Date: Thu, 1 May 2014 00:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265165 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 00:12:25 -0000 Author: grehan Date: Thu May 1 00:12:24 2014 New Revision: 265165 URL: http://svnweb.freebsd.org/changeset/base/265165 Log: Provide an alias for the userboot console and name it 'comconsole'. This allows existing loader.conf files that set "console=comconsole" to work without failing. No functional difference otherwise. Reported by: Michael Dexter, pfSense install. Reviewed by: neel MFC after: 3 weeks Modified: head/sys/boot/userboot/userboot/conf.c head/sys/boot/userboot/userboot/userboot_cons.c Modified: head/sys/boot/userboot/userboot/conf.c ============================================================================== --- head/sys/boot/userboot/userboot/conf.c Wed Apr 30 21:19:46 2014 (r265164) +++ head/sys/boot/userboot/userboot/conf.c Thu May 1 00:12:24 2014 (r265165) @@ -97,8 +97,10 @@ struct file_format *file_formats[] = { * data structures from bootstrap.h as well. */ extern struct console userboot_console; +extern struct console userboot_comconsole; struct console *consoles[] = { &userboot_console, + &userboot_comconsole, NULL }; Modified: head/sys/boot/userboot/userboot/userboot_cons.c ============================================================================== --- head/sys/boot/userboot/userboot/userboot_cons.c Wed Apr 30 21:19:46 2014 (r265164) +++ head/sys/boot/userboot/userboot/userboot_cons.c Thu May 1 00:12:24 2014 (r265165) @@ -33,8 +33,12 @@ __FBSDID("$FreeBSD$"); int console; +static struct console *userboot_comconsp; + static void userboot_cons_probe(struct console *cp); static int userboot_cons_init(int); +static void userboot_comcons_probe(struct console *cp); +static int userboot_comcons_init(int); static void userboot_cons_putchar(int); static int userboot_cons_getchar(void); static int userboot_cons_poll(void); @@ -50,6 +54,21 @@ struct console userboot_console = { userboot_cons_poll, }; +/* + * Provide a simple alias to allow loader scripts to set the + * console to comconsole without resulting in an error + */ +struct console userboot_comconsole = { + "comconsole", + "comconsole", + 0, + userboot_comcons_probe, + userboot_comcons_init, + userboot_cons_putchar, + userboot_cons_getchar, + userboot_cons_poll, +}; + static void userboot_cons_probe(struct console *cp) { @@ -65,6 +84,31 @@ userboot_cons_init(int arg) } static void +userboot_comcons_probe(struct console *cp) +{ + + /* + * Save the console pointer so the comcons_init routine + * can set the C_PRESENT* flags. They are not set + * here to allow the existing userboot console to + * be elected the default. + */ + userboot_comconsp = cp; +} + +static int +userboot_comcons_init(int arg) +{ + + /* + * Set the C_PRESENT* flags to allow the comconsole + * to be selected as the active console + */ + userboot_comconsp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); + return (0); +} + +static void userboot_cons_putchar(int c) {