From nobody Wed Feb 14 17:55:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TZm813xPPz518Lb; Wed, 14 Feb 2024 17:55:45 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TZm813NkZz4M1P; Wed, 14 Feb 2024 17:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707933345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pi7BPbBPcO7QYYKGEZgXV9aZHSEdVGZb94EyfhPbre0=; b=gFsnb6ux/uNIVYwExjtXfXr8zHg1hQYsj1z/wJZgz0zUOsItAXsgKzp07X5cMfqP2azBER bFBCBwmOfdfBHGnJ2+BYV0XLsIx1VP26V7AtvIkdTWEvNjkL5sfZ1DAt9FAVcYxi6uk4Ys MEdNi/nCH0Fzjnqbk2ortrFjWU7AOq5Wx0q8AYkXKjQ7w++5wZOn7+P++PyAJHCIU84fPH Zcj75gIyYxdlpZclJ2C0dTAW9dKnmT9OUvgKX3WPrNQEx7sCvk6kJmFCGiuIpTYQehZONK zDNjGNr7aig8CN92hLkEBr2vuFhIibqxQ9veMU6vHhK3LgVeSzbglfqQZnEsiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707933345; a=rsa-sha256; cv=none; b=LKQuq40Rtlig3dI5aRDXGkMdGrxjrYSgcUR9MqknIw69kJTlSMsYqrw4yTP22qyrN0cxS9 u/TX0lmKgYFCPYQ1CxHIYu2rk8bYEdSrqrEiycyABBgp76tyMRZvH+CeYx5lppPf0Phbwk 1mFv8MIfjZLFa9tBjdWdUskALzk3ELSlM8zr7eouoEMpMMZ4fXYiCmdYfv58WKbPTyHhhH IMFxWu9RUiCrRpGF6Tm+2G219kB3UzfhvsXugxSpNsqjI4ZDqICZthbTT1LSAcdyYAYASn GACKfdd544ePnNbsI+R0sfvhDfTJEsEQYCC7d4+pvBKn7E+e0XgXGNPBW3qcBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707933345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pi7BPbBPcO7QYYKGEZgXV9aZHSEdVGZb94EyfhPbre0=; b=aTZj8ZhaIkUECELagFY9xGlF1uVgZ/3I50AdQ/YGXi9yIISS8yfT0SuNXQV7Q6NVcNkW0R M5FQq08+1uXx8EdVwFSQ9iUNCMs+j6uWDeLJtb0P09UhTEyYU0CzaVIvaPt1DXmZikzWb9 Au9fSRfpO79XCwNLMCOfC3BIP5+KS67kTcUjV8MF3z4U2zaB4N7N0700xJqhMtAZ2m3+4F x8IaDhjrI86APjiegS49dtTTSSHU0aC4ABW/uq6U0AsEvZO3v5bVd+5p2faDqtLWN8DrQC KEA5cjyW6KcbtBngkRLUVWnJTZtWjByTAwoYzKhgfG4aZeLsJG7cISRg6j6XhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TZm812R4kz17S1; Wed, 14 Feb 2024 17:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41EHtjaP083003; Wed, 14 Feb 2024 17:55:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41EHtjNc083000; Wed, 14 Feb 2024 17:55:45 GMT (envelope-from git) Date: Wed, 14 Feb 2024 17:55:45 GMT Message-Id: <202402141755.41EHtjNc083000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: cd147a2a0243 - main - loader: Fetch initial script from loader_lua env List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd147a2a024301a796f307c7bae686305d2bf302 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cd147a2a024301a796f307c7bae686305d2bf302 commit cd147a2a024301a796f307c7bae686305d2bf302 Author: Warner Losh AuthorDate: 2024-02-14 17:51:38 +0000 Commit: Warner Losh CommitDate: 2024-02-14 17:55:38 +0000 loader: Fetch initial script from loader_lua env Sometimes it is nice to override the initial script that we run. Make it possible by fetching loader_lua from the env and using that instead of the default if prsent. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D43819 --- stand/common/interp_lua.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stand/common/interp_lua.c b/stand/common/interp_lua.c index db58d80b2048..3f758baebc2d 100644 --- a/stand/common/interp_lua.c +++ b/stand/common/interp_lua.c @@ -123,7 +123,9 @@ interp_init(void) lua_pop(luap, 1); /* remove lib */ } - filename = LOADER_LUA; + filename = getenv("loader_lua"); + if (filename == NULL) + filename = LOADER_LUA; if (interp_include(filename) != 0) { const char *errstr = lua_tostring(luap, -1); errstr = errstr == NULL ? "unknown" : errstr;