Page MenuHomeFreeBSD

BSD.root.dist: Add package tag for all directories
ClosedPublic

Authored by ivy on Tue, Oct 7, 4:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 4:20 PM
Unknown Object (File)
Sun, Oct 12, 9:03 AM
Unknown Object (File)
Fri, Oct 10, 10:49 AM
Unknown Object (File)
Fri, Oct 10, 10:49 AM
Unknown Object (File)
Fri, Oct 10, 10:49 AM
Unknown Object (File)
Fri, Oct 10, 4:16 AM
Unknown Object (File)
Fri, Oct 10, 12:47 AM
Unknown Object (File)
Thu, Oct 9, 9:23 PM

Details

Summary

This fixes some missing directories, notably /boot/modules. Other
directories are not missing because they contain other files, but
they should still have their own METALOG entries and be placed in
the correct package.

Reported by: bdrewery
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ivy requested review of this revision.Tue, Oct 7, 4:35 PM

I wondered if "bsdinstall --jail" for base-jail would establish materials in the jail that would be associated with: "/set tags=package=bootloader". So I tried it with the old BSD-root.dist in place and looking after the creation:

# ls -loaT jail-pkgbase-base-jail/boot/
total 8
drwxr-xr-x   2 root wheel - 512 Oct  7 10:38:43 2025 .
drwxr-xr-x  17 root wheel - 512 Oct  7 10:38:43 2025 ..

(So boot/ showed up but nothing inside it did for use of the old BSD.root.dist . That does not seem to be from interpreting/applying BSD.root.dist .)

So, while I think these changes may well be appropriate, I'm not sure that they will fix issues analogous to IMMUTABLE_BASE=yes and boot/modules/ for poudriere(-devel) (i.e, that boot/modules/ ends up not existing but being referenced).

In an experiment on aarch64 based on changing poudriere-devel to use FreeBSD-set-minimal-jail FreeBSD-set-devel FreeBSD-set-lib32 (still leaving FreeBSD-src-sys separate), I got a:

[00:00:01] Setting schg on jail base paths
chflags: /usr/local/poudriere/data/.m/main-min-devel-lib32-aarch64-default/ref/boot/modules: No such file or directory
chflags: /usr/local/poudriere/data/.m/main-min-devel-lib32-aarch64-default/ref/boot/firmware: No such file or directory
Error: (84516) /usr/local/share/poudriere/bulk.sh:jail_start:255: set -e error: status = 1

Mostly that is of interest for noting boot/firmware can also be missing.

But it also pointed out that the code in poudiere/common.sh is odd for the chflags -R use:

                chflags -R noschg \
. . .
                    "${tomnt:?}/boot/modules" \
                    "${tomnt:?}/boot/firmware" \
                    "${tomnt:?}/boot"

The -R noschg only needs the "${tomnt:?}/boot" in order to also set the other 2 when they exist.

Assuming they are recrusive, this looks perfect.

This revision is now accepted and ready to land.Wed, Oct 8, 12:27 AM

So boot/ showed up but nothing inside it did for use of the old BSD.root.dist

there are two possible problems here:

  • there is a pkg(8) issue where adding a new directory doesn't change the package checksum, so you need to do a make packages (not update-packages) for this change to show up.
  • set-base-jail does not install the bootloader, so /boot/modules won't exist there. i think this is correct behaviour, so if poudriere is using set-base-jail, this probably needs to be fixed in poudriere, unless someone wants to argue that we should install these paths in a jail. as poudriere is often building things for a real host, it might be that set-base is more appropriate than set-base-jail.
In D52958#1210177, @imp wrote:

Assuming they are recrusive, this looks perfect.

unfortunately tags are not recursive, which is why i used /set for the bootloader directories, otherwise you'd need tags=package=bootloader on every line. i thought about fixing this in mtree-to-plist, but it's really an mtree(1) issue.