[ previous ] [ next ] [ threads ]
 From:  Joey Morin <joeymorin at alumni dot uwaterloo dot ca>
 To:  m0n0wall at lists dot m0n0 dot ch
 Subject:  Re: [m0n0wall] Installation with no keyboard
 Date:  Sat, 2 Oct 2010 12:17:23 -0400
On Sat, Oct 2, 2010 at 11:30 AM, Lee Sharp <leesharp at hal dash pc dot org> wrote:

> On 10/02/2010 10:39 AM, Joe wrote:
> > ** Is there a way to choose one of the above NICs by mounting the image
> > in Linux and editing something?
> No good.  There is no linux driver for this filesystem.  You need a FreeBSD
> system to mount the compressed filesystem.  At that point you can mount the
> image to change both the current config, and the default config so you are
> not in this situation again.

under linux:
fetch the latest generic m0n0wall image and uncompress it
gzip -d < generic-pc-1.32.img > generic-pc-1.32.img.uncompressed
mount -t ufs -o loop,ufstype=44bsd,offset=8192
generic-pc-1.32.img.uncompressed mnt/

however, this will fail unless your kernel has write support for ufs.  the
default kernel for debian/ubuntu does not.  you can compile your own kernel:

once mounted read/write, you can edit the config file
vi mnt/conf/config.xml
search for sis0, which is the default lan driver m0n0wall ships with, and
change it to fxp0.  save the file, and unmount the image.

if you don't feel up to compiling your own kernel, there's another (dirty)
hexedit generic-pc-1.32.img.uncompressed

tab over to the ascii side on the right and search (/) for sis0.  you can
type over the sis with fxp and save the file (ctrl-x).  what you've just
done is modify the raw ufs file system that is the m0n0wall.  the only
change you've made are three characters, which happen to be the three
characters that define the driver for the lan interface.  you can confirm
this by mounting the modified image:
mount -t ufs -o ro,loop,ufstype=44bsd,offset=8192
generic-pc-1.32.img.uncompressed mnt/
and check the config file:
less mnt/conf/config.xml

for either method, after you've modified the image install the SG20's disk
into your linux machine, and dd if=generic-pc-1.32.img.uncompressed
of=/dev/<your-SG20-disk>.  be very careful, as you'll have to do this as
root.  don't clobber your linux system disk.

with luck, you'll now be able to boot the SG20 with the newly copied
m0n0wall image, and the intel pro nic will be the lan interface.  from
there, you should be able to get at the webgui and finish the config.

i have used both of these approaches in the past to configure
headless/keyless m0n0walls.