Subject: Re: problems with mtree
To: <>
From: David Laight <david@wheelbarrow.l8s.co.uk>
List: current-users
Date: 01/13/2002 23:20:18
Luke Mewburn wrote:
> 
> On Sun, Jan 13, 2002 at 04:33:10PM +0000, David Laight wrote:
>   | Maybe this isn't quite the usual sequence, but I'm trying to get the
>   | root filesystem for a current build up.
>   |
>   | Now I don't what to build as root (if it can be helped) to ensure the
>   | build system isn't trashed any more that absolutely necessary :-)
>   |

> 
> That's because there needs to be a little more tweaking done with
> respect to using the generated metalog with mtree, because the metalog
> is not a complete mtree spec file:
>         - you need to remove the prefix (as you've worked out)

It also needs removing from the link= fields

>         - you need to prepend the contents of /usr/src/etc/mtree/NetBSD.dist
>           to the metalog before calling mtree, so that directories
>           referenced in the metalog exist in t

I've spotted that, and done it. My directories are populated and have
the correct permissions.
> 
> We're still tweaking how this stuff works. For example, the hlink
> entries (hard link) generated by install aren't yet understood by
> mtree and makefs; I'm working on this.

I notices that the METALOG has mode=0755 for all the symlink and hard
links.  Indeed the symlinks in $DEST also have this mode eg:

lrwxr-xr-x   1 dsl  wheel    11 Jan 11 12:05 sys -> usr/src/sys

I did start trying to write a shell script to parse the METALOG, but it
is all rather tedious.  Far easier in C!

Since I just want to fix the permissions (etc) nothing as complicated as
mtree is needed.  Might write it tomorrow.

Having used build.sh to compile the world, is there an easy way to
rebuild a single program? (without hitting /etc/mk.conf - since I still
wnat to be able to build 1.5.2 stuff in a different tree).

At some point (soon) I wnat to build an arm version - so don't want any
objects lurking.  In the past I set up a build system that used an
overlay fs to keep the build from hitting the source tree...

	David