dnl $OpenBSD: install,v 1.17 2005/09/10 22:18:06 uwe Exp $ OpenBSDInstallPrelude OpenBSD is installed on the Zaurus by effectively converting Linux into a bootloader. This can be done easily by installing a package from Qtopia, or manually from a terminal. Both ways are described below, the easy one first. The package takes care of modifying the Linux startup files for you as necessary. To protect you from a common pitfall, ext3 filesystems mounted on /hdd[12] are converted back to ext2. (That way a fatal error in Linux startup scripts is avoided when the journal has been destroyed by mounting one of the ext3 filesystems as ext2 on OpenBSD). 1. Press "Home" until the second icon tab is selected (Settings). 2. Open the "Add/Remove Software" dialog. That's the green icon with an arrow pointing from left to right into a rectangle. 3. Press "Install packages via networks", the middle one of the three big buttons. The "Package Manager" dialog pops up. 4. Press the yellow switch icon in the lower right corner to bring up the "Package Servers" dialog. 5. Press the left button, which is labeled "New" if your Zaurus is in English, enter the HTTP/FTP URL of the nearest OpenBSD mirror, and change the field above the URL into a name for that server. Press the "OK" button in the upper right corner to return to the "Package Manager" dialog. 6. Press the "Upgrade" button in the lower left corner to update the package index if that was not done automatically. A package named "openbsd" should appear in the package list. Select this package and press the question mark icon in the lower right corner. 7. Now you see the package details and three buttons, labeled "Install", "Remove", and "Ignore" in this order. Press the leftmost button and twice "OK" to finish the installation. Then close the "Add/Remove Software" dialog. 8. Activate the "Q" menu in the lower left corner of the screen and choose "Reboot" (that's the item with a green icon next to it, above the power-off icon). Wait for the system to reboot. At the boot> prompt, hit enter to boot OpenBSD, or type 'r' to boot Linux. Since you want to install OpenBSD, this time you will want to type 'r'. 9. Wait while Linux is coming up, then switch to the first tab (Applications), scroll down, and press the icon which is labeled "Install OpenBSD". A few seconds later, an OpenBSD bsd.rd will boot on your Zaurus, so that you can perform the standard install process. Another way to install the package is from a shell. You will need the following file from the distribution on the Zaurus: openbsd{:--:}OSrev{:--:}_arm.ipk Perform the following operation as root to install the package, and then continue as in step 8, above: {:-#-:} ipkg install openbsd{:--:}OSrev{:--:}_arm.ipk To install the OpenBSD boot program manually, you will need the following files from the distribution: zbsdmod.o zboot bsd.rd After starting up some sort of terminal emulator on the Zaurus and becoming root, perform the following operation: # insmod zbsdmod.o # cp bsd.rd /proc/zboot A few seconds later, OpenBSD will boot on your Zaurus. If you already have a bsd.rd or bsd kernel contained in a FFS partition on the C3000/C3100 hard drive, you can instead use # insmod zbsdmod.o # ./zboot OpenBSDInstallPart2 OpenBSDBootMsgs You will next be asked for your terminal type. You should just hit return to select the default (vt220). OpenBSDInstallPart3({:- or "wd0" for IDE drives-:}) Next you will have to edit or create a disk label for the disk OpenBSD is being installed on. If there are any existing partitions defined (for any operating system), and a disk label is not found, you will first be given an opportunity to run fdisk and create an OpenBSD partition. If fdisk is being invoked on your behalf, it will start by displaying the current partitions defined and then allow you to modify this information, add new partitions and change which partition to boot from by default. If you make a mistake, you will be allowed to repeat this procedure as necessary to correct this. Note that you should make OpenBSD be the active partition at least until the install has been completed. OpenBSDInstallPart4({:- If you have Linux partitions defined on the disk, these will usually show up as partition 'h', 'i' and so on.-:}) One of the three partitions on the Zaurus C3000/C3100 hard drive is a 3GB MS-DOS filesystem. This partition can be a lot smaller, it is therefore recommended that you cut most of the space off this large MS-DOS partition, and create a new A6 partition afterwards, like this: 0: 83 0 3 13 - 1511 7 17 [ 63: 205569 ] Linux files* 1: 83 1512 0 1 - 7559 7 17 [ 205632: 822528 ] Linux files* 2: 0C 7560 0 1 - 9065 7 1 [ 1028160: 204800 ] Win95 FAT32L 3: A6 9065 7 2 - 67885 5 3 [ 1232960: 7999488 ] OpenBSD After shrinking the MS-DOS partition, please be sure to newfs it using: newfs -t msdos /dev/rwd0k Note that all OpenBSD partitions in the disk label must have an offset that makes it start within the OpenBSD part of the disk, and a size that keeps it inside of that portion of the disk. This is within the bounds of the 'c' partition if the disk is not being shared with other operating systems, and within the OpenBSD fdisk partition if the disk is being shared. For purposes of recovery in case Linux becomes inoperable for one reason or another with HDD1 Errors and such, we detail the process to come up single user: Remove power and the battery. Begin holding down the 'b' and 'd' keys. Wait for 1 minute. Insert battery and power on unit. As soon as a login screen starts to show up, release the 'b' and 'd' keys. Login as root. The following sequence is also recommended inside Linux so that problems will happen less often. By default the boot scripts fail if the MS-DOS partition is corrupt in any way. If you are already root do the following, which will skip mounting the MS-DOS partition. Login as root. Find the rc.rofilesys file. It is either in /root/etc/rc.d cd /root/home/etc/rc.d Or you have to mount it using: mount /dev/mtdblock2 /mnt cd /mnt/home/etc/rc.d cat rc.rofilesys | sed -e '/vfat/s/^/#/' > vfat diff -u rc.rofilesys vfat # to double check cp rc.rofilesys rc.rofilesys.vfat cp vfat rc.rofilesys In these cases below we avoid using vi because Linux quality is of such high caliber that vi locks up the console. If you logged in multiuser you may be able to use vi. Please be aware that if you fsck the two Linux partitions on the disk, they are actually ext3fs partitions and you will thereby corrupt their journals. This will make them into ext2fs partitions. Linux will not be able to boot, and you will need to use the processes below to get to the point where Linux will mount them as ext2fs partitions: Login as root. Find the rc.rofilesys file. It is either in /root/etc/rc.d cd /root/home/etc/rc.d Or you have to mount it using: mount /dev/mtdblock2 /mnt cd /mnt/home/etc/rc.d cat rc.rofilesys | sed -e '/^LINUXFMT=ext3$/s/^/#/' \ -e '/^#LINUXFMT=ext2$/s/^#//' > ext2 diff -u rc.rofilesys ext2 # to double check cp rc.rofilesys rc.rofilesys.ext3 cp ext2 rc.rofilesys If you have created an 'A6' OpenBSD partition earlier using fdisk, you will be able to use disklabel to cut that partition into at least a root filesystem and swap partition. OpenBSDInstallPart5(wd0) OpenBSDInstallNet({:-CD-ROM, -:},nofloppy) OpenBSDFTPInstall OpenBSDHTTPInstall OpenBSDTAPEInstall OpenBSDCDROMInstall OpenBSDDISKInstall({:-"wdN" or -:},,{:-, Linux (ext2) or MS-DOS-:}) OpenBSDCommonFS OpenBSDCommonURL OpenBSDCongratulations