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 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
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@.
Reported by: bapt@, emaste@