Bug 277528 - EFI loader build fails when LOADER_NET_SUPPORT=no
Summary: EFI loader build fails when LOADER_NET_SUPPORT=no
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.2-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-06 14:18 UTC by Tatiana
Modified: 2024-11-04 04:59 UTC (History)
1 user (show)

See Also:


Attachments
fix to the loader.efi issue (498 bytes, patch)
2024-03-06 14:18 UTC, Tatiana
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tatiana 2024-03-06 14:18:07 UTC
Created attachment 248972 [details]
fix to the loader.efi issue

When building loader.efi with LOADER_NET_SUPPORT=no an error occurs:

ld: error: undefined symbol: net_parse_rootpath
>>> referenced by main.c:1760 (out/usr/src/stand/efi/loader_simp/../loader/main.c:1760)
>>>               main.o:(command_netserver)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1


Probably cause stand/common/dev_net.h (witch contains net_parse_rootpath) is disabled
There was a similar problem in 11.3 fixed with https://reviews.freebsd.org/rGbe4890f75e7c68ae6bc5978a85860d78d05ae02b

But COMMAND_SET(netserver, "netserver"...) in efi/loader/main.c efi/loader/main.c was added later. Probably that is the reason

I'm attaching the patch that I've used to disable this command. Which looks logically fine - cause why need netserver if LOADER_NET_SUPPORT=no
Comment 1 Warner Losh freebsd_committer freebsd_triage 2024-11-02 22:15:56 UTC
Looks good. Committed. Thanks!
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-11-02 22:17:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=47ef2a131091508e049ab10cad7f91a3c1342cd9

commit 47ef2a131091508e049ab10cad7f91a3c1342cd9
Author:     Tatiana <t.ermakova@securitycode.ru>
AuthorDate: 2024-11-02 22:13:58 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-11-02 22:13:58 +0000

    loader.efi: Fix LOADER_NET_SUPPORT=no builds

    We include too many references to networking things in the
    non-networking build for loader.efi. Ifdef out netserver command when we
    are disabling network support to resolve.

    PR: 277528
    MFC After: 2 days
    Reviewed by: imp

 stand/efi/loader/main.c | 2 ++
 1 file changed, 2 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-11-04 04:59:14 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=adce5eaab9a975655cd846c9841551ed8f89207a

commit adce5eaab9a975655cd846c9841551ed8f89207a
Author:     Tatiana <t.ermakova@securitycode.ru>
AuthorDate: 2024-11-02 22:13:58 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-11-04 00:51:25 +0000

    loader.efi: Fix LOADER_NET_SUPPORT=no builds

    We include too many references to networking things in the
    non-networking build for loader.efi. Ifdef out netserver command when we
    are disabling network support to resolve.

    PR: 277528
    MFC After: 2 days
    Reviewed by: imp

    (cherry picked from commit 47ef2a131091508e049ab10cad7f91a3c1342cd9)

 stand/efi/loader/main.c | 2 ++
 1 file changed, 2 insertions(+)