From owner-svn-src-stable-12@freebsd.org Fri Apr 3 01:32:02 2020 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 7901626EEE9; Fri, 3 Apr 2020 01:32:02 +0000 (UTC) (envelope-from freqlabs@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 48tj8f0B7wz4SxX; Fri, 3 Apr 2020 01:32:02 +0000 (UTC) (envelope-from freqlabs@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 B1BF023A3C; Fri, 3 Apr 2020 01:31:49 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0331Vn3m047654; Fri, 3 Apr 2020 01:31:49 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0331Vmbx047650; Fri, 3 Apr 2020 01:31:48 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202004030131.0331Vmbx047650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Fri, 3 Apr 2020 01:31:48 +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: r359586 - in stable/12/stand: forth lua X-SVN-Group: stable-12 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable/12/stand: forth lua X-SVN-Commit-Revision: 359586 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: Fri, 03 Apr 2020 01:32:02 -0000 Author: freqlabs Date: Fri Apr 3 01:31:48 2020 New Revision: 359586 URL: https://svnweb.freebsd.org/changeset/base/359586 Log: MFC r359371 loader: Fully reset terminal settings, not just colors Reviewed by: kevans, tsoome Approved by: mav (mentor) Modified: stable/12/stand/forth/loader.4th stable/12/stand/forth/loader.rc stable/12/stand/forth/screen.4th stable/12/stand/lua/core.lua stable/12/stand/lua/loader.lua Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/forth/loader.4th ============================================================================== --- stable/12/stand/forth/loader.4th Fri Apr 3 01:17:43 2020 (r359585) +++ stable/12/stand/forth/loader.4th Fri Apr 3 01:31:48 2020 (r359586) @@ -49,6 +49,12 @@ include /boot/check-password.4th only forth definitions +: maybe-resetcons ( -- ) + loader_color? if + ris + then +; + : bootmsg ( -- ) loader_color? dup ( -- bool bool ) if 7 fg 4 bg then Modified: stable/12/stand/forth/loader.rc ============================================================================== --- stable/12/stand/forth/loader.rc Fri Apr 3 01:17:43 2020 (r359585) +++ stable/12/stand/forth/loader.rc Fri Apr 3 01:31:48 2020 (r359586) @@ -14,6 +14,7 @@ try-include /boot/loader.rc.local start maybe-efi-resizecons +maybe-resetcons \ Tests for password -- executes autoboot first if a password was defined check-password Modified: stable/12/stand/forth/screen.4th ============================================================================== --- stable/12/stand/forth/screen.4th Fri Apr 3 01:17:43 2020 (r359585) +++ stable/12/stand/forth/screen.4th Fri Apr 3 01:31:48 2020 (r359586) @@ -39,6 +39,9 @@ marker task-screen.4th \ clear screen : clear ( -- ) ho cld ; +\ reset to initial state +: ris ( -- ) 27 emit [char] c emit ; + \ move cursor to x rows, y cols (1-based coords) ( Esc-[%d;%dH ) : at-xy ( x y -- ) escc .# [char] ; emit .# [char] H emit ; Modified: stable/12/stand/lua/core.lua ============================================================================== --- stable/12/stand/lua/core.lua Fri Apr 3 01:17:43 2020 (r359585) +++ stable/12/stand/lua/core.lua Fri Apr 3 01:31:48 2020 (r359586) @@ -103,6 +103,7 @@ core.KEY_DELETE = 127 -- other contexts (outside of Lua) may mean 'octal' core.KEYSTR_ESCAPE = "\027" core.KEYSTR_CSI = core.KEYSTR_ESCAPE .. "[" +core.KEYSTR_RESET = core.KEYSTR_ESCAPE .. "c" core.MENU_RETURN = "return" core.MENU_ENTRY = "entry" Modified: stable/12/stand/lua/loader.lua ============================================================================== --- stable/12/stand/lua/loader.lua Fri Apr 3 01:17:43 2020 (r359585) +++ stable/12/stand/lua/loader.lua Fri Apr 3 01:31:48 2020 (r359586) @@ -38,28 +38,21 @@ local color = require("color") local core = require("core") local config = require("config") local password = require("password") --- The menu module will be brought in after config has loaded if we actually --- need it. -local menu config.load() --- Our console may have been setup for a different color scheme before we get --- here, so make sure we set the default. -if color.isEnabled() then - printc(color.default()) -end -try_include("local") -if not core.isMenuSkipped() then - menu = require("menu") -end if core.isUEFIBoot() then loader.perform("efi-autoresizecons") end +-- Our console may have been setup with different settings before we get +-- here, so make sure we reset everything back to default. +if color.isEnabled() then + printc(core.KEYSTR_RESET) +end +try_include("local") password.check() --- menu might be disabled -if menu ~= nil then - menu.run() +if not core.isMenuSkipped() then + require("menu").run() else -- Load kernel/modules before we go config.loadelf()