Subject: CD-ROM image cookbook sanity check
To: None <port-i386@netbsd.org>
From: Larry Colen <lrc@recourse.com>
List: port-i386
Date: 03/13/2001 21:11:01
I can't log onto the machine that has a CDROM burner, so I took the
opportunity to write up the procedure that I'm trying.

The goal is to make a CDROM that I can boot off of which will have the
root filesystem on a ramdisk. I've found a few cookbooks on the
procedure, none of which quite match, none do a good job of explaining
what is going on at each step and many of which use command options
which seem to be out of date.

I'd greatly appreciate anyone that can look over these notes and
comment on them. Let me know of any errors that you see. Please feel
free to add in your own comments giving a better explanation of what
is going on, and what needs to be done.  I'll collect them all and
post the final back to the list.  

Since I started wrestling with this, I've seen a couple other people
mention that they were trying to do the same thing. Let me know if
this helps and any other gotcha's that you've discovered in your efforts.

    Larry

cdromckbook.txt
2030 13 Mar 01

The first thing that needs to be done is to download the sources
(where did I get them again?) and unzip them.

cd /usr/
mv src srcvault			# save old source tree
for i in ~lrc/downloads/*z; do tar -xzvf $i; done #unwrap tarballs

# Now one needs to build the world, this will take a while

make depend		     # I dunno if this is needed
cd /usr/src		     # ready to build the world
make build		     # gotta have the build, this will take
hours

# Now we need a directory tree to make the cd image in
# I have /cdskel pointing to /lrc/cdimage because there is 
# a lot more room on the /lrc filesystem

mkdir /lrc/cdimage
ln -s /lrc/cdimage /cdskel

# copy necessary trees over
cp -pR etc bin sbin /cdskel
cp -pR /usr/bin /usr/sbin /cdskel/usr

# Make a kernel

cd /usr/src/sys/arch/i386/conf
cp INSTALL TG03
emacs TG03 
config TG03
cd ../compile/TG03/
make depend; make
cp netbsd /netbsd.tg03
cp /netbsd.tg03 /cdskel/
cp /netbsd.tg03 /cdskel/netbsd

# do I need fstab pointing to /etc/md0a for / ?

emacs /cdskel/etc/fstab

# note, can't do this multiple times on same boot or get problems with
# vnd0a 
cd /usr/src/distrib/i386/floppies/ramdisk-big/

make KERN=/netbsd.tg03

# Put the image where it can be found
cp ramdisk-big.fs /cdskel/

#for some reason doing this with /lrc/cdimage rather than /cdskel

cd /lrc

# make the iso file system

mkisofs -r -J -v -l -L -G cdimage/ramdisk-big.fs -o tg03.iso cdimage/

					       -r Rockridge
					  -pad pad the end of sectors
                              -o name of file to write to
                       -nobak don't include backup files
	            -L Allow filenames to start with '.'
		 -J generat Joliaet directory records
	      -l allow full 31 character file names
	   -c boot catalog
	-G generic boot image


#I've been having problems with -a and -c boot.catalog

# Now we have something to burn a CDROM out of.




-- 
Larry Colen - Recourse Technologies - lrc@recourse.com - 650-381-8090