README 3.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
*** To duplicate the CD:

	dd if=/dev/acd0c of=file.iso bs=2048


*** To mount the ISO file:

	vnconfig -e vn0c file.iso
	mount -t cd9660 /dev/vn0c /mnt


*** Copy the CDROM:

Note that this is read only. Use hier to make a complete copy of the
filesystem. You could also just mount the cd normally and copy it off.

	su1 hier cp /mnt /FOO

I then removed CVS-REPO and commerce from the root directory of the
copy, which frees up about 350 MB!


*** Modify the copy of the CD image so that it can go multiuser:

Copy in fstab, rc.conf, and rc.cdroot from this directory to /etc of your
new directory tree. Edit the rc.conf to make sure the DHCP interfaces are
correct.

You also want to give it a root password. You can do that by using the -d
option to vipw:

	vipw -d /FOO/etc

Create the ssh host keys in /FOO/etc/ssh:

	/usr/bin/ssh-keygen -N "" -f /FOO/etc/ssh/ssh_host_key
	/usr/bin/ssh-keygen -d -N "" -f /FOO/etc/ssh/ssh_host_dsa_key

Edit /FOO/etc/ssh/sshd_config to allow root login:

	PermitRootLogin yes

Edit /FOO/etc/ttys and turn on the serial console if you want to use
the serial console. 

	console "/usr/libexec/getty std.115200" unknown on secure

Create /FOO/usr/site/bin and stash useful (required) stuff in it:

	-rwxr-xr-x  1 root  wheel  205084 Jun 26 06:15 hier*
	-rwxrwxr-x  1 root  wheel   90952 Jun 26 12:25 imageunzip*
	-rwxrwxr-x  1 root  wheel  129174 Jun 26 10:49 imagezip*
	-r-xr-xr-x  1 root  wheel  124532 Jun 26 10:48 wget*

Create /FOO/usr/local/lib and copy in libintl.so.2, which is needed
by wget, unless you go and reconfig it to statically link.

	
*** Create a bootable CD that does not run from the mini fs.

So, the problem with bootable CDs is that they really boot from a
floopy image on the CD. The mfsroot that the fixit disk runs from is
inside the floopy image. Obviously, thats too small to be very useful,
and you cannot run from the CD since its read-only, and we really want
to go multiuser so that we can use all the good tools including ssh!
We are going to make a minor change to floopy image so that it does not
load the mini mfsroot, and so that it boots directly from the CDROM.
This is okay; it will initially boot up with / read-only.

First off, you need to mount the floopy image from the CD.

	cd /FOO/floppies
	vnconfig vn0 boot.flp 
	mount /dev/vn0 /mnt/floopy

Edit /mnt/floopy/boot/loader.rc:

	load /kernel
	set vfs.root.mountfrom="cd9660:acd0a"
	autoboot 10

Compress and copy kernel.GENERIC from the CDROM to the boot floopy image.

	cat /FOO/kernel.GENERIC | gzip -9 > /mnt/floopy/kernel.gz

This is necessary cause something about the original kernel on the boot
floopy does not work correctly when putting /dev on an mfs. Also, it does
not drop into that userconfig interface on boot.

Then unmount/close the boot floopy.

	umount /mnt/floopy
	vnconfig -u vn0


*** To create a new ISO file once you have modified the tree:

Leigh Stoller's avatar
Leigh Stoller committed
98
       sudo mkisofs -U -R -b floppies/boot.flp -c floppies/boot.catalog \
99 100 101 102 103 104 105 106 107 108 109 110
		-o /path/bootable.iso /FOO


*** To burn the CD I used used the windows box. The plextor software
    comes with Easy CD Creator, which lets you create a CD from a
    .iso file. The File menu has "Create CD from file" option, which
    worked really slick. There are BSD programs to do this, but I do
    not know what they are. I have a samba connection, so I browsed the
    .iso file from my unix box. It will warn about reading from across the
    network, but it works just fine cause of the burnproof thing the
    plextor does.

111
    Or on a FreeBSD box:
112

113
	burncd -s 24 -f /dev/acd0c data foo.iso fixate