From owner-svn-src-head@FreeBSD.ORG Mon Sep 9 16:51:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 46AFE514; Mon, 9 Sep 2013 16:51:36 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3365024EE; Mon, 9 Sep 2013 16:51:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89Gpa8Q067257; Mon, 9 Sep 2013 16:51:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89GpaRA067256; Mon, 9 Sep 2013 16:51:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201309091651.r89GpaRA067256@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 9 Sep 2013 16:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255424 - head/sys/dev/ofw 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.14 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: Mon, 09 Sep 2013 16:51:36 -0000 Author: nwhitehorn Date: Mon Sep 9 16:51:35 2013 New Revision: 255424 URL: http://svnweb.freebsd.org/changeset/base/255424 Log: Make the primary name of the OF console device /dev/ofwcons, and only alias it to the contents of the output property if it is defined. This avoids a panic when booting machines (QEMU) where the output-device property is not defined. Since output-device is free-form and potentially conflicts with other entries in /dev, I also am not sure we should be doing the aliasing at all, but this at least makes things work again. Approved by: re (kib) Modified: head/sys/dev/ofw/ofw_console.c Modified: head/sys/dev/ofw/ofw_console.c ============================================================================== --- head/sys/dev/ofw/ofw_console.c Mon Sep 9 15:38:51 2013 (r255423) +++ head/sys/dev/ofw/ofw_console.c Mon Sep 9 16:51:35 2013 (r255424) @@ -88,17 +88,19 @@ cn_drvinit(void *unused) if (ofw_consdev.cn_pri != CN_DEAD && ofw_consdev.cn_name[0] != '\0') { - if ((options = OF_finddevice("/options")) == -1 || - OF_getprop(options, "output-device", output, - sizeof(output)) == -1) - return; + tp = tty_alloc(&ofw_ttydevsw, NULL); + tty_makedev(tp, NULL, "%s", "ofwcons"); + /* * XXX: This is a hack and it may result in two /dev/ttya * XXX: devices on platforms where the sab driver works. */ - tp = tty_alloc(&ofw_ttydevsw, NULL); - tty_makedev(tp, NULL, "%s", output); - tty_makealias(tp, "ofwcons"); + if ((options = OF_finddevice("/options")) == -1 || + OF_getprop(options, "output-device", output, + sizeof(output)) == -1) + return; + if (strlen(output) > 0) + tty_makealias(tp, output); } }