Pimp My OpenBSD bootfloppy
Created: 10/16/2005
General Information
This short how-to gives you some basic hints on how to customize the OpenBSD bootfloppy, and how to setup an easy accessible shellscript.Requirements
Configuration
Okay, I toyed a bit with the OpenBSD installation process. Luckily it is an open-source OS, and the installation process fits on a single 1.44-floppy, which is kinda cool. Anyhow, the default setup is one with a ramdisk, and the filesystem is somehow linked to the kernel. That makes it a bit hard to customize it, don't you think?Note: Btw: You'll have to do everything as root... Sorry!!
Installation of your basic tools.
You need OpenBSD running on a local machine for this. The default installation comes without the stuff under/usr/src, so just grab it and unpack it:|
# # # |
mkdir /usr/src cd /usr/src ftp -o- ftp://ftp.openbsd.org/pub/OpenBSD/3.7/src.tar.gz | tar xvfz - |
|
# # |
cd /usr/src/distrib/crunch make install |
Let your computer find a shellscript
Remember your last installation of OpenBSD? The computer asked you if you wanted to (I)nstall, (U)pgrade or (S)hell. The file which does that is located under/usr/src/distrib/miniroot and called dot.profile It is the first file to be started after your computer booted. Therefore, as a quick-and-dirty hack, it is not a bad idea to edit it. My idea was to let it mount the bootdevice, copy a file from there, umount the bootdevice, and run it. Of course, I had no clue on how to find the correct boot-device. So I made my hack a bit dirtier...Just find the lines|
# set up some sane defaults echo 'erase ^?, werase ^W, kill ^U, intr ^C, status ^T' stty newcrt werase ^W intr ^C kill ^U erase ^? status ^T |
|
mkdir /mnt2 mount /dev/fd0c /mnt2 ; cp /mnt2/autoexec.ksh / ; umount /mnt2 mount /dev/fd1c /mnt2 ; cp /mnt2/autoexec.ksh / ; umount /mnt2 mount /dev/wd0c /mnt2 ; cp /mnt2/autoexec.ksh / ; umount /mnt2 mount /dev/wd1c /mnt2 ; cp /mnt2/autoexec.ksh / ; umount /mnt2 mount /dev/cd0c /mnt2 ; cp /mnt2/autoexec.ksh / ; umount /mnt2 mount /dev/cd1c /mnt2 ; cp /mnt2/autoexec.ksh / ; umount /mnt2 ksh /autoexec.ksh |
Make your own bootfloppy
Save your/usr/src/distrib/miniroot/dot.profile. And now type in:|
# # # |
cd /usr/src/distrib/i386/ramdiskA make mv floppyXX.fs floppyXX_autoexec.ksh.fs # (XX=37, 38, 39...) |
svnd0, this will hopfully give you a file called floppyXX_autoexec.ksh.fs, where XX is the release-number. In my case it was 37.Setting up your shellscript
Now you have told your computer where to find a shellscript calledautoexec.ksh. All you have to do now is to write it. First of all, mount your new floppy-image|
# # # |
vnconfig svnd0c floppyXX_autoexec.ksh.fs mount /dev/svnd0c /mnt cd /mnt |
autoexec.ksh with your favourite editor, for example echo:|
# # # |
echo "ifconfig ne3 10.0.0.2 netmask 255.255.255.0 up" > autoexec.ksh echo "route -n flush" >> autoexec.ksh echo "route add default 10.0.0.1" >> autoexec.ksh |
|
# # |
umount /mnt vnconfig -u svnd0c |
This guide is © 2005 - 2008 thomas dettbarn.
Author: thomas dettbarn
dettus at dettus dot net