Subject: Re: problems with mtree
To: David Laight <>
From: Luke Mewburn <>
List: current-users
Date: 01/14/2002 09:58:33
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 :-)
  | So as 'me' I've run using the script:
  | #!/bin/sh
  | exec 2>&1
  | DESTDIR=/usr/bsd-current/dest
  | RELEASEDIR=/usr/bsd-current/release
  | -u -D /usr/bsd-current/dest -O /usr/bsd-current/obj "$@"
  | I then created a filesytem (to be the new root) and mounted it on /mnt
  | then:
  | # cd $DESTDIR; cp -R . /mnt
  | # chroot /mnt
  | # cd /dev; MAKEDEV all
  | # mtree -U -def /etc/mtree/NetBSD.dist
  | The next job is fixing the file permnissions, the required values are in
  | $OBJ/METALOG so you might think that:
  | # mtree -U -f /tmp/METALOG
  | would do the trick (where you have copied METALOG into the chroot) 
  | however this fails because all the entries in METALOG are preceeded by
  | ./usr/bsd-current/dest which is no longer true.
  | Interestingly mtree fails:
  | mtree: .: No such file or directory
  | mtree: failed at line 1 of the specification
  | even ktrace doesn't show a failing syscall....
  | Removing the directory prefix doesn't actually make a difference!

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)
	- 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

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.


Luke Mewburn  <>
Luke Mewburn     <>
Wasabi Systems - NetBSD hackers for hire
NetBSD - the world's most portable UNIX-like operating system