From nobody Tue Jan 24 22:13:58 2023 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 4P1h870gS0z3bgLX; Tue, 24 Jan 2023 22:13:59 +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 4P1h866xZXz3K7g; Tue, 24 Jan 2023 22:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598439; 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=B4UYJBh3GOmaYwm8q9512vQAgVSuea17qm+PMRedyLo=; b=dgAOIPmm8vdS76iaxJaBawzm8nxa5Rjev4+mH0oRJB5sZ0+SmUmA/xPh5Nkk6l0ZAHUk16 mxyDvyvYTRj6sDZyDWUR6JqUX0SN9ETwOP6h7pOdl8cpLpmOL6OxFWOP/zIdRWmdZGrZ23 OpvmEwpoY/g3MKui9fpAlvnIO9S+46a4X8REbivoi94T6PbT5vKupDk2kv4hcP4Gr/j5+U RtCOFakr96aI/8N2fQhAsvtb7IL7mHK6SqX8Gdhn9glqN/Q5pb3ODPGMoxwtqJIOIWPojc A0iD19/CwV8DOJLUKUqw5YK3mU/hJJNFvh8FvkSO82IqW8K5d8oBgUF/idPf4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598439; 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=B4UYJBh3GOmaYwm8q9512vQAgVSuea17qm+PMRedyLo=; b=mhS/wwVnbOI/UDv7LjK5wcuXm/9NUbG8bnIBjSHKdTo2b0gwkhNMbVq2RRzlF7z1HSqhi5 VObrsPAc9/0XOQQ7KtM5MPbct5Imum++YjLYSUgaUUPUxInD6dT1Xhmm8uVa4CFP+FtcwG cUTSC4ufHDDzVLV4Ja0gFNo+iY8wDI13tY51fH/e2M8il0ygS73Lb8Mr2TVeQNkILdc80J Rv0r41lG4U6XF1rS125vlIumMpYaxlz/ANRrlMiHLe20saOxk4IwTFDQhHtF70/51HAi9D Jlk20vc9Ci0FnNz1SDbDXUmjRvmkZWtaHzug6pKIUzFY8KaECcEz18LxudrIUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598439; a=rsa-sha256; cv=none; b=Wu2Y+CFaPdTonxpS2gugklfwwyJuklKxO1vGatamYaCsW4WxshflQGCWfmaMDN5CuGru+b ltKiPfQZtOqH6+YjWyw1iqdRoEnGt0vsP2pkhqJZ4VYFviu1fHyQFmUSY43aHunACJXr+V HsiTzcRseEtDNmsXZF5vgcKiHH1M4rBF8vWddwVFdj1V615Au/GR6Fvnbxtaa8Q0dKAd/k y3ZONLTEuImc18mUwmet7mkDv36eH/aRYbHf9hpDYOr8ygbJqizhHRJk+swoetCGuiGXOq 08o8ppYKaeRwA7XJnXibD6XT+7HJQEHjVJt6P2CUHjYCxmqVSgWOEiLq1tYwrA== 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 4P1h865n9wzQW1; Tue, 24 Jan 2023 22:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30OMDw7F089181; Tue, 24 Jan 2023 22:13:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMDwRm089180; Tue, 24 Jan 2023 22:13:58 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:13:58 GMT Message-Id: <202301242213.30OMDwRm089180@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 693894521c5e - stable/13 - kboot: Mark the EFI specific parts of bootinfo.c 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 693894521c5e3f5c7f632ecb7d9f33711f4d57e2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=693894521c5e3f5c7f632ecb7d9f33711f4d57e2 commit 693894521c5e3f5c7f632ecb7d9f33711f4d57e2 Author: Warner Losh AuthorDate: 2022-12-06 17:55:58 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:43 +0000 kboot: Mark the EFI specific parts of bootinfo.c bootinfo.c is about to be shared with kboot since they create substantially similar environments / metadata tagging / etc. Tag this with #ifdef EFI for the moment until the proper abstracting out can happen. Sponsored by: Netflix (cherry picked from commit b11aebff4d4a301bfeac516b5be45080c8a11142) --- stand/efi/loader/bootinfo.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index e05197189a46..a6b722b947e9 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -40,8 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EFI #include #include +#endif #include "bootstrap.h" #include "modinfo.h" @@ -50,8 +52,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef EFI #include "loader_efi.h" #include "gfx_fb.h" +#endif #if defined(LOADER_FDT_SUPPORT) #include @@ -69,10 +73,12 @@ int boot_services_gone; static int bi_getboothowto(char *kargs) { +#ifdef EFI const char *sw, *tmp; char *opts; int speed, port; char buf[50]; +#endif char *console; int howto; @@ -85,6 +91,7 @@ bi_getboothowto(char *kargs) howto |= RB_SERIAL; if (strcmp(console, "nullconsole") == 0) howto |= RB_MUTE; +#ifdef EFI #if defined(__i386__) || defined(__amd64__) if (strcmp(console, "efi") == 0 && getenv("efi_8250_uid") != NULL && @@ -123,12 +130,14 @@ bi_getboothowto(char *kargs) NULL, NULL); } } +#endif #endif } return (howto); } +#ifdef EFI static EFI_STATUS efi_do_vmap(EFI_MEMORY_DESCRIPTOR *mm, UINTN sz, UINTN mmsz, UINT32 mmver) { @@ -297,6 +306,7 @@ bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) return (0); } +#endif /* * Load the information expected by an amd64 kernel. @@ -353,8 +363,10 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) return(EINVAL); } +#ifdef EFI /* Try reading the /etc/fstab file to select the root device */ getrootmount(devformat(rootdev)); +#endif addr = 0; for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { @@ -410,11 +422,15 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) #ifdef MODINFOMD_MODULEP file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof(module), &module); #endif +#ifdef EFI file_addmetadata(kfp, MODINFOMD_FW_HANDLE, sizeof(ST), &ST); +#endif #ifdef LOADER_GELI_SUPPORT geli_export_key_metadata(kfp); #endif +#ifdef EFI bi_load_efi_data(kfp, exit_bs); +#endif size = md_copymodules(0, is64); /* Find the size of the modules */ kernend = roundup(addr + size, PAGE_SIZE);