[ previous ] [ next ] [ threads ]
 From:  "Rob Whyte" <rob at g dash labs dot com>
 To:  "Roscoe Cheung" <roscoe underscore cheung at yahoo dot com>, <m0n0wall at lists dot m0n0 dot ch>
 Subject:  RE: [m0n0wall] Building bootable ISO image
 Date:  Thu, 9 Oct 2003 01:54:55 -0700
Let's see if I can get you rolling on this one.. Since I don't know your
experience level, and for the sake of others who may want to do this, I will
try to explain it from the beginning.. This is the method I use, your
mileage may vary, and since I make mistakes, and I'm typing this from
memory, it might need some revisions.. But here goes..

First, you need a FreeBSD system to build on, although I suppose you could
use any *nix type, but if you are going to be compiling binaries you will
need a cross compiler, my suggestion would be to install VMWare (
http://www.vmware.com/download/workstation.html ) and install a copy of
FreeBSD 4.8 on a virtual machine. Make sure you install kernel source, and
development tools.

Make a directory that you will be using for the root of your source tree,
perhaps /home/m0n0

Next you will need to download a source tree of some sorts, but since you
will be making an ISO for use in a PC, go ahead and grab the latest CDROM
ISO image from http://m0n0.ch/wall .. Go ahead and put this image anywhere,
best not in the /home/m0n0 directory since that's where we'll be building
the iso from, and no need to have an iso image embedded in an iso image :)

Now we need to mount that iso so we can extract the files.. commands to type
are preceded with a '#'
(from the directory that the iso is located)

# vnconfig -s labels -c vn0 ./cdrom-pb17r515.iso
# mount -t cd9660 /dev/vn0 /mnt

make sure the image mounted, you should see 2 files (kernel.gz & mfsroot.gz)
and 1 directory (boot), not including . & ..

# ls -la /mnt
# cd /home/m0n0
# cp -r /mnt/ .

now the contents of the CD should be in your /home/m0n0, lets unmount, and
clean up

# umount /mnt
# vnconfig -u vn0

Now we are ready to start messing with the mfsroot file system.

# gunzip mfsroot.gz
# vnconfig -s labels -c vn0 mfsroot
# mount /dev/vn0 /mnt
# cd /mnt

ok.. now we are making progress.. the entire m0n0wall configuration is in
the /mnt directory, you can play, mess, look, learn, etc.. when you are
finished with your changes you will..

# cd /home/m0n0
# umount /mnt
# vnconfig -u vn0
# gzip mfsroot

ok, we are ready to make the iso..

# cd /home
# mkisofs -l -r -L -o cdimage.iso -b boot/cdboot -no-emul-boot m0n0

you will probably see this "Warning: creating filesystem that does not
conform to ISO-9660." warning, I ignore that, it seems to work fine for me..

Send this iso to your PC running VMWare, I use lsz (zmodem), simple..

Now the fun part.. If you installed VMWare you can run this ISO image
without even having to burn it to a CD!! Just create a new virtual machine,
choose custom config, freebsd, give it a name, select the default memory,
use bridged networking, create a new virtual disk which can be very small
since we wont actually use it.. Now, click "Edit this virtual machine" and
click on "CD-ROM".. On the right check the "Connect at power on", then check
"Use ISO Image" and browse to find your cdimage.iso that you created. Now
you have 2 options for your floppy, you can use a floppy disk to store the
config.xml file, or you can make a floppy.flp image there in VMWare, and
just use that instead.. When you first boot the VMWare session you should
hit "F2", go to boot, and move the CDROM drive to the top, or it will try to
boot from your floppy, and complain! You should now be able to start that
newly created virtual machine, and it will boot into m0n0wall!!

I think I have hit everything, give it a try and let me know how you make

Please let me know how you make out on this!!

Best Regards,
Rob Whyte

note: My first go at this I used the "m0n0wall Hackers Guide"
http://m0n0.ch/wall/hack/ which you should definitely look over!!

-----Original Message-----
From: Roscoe Cheung [mailto:roscoe underscore cheung at yahoo dot com]
Sent: Wednesday, October 08, 2003 9:22 PM
To: m0n0wall at lists dot m0n0 dot ch
Subject: [m0n0wall] Building bootable ISO image

Can anyone point me to some instructions for rebuilding ISO image for
standard PC?