[ previous ] [ next ] [ threads ]
 
 From:  Fred Wright <fw at well dot com>
 To:  m0n0wall at lists dot m0n0 dot ch
 Subject:  Re: [m0n0wall] vnconfig to re-create new image
 Date:  Mon, 22 Sep 2003 14:15:01 -0700 (PDT)
On Fri, 19 Sep 2003, Steve Bihari wrote:

> I've been following the hackers guide and managed to get the current
> net45xx-p15 image mounted in /mnt on my host server.  I then downloaded
> and untarred the current rootfs.tar.gz, modified it and recompressed
> back into a new mfsroot.gz.  Is there anyway to just copy my modified
> mfsroot.gz into /mnt (overwriting the original packaged one) and
> recreate the raw image file from the existing contents of /mnt to create
> a brand new modified image?

Although someone else posted something more detailed, the short answer is
that when you mount a drive image via vnconfig, you're mounting it
read-write.  Any changes you make to the mounted filesystem are written to
the image file as you make them.  You should of course unmount and
un-vnconfig it when done to insure that the changes are flushed out from
buffers.

You can do the same thing with the mfsroot image after gunzipping it; the
rootfs archive is mainly for situations where you can't mount an image,
but you wouldn't be able to update the top-level image in that event.

I hope by "recompressed" you didn't mean as a tarball, since that isn't
the right format.

You can have both levels of image mounted at the same time, but the
default FreeBSD config only has one vnode device, so you need to add more
if you want to do that.

When editing scripts, I recommend editing a copy and copying the result
back, to avoid polluting the image with backup files, and messing up the
disk layout with the write/rename approach that text editors typically
use.

					Fred Wright