[ previous ] [ next ] [ threads ]
 
 From:  "Magne Andreassen" <magne dot andreassen at bluezone dot no>
 To:  "'Steve Bihari'" <sbihari1 at cogeco dot ca>, <m0n0wall at lists dot m0n0 dot ch>
 Subject:  RE: [m0n0wall] vnconfig to re-create new image
 Date:  Sat, 20 Sep 2003 14:15:04 +0200
Steve Bihari wrote:
> Hi All,
> 
> 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? 
> 

You could do it as done in the m0n0wall hackers guide.
This is how i do it:

On your BSD 4.8 host machine:
Make a folder, and download the latest net45xx or generic-pc image to
it.
Rename the file, and append ".gz" to the filename eg:
net45xx-pbXXrXXX.img.gz
Decompress the image with: 'gzip -d net45xx-pbXXrXXX.img.gz'
Use vnconfig: 'vnconfig -s labels -c vn0 net45xx-pbXXrXXX.img'
Mount the image: 'mount /dev/vn0a /mnt'
Copy the mfsroot.gz from /mnt to a location of your choice.
Unmount: 'umount /mnt'
Unlink image: 'vnconfig -u vn0'
Uncompress the mfsroot.gz file: 'gzip -d mfsroot.gz'
Vnconfig again, the filesystem now: 'vnconfig -s lablels -c vn0 mfsroot'
Mount the image: 'mount /dev/vn0 /mnt'

Do any changes you like to the rootfilesystem in the /mnt directory,

Do unmount again: 'umount /mnt'
And unlink: 'vnconfig -u vn0'
Compress the image: 'gzip -9 mfsroot'
Mount the net45xx.img: 'vnconfig -s labels -c vn0 net45xx-pbXXrXXX.img'
And: 'mount /dev/vn0a /mnt'
Copy your modified mfsroot.gz into /mnt
Unmount: 'vnconfig -u vn0'
And: 'umount /mnt'
Compress your new image: 'gzip -9 net45xx-pbXXrXXX.img'
And upload it!


Preferrably you would make a shell script to do this for you...
Same procedure could also be used to replace the kernel in the 
generic-pc image. Of course then you would have to build a new
kernel first.


Magne