From owner-svn-src-head@freebsd.org Sat Feb 24 04:02:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD023F11919; Sat, 24 Feb 2018 04:02:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 818D46B7C1; Sat, 24 Feb 2018 04:02:06 +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 7C6B12041C; Sat, 24 Feb 2018 04:02:06 +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 w1O426vW081755; Sat, 24 Feb 2018 04:02:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1O4267k081754; Sat, 24 Feb 2018 04:02:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802240402.w1O4267k081754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 24 Feb 2018 04:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329903 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329903 X-SVN-Commit-Repository: base 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.25 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: Sat, 24 Feb 2018 04:02:07 -0000 Author: kevans Date: Sat Feb 24 04:02:06 2018 New Revision: 329903 URL: https://svnweb.freebsd.org/changeset/base/329903 Log: lualoader: Explain nextboot stuff a little bit more Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Feb 24 03:48:52 2018 (r329902) +++ head/stand/lua/config.lua Sat Feb 24 04:02:06 2018 (r329903) @@ -140,12 +140,17 @@ local function check_nextboot() nextboot_file .. "'") end + -- Attempt to rewrite the first line and only the first line of the + -- nextboot_file. We overwrite it with nextboot_enable="NO", then + -- check for that on load. See: check_nextboot_enabled + -- It's worth noting that this won't work on every filesystem, so we + -- won't do anything notable if we have any errors in this process. local nfile = io.open(nextboot_file, 'w') if nfile ~= nil then - -- We're overwriting the first line of the file, so we need the - -- trailing space to account for the extra character taken up by - -- the string nextboot_enable="YES" -- our new end quotation - -- mark lands on the S. + -- We need the trailing space here to account for the extra + -- character taken up by the string nextboot_enable="YES" + -- Or new end quotation mark lands on the S, and we want to + -- rewrite the entirety of the first line. io.write(nfile, "nextboot_enable=\"NO\" ") io.close(nfile) end