Page MenuHomeFreeBSD

Fix build with -DNO_ROOT
ClosedPublic

Authored by fernape on Nov 26 2021, 11:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 18, 10:17 PM
Unknown Object (File)
Sat, Oct 11, 7:44 PM
Unknown Object (File)
Sat, Oct 11, 6:45 PM
Unknown Object (File)
Sat, Oct 11, 5:13 PM
Unknown Object (File)
Aug 7 2025, 12:19 PM
Unknown Object (File)
Jul 29 2025, 7:02 PM
Unknown Object (File)
Jul 5 2025, 10:24 AM
Unknown Object (File)
Jul 1 2025, 2:49 AM
Subscribers

Details

Summary

The inclusion of 0a0f7486413c broke the build with the -DNO_ROOT option.
Specifically, that commit adds some relative paths (with ..) to METALOG
that make other tools using it, fail afterwards (tar, makefs...).

It's been argued[1] if this is really something mtree(8) should handle more
graciously. In the meantime, fix the breakage by changing the order in which
the links are created: first in the parent directory, then in the
architecture-specific subdirectory.

We keep the architecture-specific directories and the links to the parent
directories. This is something that we might want to change in the future.

This commit is based on a concept patch by avg@.

[1] https://lists.freebsd.org/archives/dev-commits-src-all/2021-November/index.html

Reported by: bapt@, emaste@

Test Plan
cd /usr/src && make -DNO_ROOT DESTDIR=~/tmp installworld
cd ~/tmp && makefs -D -B little -o label=FreeBSD_root -o version=2 ufs.part METALOG
mkdir ~/tmp2 && tar -C ~/tmp -c -f archive.tbz  @METALOG && cd ~/tmp2 && tar xvzf ~/tmp/archive.tbz

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42980
Build 39868: arc lint + arc unit