Making an OpenBSD bootable RAMDISK_CD
by Brian on Oct.14, 2005, under OpenBSD
This is a work in progress, do not follow these directions without having the capability of continuing on your own.
Steps:
- You need a working openbsd machine on which to compile and build ISO images.
- Make a directory in which to keep the cd’s contents, such as /home/livecd or
similar. If you can make this a separate partition, so you can boot it for testing, all the better. - Untar base37.tgz and etc37.tgz in this directory.
- Make sure the kernel sources (/usr/src/sys) are installed on the machine.
- cd into /usr/src/sys/arch/i386/conf and copy the kernel config file GENERIC to CDBOOT or similar.
- edit the file CDBOOT. Replace the include of ../../conf/GENERIC with the contents of that file.
- make the following changes to CDBOOT:
- add the options RAMDISK_HOOKS and MINIROOTSIZE=3560 to support ramdisks
- comment out the line config bsd swap generic, as there will be no disk to swap to
- add the line config bsd root on cd0c to allow for / on the cd
- run the command “config CDBOOT”
- cd into ../compile/CDBOOT and run make depend and then make
- copy this kernel into /home/livecd
- edit the file /usr/src/distrib/i386/common/Makefile.inc, replacing the lines
strip ${.OBJDIR}/boot strip -R .comment ${.OBJDIR}/boot
with the line
strip --strip-all -R .comment -K cngetc bsd.strip
- cd into /usr/src/distrib/i386/floppies
- create the directory CDBOOT as a copy of ramdisk_cd
- edit the makefile in CDBOOT, changing the line RAMDISK=RAMDISK_CD to RAMDISK=CDBOOT
- do a make in /usr/src/distrib/crunch and then /usr/src/distrib, to setup some prerequisites, then do a make in /usr/src/distrib/i386/CDBOOT. copy cdrom35.fs to /home/livecd/boot.img, this is the image you need to make the cd properly bootable.
- change /etcs to make booting work right
- Edit the CD version of /etc/rc to mount the floppy on /etc, then run
/etc/rc off the floppy or run the installer if it doesn’t exist. - edit the floppy version of /etc/rc to mount the appropriate filesystems.
- edit the CD version of /etc/fstab to include the cd and the floppy
- edit the floppy version of /etc/fstab to include the cd and floppy, and
all ramdisk filesystems
- Edit the CD version of /etc/rc to mount the floppy on /etc, then run
- Create an etc floppy, or include the installer script and related files.
- Create the ISO image using the command: mkisofs -b cdrom37.fs -c boot.catalog -R -v -o OBSDCD.iso /home/livecd
Advertisement