From owner-svn-src-stable-12@freebsd.org Sun Sep 15 02:48:16 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3B1CDBB24; Sun, 15 Sep 2019 02:48:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WDMN6CpFz3Lq2; Sun, 15 Sep 2019 02:48:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8EE01802; Sun, 15 Sep 2019 02:48:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8F2mGWe012764; Sun, 15 Sep 2019 02:48:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8F2mGGD012761; Sun, 15 Sep 2019 02:48:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909150248.x8F2mGGD012761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 15 Sep 2019 02:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352349 - in stable: 11/stand/lua 12/stand/lua X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/stand/lua 12/stand/lua X-SVN-Commit-Revision: 352349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2019 02:48:17 -0000 Author: kevans Date: Sun Sep 15 02:48:15 2019 New Revision: 352349 URL: https://svnweb.freebsd.org/changeset/base/352349 Log: MFC r352194: lualoader: Revert to ASCII menu frame for serial console The box drawing characters we use aren't necessarily safe with a serial console; for instance, in the report by npn@, these were causing his xterm to send back a sequence that lua picked up as input and halted the boot. This is less than ideal. Fallback to ASCII frames for console with 'comconsole' in it. This is a partial revert r338108 by imp@ -- instead of removing the menu entirely and disabling color/cursor sequences, just reverting the default frame to ASCII is enough to not break in this setup. Modified: stable/12/stand/lua/core.lua stable/12/stand/lua/drawer.lua Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/stand/lua/core.lua stable/11/stand/lua/drawer.lua Directory Properties: stable/11/ (props changed) Modified: stable/12/stand/lua/core.lua ============================================================================== --- stable/12/stand/lua/core.lua Sun Sep 15 02:46:40 2019 (r352348) +++ stable/12/stand/lua/core.lua Sun Sep 15 02:48:15 2019 (r352349) @@ -325,6 +325,16 @@ function core.isZFSBoot() return false end +function core.isSerialConsole() + local c = loader.getenv("console") + if c ~= nil then + if c:find("comconsole") ~= nil then + return true + end + end + return false +end + function core.isSerialBoot() local s = loader.getenv("boot_serial") if s ~= nil then Modified: stable/12/stand/lua/drawer.lua ============================================================================== --- stable/12/stand/lua/drawer.lua Sun Sep 15 02:46:40 2019 (r352348) +++ stable/12/stand/lua/drawer.lua Sun Sep 15 02:48:15 2019 (r352349) @@ -144,13 +144,20 @@ local function drawmenu(menudef) return alias_table end +local function defaultframe() + if core.isSerialConsole() then + return "ascii" + end + return "double" +end + local function drawbox() local x = menu_position.x - 3 local y = menu_position.y - 1 local w = frame_size.w local h = frame_size.h - local framestyle = loader.getenv("loader_menu_frame") or "double" + local framestyle = loader.getenv("loader_menu_frame") or defaultframe() local framespec = drawer.frame_styles[framestyle] -- If we don't have a framespec for the current frame style, just don't -- draw a box.