[ previous ] [ next ] [ threads ]
 
 From:  "Barry Mather" <barry dot mather at dorecentres dot com dot au>
 To:  <m0n0wall at lists dot m0n0 dot ch>
 Subject:  RE: [m0n0wall] Self-healing file system?
 Date:  Mon, 28 Feb 2005 08:28:08 +1100
I presume you are copying them from the tmp upload dir to the place
where they are supposed to be ?

cheers

-----Original Message-----
From: Frans King [mailto:frans dot king at f333 dot net] 
Sent: Monday, 28 February 2005 4:13 AM
To: m0n0wall at lists dot m0n0 dot ch
Subject: RE: [m0n0wall] Self-healing file system?

The only way to edit a running m0n0wall is to download files from
exec.php,
modify them and the upload them again via exec.php. There is no ftp
subsystem. 

 

I haven't seen a non-resetting version of m0n0wall.

 

The m0n0wall image format in FreeBSD looks a bit like this:

 

/cf

Mfsroot.gz

Kernel.gz

 

The /cf part is where the config file gets stored. It's mounted as a
normal
partition but is read-only. When you make config changes its remounted
read-write and a new config.xml is written. Then its set back to read
only.

 

Kernel.gz is a compressed kernel binary.

 

Mfsroot.gz is a compressed disk image that contains the root filesystem.
This is unpacked into memory and mounted as "/" during the boot. Think
of it
as a bit like an ISO image that under linux you can mount with "mount -o
loop /mnt/iso my_image.iso".

 

Under FreeBSD I do the following to make changes:

 

Download latest image (latest.img)

 

mv latest.img latest.img.gz

gzip -d latest.img.gz                                    (uncompress the
image - renamed to .gz otherwise gzip gets upset)

 

vnconfig -s labels -c vn0 latest.img                (latest.img is now
"mapped" to the vn0 virtual disk node)

mount /dev/vn0a /mnt

 

cd /mnt

cp mfsroot.gz /var/tmp

cd /var/tmp

umount /mnt

vnconfig -u vn0 (release vn0)

 

gzip -d mfsroot.gz                                      (uncompress the
root
file system image)

vnconfig -s labels -c vn0 mfsroot

mount /dev/vn0c /mnt

 

Now you can edit files in the /mnt directory which will be written back
to
the mfsroot image

 

umount /mnt

vnconfig -u vn0

 

(recompress the modified root image copy it back to the m0n0wall image)

 

gzip -9 /var/tmp/mfsroot

vnconfig -s labels -c vn0 latest.img

mount /dev/vn0a /mnt

mv /var/tmp/mfsroot /mnt/mfsroot.gz

umount /mnt

vnconfig -u vn0

 

gzip -9 latest.img

mv latest.img latest-modified.img (now upgrade m0n0wall with this image)

 

Done!

 

I think someone has written some bash scripts to do all of this work for
you
but I'm not sure who.

 

Regards,

 

Frans

 

P.S. If you start with a working image (as above) then you don't need to
bother about compiling kernels / creating disk images / installing the
boot
loader etc.




Dore Achievement Centres (Pty) Ltd - Hotline: 1300 55 77 11

www.dorecentres.com.au

This e-mail message may contain confidential or privileged information 
and is intended solely for the individual to whom it is addressed. If you 
are not the named addressee you should not disseminate, distribute or 
copy this e-mail. If you have received it in error please notify us 
immediately by telephoning 1300 55 77 11 and destroy this e-mail and 
any attachments. E-mail transmission cannot be guaranteed to be 
secure or error-free as information could be intercepted, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses. The sender 
therefore does not accept liability for any errors or omissions in the 
contents of this message, which arise as a result of e-mail transmission. 
The content of this email is not necessarily that of the Dore Acievement 
Centres unless otherwise specified.  This email was scanned for possible 
viruses and was sent on 28/2/2005 by barry dot mather at dorecentres dot com dot au to m0n0wall at lists dot m0n0 dot ch