Bug 271178

Summary: loader.help.* files installed multiple times
Product: Base System Reporter: Ed Maste <emaste>
Component: miscAssignee: Ed Maste <emaste>
Status: Closed FIXED    
Severity: Affects Some People CC: pkgbase
Priority: --- Keywords: loader, pkgbase
Version: CURRENTFlags: linimon: mfc-stable13?
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267134
https://reviews.freebsd.org/D39898
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244596
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271266
Bug Depends on:    
Bug Blocks: 231027    

Description Ed Maste freebsd_committer freebsd_triage 2023-05-01 17:59:25 UTC
Any given file in a FreeBSD installworld should be installed exactly once, but this is not true for the loader.help files. From cirrus-CI running the pkgbase metalog check:

warning: ./boot/loader.help.bios file repeated with same meta: line 26843,26846,26851
warning: ./boot/loader.help.efi file repeated with same meta: line 26867,26870,26874
warning: ./boot/loader.help.userboot file repeated with same meta: line 26821,26825

This can be reproduced locally via
% make packages
% flua tools/pkgbase/metalog_reader.lua -c <path to METALOG>

(Once these ones are fixed this will be made into an error -- see https://reviews.freebsd.org/D39898)
Comment 1 Ed Maste freebsd_committer freebsd_triage 2023-05-01 18:41:18 UTC
Note that this issue is not directly related to pkgbase -- it is an issue independent of whether pkgbase is in use or not. It's just that the issue is detected by pkgbase tooling.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-05-01 19:29:30 UTC
A commit in branch main references this bug:

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

commit 2a3bd0870869819354b5ea65761d13e5e2987697
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-05-01 17:25:18 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-05-01 19:22:36 +0000

    pkgbase: hide duplicate METALOG directory warnings under verbose

    Creating directories multiple times is an inherent side effect of the
    way installation is done.  Hide warnings from duplicate directory
    entries (with identical metadata) under metalog_reader's verbose mode.

    Duplicate file entries are always reported.  They currently generate
    warnings but will be switched to errors once the few instances currently
    in the tree are fixed.

    PR:             244596, 271178
    Reviewed by:    kevans
    Sponsored By:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D39898

 tools/pkgbase/metalog_reader.lua | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-05-04 16:46:35 UTC
A commit in branch stable/13 references this bug:

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

commit f6488428308edeb1fb8fc8aa0eb4e2744db78748
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-05-01 17:25:18 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-05-04 16:45:50 +0000

    pkgbase: hide duplicate METALOG directory warnings under verbose

    Creating directories multiple times is an inherent side effect of the
    way installation is done.  Hide warnings from duplicate directory
    entries (with identical metadata) under metalog_reader's verbose mode.

    Duplicate file entries are always reported.  They currently generate
    warnings but will be switched to errors once the few instances currently
    in the tree are fixed.

    PR:             244596, 271178
    Reviewed by:    kevans
    Sponsored By:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D39898

    (cherry picked from commit 2a3bd0870869819354b5ea65761d13e5e2987697)

 tools/pkgbase/metalog_reader.lua | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-05-10 00:21:27 UTC
A commit in branch main references this bug:

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

commit e32fecd0c2c3ee37c47ee100f169e7eb0282a873
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-05-05 17:43:33 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-05-10 00:18:19 +0000

    loader: install help files only once

    Every file should be installed exactly once by `make installworld`.
    This is especially important for pkgbase.

    Loader help files were being installed by each loader variant (e.g.,
    the simp, lua, and 4th EFI loaders).  Add a (slightly hacky) mechanism
    to skip installing help files for all but one variant.

    PR:             271178
    Reviewed by:    imp
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D40021

 stand/efi/loader_4th/Makefile        | 1 +
 stand/efi/loader_lua/Makefile        | 1 +
 stand/i386/loader_4th/Makefile       | 1 +
 stand/i386/loader_lua/Makefile       | 1 +
 stand/loader.mk                      | 2 ++
 stand/userboot/userboot_4th/Makefile | 1 +
 stand/userboot/userboot_lua/Makefile | 1 +
 7 files changed, 8 insertions(+)
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-05-12 17:25:32 UTC
A commit in branch main references this bug:

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

commit 48267a0a92633a6248d3bf62f5d31aea593c685d
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-05-09 13:19:42 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-05-12 17:24:48 +0000

    loader: restore userboot help file

    Commit e32fecd0c2c3 intended to skip installing all but one copy of
    each loader variant's help file, but accidentally skipped all copies for
    the userboot help file.  (Other loaders install help files via the _simp
    variant, but there is is no userboot_simp.)

    PR:             271178
    Fixes:          e32fecd0c2c3 ("loader: install help files only once")
    Sponsored by:   The FreeBSD Foundation

 stand/userboot/userboot_lua/Makefile | 1 -
 1 file changed, 1 deletion(-)
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2024-01-10 06:23:14 UTC
^Triage: assign to committer that resolved.
Comment 7 Ed Maste freebsd_committer freebsd_triage 2024-01-10 15:27:02 UTC
This is primarily an issue for pkgbase, and is thus relevant to 14.x and later. I have no current plans to MFC.