Conversation
Building a fresh tree with fs=ramfs fails during MKBOOTFS:
strip: 'tools/mount/mount-fs.so': No such file
FileNotFoundError: [Errno 2] No such file or directory:
'tools/mount/mount-fs.so'
make: *** [Makefile:2238: build/release.x64/bootfs.bin] Error 1
For fs=ramfs, scripts/build uses the generated $(out)/usr.manifest as the
bootfs manifest, and that manifest comes from usr_ramfs.manifest.skel, which
lists two tools:
/tools/mount-fs.so: tools/mount/mount-fs.so
/tools/umount.so: tools/mount/umount.so
But bootfs_dep only gains the tools for fs=ext and fs=zfs, so for fs=ramfs
nothing orders those two objects before bootfs.bin. mkbootfs.py then stats a
file that make was never told to build first and aborts.
This is timing dependent, which is why it is not always seen: in a tree that
already built something else the tools may happen to exist. In a clean clone
it fails every time, because bootfs.bin is reached before anything else has a
reason to build the mount tools.
Add just those two objects to bootfs_dep for fs=ramfs. Only the files the
ramfs manifest actually names are added, rather than all of $(tools), to keep
the dependency minimal and avoid pulling mkfs/cpiod/uush into a ramfs build
that does not reference them.
Verified on a clean clone of upstream master, which is where this reproduces
most clearly:
fresh clone, fs=ramfs, without this change: build fails at MKBOOTFS
fresh clone, fs=ramfs, with this change: build completes, image produced
and re-checked that the default (zfs) and fs=rofs builds still complete, so
the added dependency does not disturb the other filesystem paths.
Signed-off-by: Greg Burd <greg@burd.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Building a fresh tree with
fs=ramfsfails duringMKBOOTFS:Cause
For
fs=ramfs,scripts/builduses the generated$(out)/usr.manifestas the bootfs manifest, and that manifest is generated fromusr_ramfs.manifest.skel, which names two tools:bootfs_dep, however, only gains the tools forfs=extandfs=zfs:So for
fs=ramfsnothing orders those two objects beforebootfs.bin, andmkbootfs.pystats a file make was never told to build first.It is timing dependent, which is why it is not always visible: in a tree that already built something else the tools may happen to be present. In a clean clone it fails every time, because
bootfs.binis reached before anything else has a reason to build the mount tools.Fix
Add just those two objects to
bootfs_depforfs=ramfs. Only the files the ramfs manifest actually names are added, rather than all of$(tools), so a ramfs build does not start pulling inmkfs/cpiod/uush, which it never references.Verification
I checked this against a clean clone of this repository's master rather than only against my own tree, since that is where it reproduces most clearly:
fs=ramfs, without this changeMKBOOTFS(FileNotFoundError)fs=ramfs, with this changeI also re-ran the default (
zfs) andfs=rofsbuilds with the change applied and both still complete, so the added dependency does not disturb the other filesystem paths.Note this is a distinct problem from the
bootfsZFS-library dependency in #1494: that one is aboutlibsolaris.soand the ZFS tools for a ZFS-enabled build, while this is the ramfs manifest's own two mount tools going unordered.