From nobody Fri Mar 11 07:53:27 2022 X-Original-To: freebsd-questions@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 EFDFA1A18769 for ; Fri, 11 Mar 2022 07:53:30 +0000 (UTC) (envelope-from email@luiz.eng.br) Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KFJ8V05tVz3p0l for ; Fri, 11 Mar 2022 07:53:29 +0000 (UTC) (envelope-from email@luiz.eng.br) Received: by mail-ej1-x62f.google.com with SMTP id qt6so17267597ejb.11 for ; Thu, 10 Mar 2022 23:53:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=luiz.eng.br; s=google; h=message-id:date:mime-version:user-agent:content-language:to:from :subject:content-transfer-encoding; bh=Fa14KhVNPIqVPl6SC+u9CU47CyIo62hTnF2v+XcaJ/s=; b=R0yxkfbrwYm4/uyaWDJNCDPdI7hpg06S0H7kkKGZnzTbC2yEOD+Erh+9Bz7uQHNq37 OHPqsF5D5jz00SUH3p/uecIcya3FeW+e8kt28ImE4BdIem+QHbFdUuMc1IG9693UkIF8 SvwteQygrzHY05idV9A28ww8CJB4sSqHo2OhM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:from:subject:content-transfer-encoding; bh=Fa14KhVNPIqVPl6SC+u9CU47CyIo62hTnF2v+XcaJ/s=; b=KWtETU8G6btFiQEI2Ip2xK8joCeWCUQM4Yqy/38agB3mZyz+X2kAmxapFgKBpj7qcq DZVCUq5fyaqHuR61foE2EsTBu52oV6oxqgbaOLcyZMyoACRi5WgRzDDHKV/e2DvVLQZW z8QzYXYL3bLdrcm5/55pf0RnmSLdF+RLS0EG96yPA7RyzdfZnZd2D7UTvI1oW8qxKiFW ulaycKkcM5hOEZcPZWRsD6/DhVvMjpNLpg2cqZuOKz0JUHUA4uUaO3BUJlS+s/d55zKK /aL65zERVhXbZ30x/5e7Znd8ynANCx8Y72W9TYIYJJT1wpur6UXejqQN7k0cWdsio3sQ z8CA== X-Gm-Message-State: AOAM5335JGDHTCPDTl+/Ln1owd1zokv4TJmxXlataok47mArlb898mXH Ubb2rVYCSsnKEbrWyYo+9dROiaBtdoyQnQ== X-Google-Smtp-Source: ABdhPJyLA467xnm2V/fCxlTnnusvzAqkjWVPbiPSrV5weBOfS7uI/1rTMgfh21wl14inVc0RXhlHSA== X-Received: by 2002:a17:906:9b94:b0:6db:67b:a6d6 with SMTP id dd20-20020a1709069b9400b006db067ba6d6mr7257488ejc.367.1646985208474; Thu, 10 Mar 2022 23:53:28 -0800 (PST) Received: from ?IPV6:2a00:1f78:fffb:230:35ab:428c:33ba:6d51? ([2a00:1f78:fffb:230:35ab:428c:33ba:6d51]) by smtp.gmail.com with ESMTPSA id s8-20020a170906354800b006da9dec91f2sm2662418eja.163.2022.03.10.23.53.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Mar 2022 23:53:28 -0800 (PST) Message-ID: Date: Fri, 11 Mar 2022 08:53:27 +0100 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Content-Language: en-US To: freebsd-questions@freebsd.org From: Luiz Amaral Subject: UEFI detection problem when booting FreeBSD from Grub Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4KFJ8V05tVz3p0l X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=luiz.eng.br header.s=google header.b=R0yxkfbr; dmarc=pass (policy=none) header.from=luiz.eng.br; spf=pass (mx1.freebsd.org: domain of email@luiz.eng.br designates 2a00:1450:4864:20::62f as permitted sender) smtp.mailfrom=email@luiz.eng.br X-Spamd-Result: default: False [-4.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[luiz.eng.br:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[luiz.eng.br:+]; DMARC_POLICY_ALLOW(-0.50)[luiz.eng.br,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::62f:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-questions]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hello, I am currently booting FreeBSD via Grub in UEFI mode, but running into issues with the boot method detection in FreeBSD. I am using mfsBSD for it, together with the following Grub configuration: kfreebsd /mfsbsd/boot/kernel/kernel.gz -Dh kfreebsd_module_elf /mfsbsd/boot/kernel/efirt.ko kfreebsd_loadenv /mfsbsd/boot/device.hints kfreebsd_module /mfsbsd/mfsroot.gz type=mfs_root I am able to boot mfsBSD just fine, and from within mfsBSD I am able to provision FreeBSD on my local disk. The only issue now is that I need to create a new boot entry that points to the recently installed system, which I tried to do using efibootmgr. Whenever I tried to invoke efibootmgr, I was greeted with: root@hwlb-awtest-02:~ # efibootmgr efibootmgr: efi variables not supported on this system. root? kldload efirt? I am explicitly loading efirt with Grub and on dmesg I can see an entry for it, so I assume it's being loaded fine. Mar 10 16:27:55 mfsbsd kernel: module efirt already present! While checking other things, I realized that FreeBSD/mfsBSD was detecting the boot method as BIOS instead of UEFI: root@hwlb-awtest-02:~ # sysctl machdep.bootmethod machdep.bootmethod: BIOS What I am struggling now is to understand why this is happening. Does loader.efi perform special operations before loading the kernel that allows it to detect that it booted in UEFI mode? Did I miss something on my Grub entry? Thank you, Luiz