Author Topic: Openbsd On Whole Disk Sl-c3000  (Read 26802 times)

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Openbsd On Whole Disk Sl-c3000
« on: January 18, 2006, 06:52:52 am »
Hi,

I have done as promised and created an initrd.bin that folks can use for whole disk installs of OpenBSD.

OK, the details of the project... there is a lengthy readme.txt file included and you MUST read it but the most important highlight is DON'T use this if you don't want your WHOLE Z to be BSD only. Also DON'T use it if you are paniccy about your ability to restore your Z (including repartitioning the hard drive back).

Here is the readme.txt file from the archive... I have blanked out an important region so that people don't skip reading it when they download the installation.

The actual link to the archive is http://zaurus.daemons.gr/openbsd

Installing OpenBSD on the WHOLE disk of an SL-C3000

This is ONLY for whole disk OpenBSD installs... if you aren't prepared to lose the entire contents of your Zaurus including the ability to boot into Qtopia/pdaXrom or whatever you have installed then do NOT proceed.

Furthermore, it is possible to recover the Zaurus into the original state but it isn't trivial. I include a good working copy of fdisk for the Zaurus (without the bugs that show false paritition entries) that may be used to repartition your disks before installing a default distribution and for your reference the original partition table of an SL-C3000 looks like this...

Device Boot    Start    End    Blocks    Id System
/dev/hda1    1    204    102784+ 83 Linux
/dev/hda2    205    1020    411264    83 Linux
/dev/hda3    1021    7936    3485664   c  FAT32

Complete instructions for recovery of the Zaurus to original state may be obtained from the www.oesf.org forums, please familiarise yourself with these and be confident that you can follow these instructions before you proceed.

If you have read all this so far then the files within this archive should be renamed as follows before proceeding. <BLANKED OUT, READ THE README FROM THE DISTRIBUTION ARCHIVE>

Note for Step 3 you will need to have copies of the zbsdmod.o and bsd.rd from the OpenBSD distribution that you wish to use. The versions installed on the initrd.bin are from the 16 January 2006 snapshot.

*Step 1, complete the flash installation process*

This will put a Linux kernel onto the SL-C3000 that is patched to allow us to see the boot process.

It will also replace the flash based root filesystem with one that initialises the Microdrive and then starts the OpenBSD boot sequence using the module zbsdmod.o and the boot program zboot from the /bsd directory on flash.

If the boot sequence fails for any reason you will be given a busybox shell that you may use to correct script based errors.

Note that this small version of Linux is not running an SD Manager and only runs cardmgr -o (run and terminate) to initialise the Microdrive so if you wish to copy files to the flash partition you may wish to consider using the Emergency boot Linux as described in the next steps.

*Step 2, Entering the Emergency boot Linux (required to install)*

i. Remove power and battery from the SL-C3000.
ii. Leaving the Battery Cover OFF, return the battery cover lock to the LOCKED position.

At this point examine the battery compartment. On the edge that is closest to Zaurus Logo are a set of slots where the battery cover 'keys into' when closed.

If you look at the slot that sits almost exactly vertically central of the whole Zaurus (not the compartment) you will notice that there is a reset button. Do NOT press it just yet.

iii. Open the unit so the screen is at right angles to the base unit and sit the unit on the back of the screen so that the keyboard is accessible with one hand and the base of the unit is accessible with the other.

iv. Hold down D+B on the keyboard and whilst these keys are held depress the reset button using the stylus.

v. Release the D+B keys and within a few seconds the unit should start to boot into Emergency Linux.

If this sequence fails then double check that the Batter Lock is in the LOCKED position.

vi. Connect power now if you haven't already done so!

*Step 3, Installing OpenBSD from the Emergency boot Linux.*

i. Log into Emergency Linux using the username root (no password)

ii. Place zbsdmod.o and bsd.rd onto a storage card (from the OpenBSD distribution).

Emergency Linux is running an SD Manager/Card Manager and automounter for storage cards so you need only insert the card for it to become accessible.

iii. Insert the storage card and change to directory /mnt/card for SD or /mnt/cf for a CF card using the cd command. i.e.

cd /mnt/card

iv. Load the kernel module to allow OpenBSD to boot using..

insmod zbsdmod.o

v. Start the installation process by copying bsd.rd to the zboot proc entry.

cp bsd.rd /proc/zboot

Installation should now start and you should proceed as per the OpenBSD instructions, however, you may now say YES to using the whole disk for OpenBSD.

Don't forget to resize wd0a and create yourself a small swap partition though (I use 128Mb and consider that generous for the Z - you really don't want to use a Zaurus running OpenBSD if it is swapping anywhere near that much)

*Maintenance Step, On subsequent OpenBSD releases updating the initrd.bin*

When a new OpenBSD version is released for the Zaurus (or a snapshot) if you decide to install that release it is probably wise to update zbsdmod.o and zboot located in the flash of the Zaurus.

To achieve this update perform the following steps.

i. Copy zbsdmod.o and zboot to a storage card.

ii. Enter Emergency Linux as described earlier in this document.

iii. Enter the following commands..

mkdir /mnt/flashroot
mount -t jffs2 /dev/mtdblock2 /mnt/flashroot
cd /mnt/flashroot/bsd

iv. Insert the storage card and copy the new versions of zboot and zbsdmod.o to this location as follows (if using a CF card then substitute the path /mnt/cf for /mnt/card).

cp /mnt/card/zbsdmod.o .
cp /mnt/card/zboot .

v. Flag zboot as executable using..

chmod +x zboot

vi. Reboot the device using...

shutdown -r now

ACKNOWLEDGEMENTS

This is a trivial work and simply borrows a kernel and an initrd from other
projects.

The initrd is a simple modification of the one developed for OpenZaurus 3.5.3
and originally was used to implement pivot_root. I have used this image
because it is simple, provides card initialisation for the Microdrive and is
kernel independent.

The Kernel is built from the PDAXROM Kernel sources and includes a patch to
ide-cs necessary to be compatible with the pcmcia config contained within the
initrd.bin. Note that use of an alternate kernel is possible, however, it
needs to have the ide-cs patch applied to it.

Also note that the Kernel and Initrd functionality do not carry any
functionality into the OpenBSD environment once booted so there will be
limited necessity to modify these once installed.

The only possible exception of this is when a new version of zboot or
zbsdmod.o is created by the OpenBSD project. The process for updating these
modules on flash is described within this document.

Final acknowledgements go to the OpenBSD team for this porting effort and
particularly Dale Rahn and Uwe Stuhler.
« Last Edit: January 30, 2006, 01:34:54 pm by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

Sequethin

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Openbsd On Whole Disk Sl-c3000
« Reply #1 on: January 18, 2006, 07:29:07 pm »
I have space & bandwidth on a server that is up most of the time (it's a cheap user mode linux thing I keep around for stuff like this). If you can get it to my gmail (sequethin at gmail) then I'll upload it and post a link.

 

ps I love it when this board is active!
« Last Edit: January 18, 2006, 07:29:36 pm by Sequethin »

anonuk

  • Full Member
  • ***
  • Posts: 176
    • View Profile
    • http://
Openbsd On Whole Disk Sl-c3000
« Reply #2 on: January 18, 2006, 09:12:21 pm »
can this be used on a 3100?, i am itching to try bsd on the zaurus and just got a new one.

Also, i can mirror this if you like, mail me realitygaps  at    yahoo.com
* C3100 with Cacko 1.23 and debian (pocketworkstation) - 1Gb SD / 1Gb CF / Prism Wifi
* C-860 with Cacko 1.21b/pdaXrom dualboot with 256Mb CF / 512 Mb SD / Prism Wifi
* SL-5500 with Cacko rom with 128Mb SD home on SD / 96 Mb CF

DaemonsGR

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Openbsd On Whole Disk Sl-c3000
« Reply #3 on: January 19, 2006, 03:58:29 am »
I have ALOT of space on the company from Daemons.gr  (hostingzoom.com)
You can have as much as you want!
PM me for user/pass

PS: If anyone need site/ftp etc.. read http://black.daemons.gr/
Tasos Varoudis (Tech)
Tasos Varoudis (Architecture)

Zaurus sl-c3100 + Wlan, Lan ,BT ,etc
NOW running... pdaXrom 1.1.0beta3 + OOo + custom apps/setup + debian +.. not yet installed OpenBSD snapshot

WAS:Cacko 1.23 + X/QT + debian

Home-Net
Debian WIFI Router ,OpenBSD Bridge Firewall ,Win 2k Domain Server , :) Sun Fire v120 , :) Gentoo Main Server: Dual PIII

DaemonsGR

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Openbsd On Whole Disk Sl-c3000
« Reply #4 on: January 19, 2006, 04:11:22 am »
BTW as Im an OpenBSD since 2.8 I was thinking of making a siteXX.tgz just for Z installations when my Z is here!
Tasos Varoudis (Tech)
Tasos Varoudis (Architecture)

Zaurus sl-c3100 + Wlan, Lan ,BT ,etc
NOW running... pdaXrom 1.1.0beta3 + OOo + custom apps/setup + debian +.. not yet installed OpenBSD snapshot

WAS:Cacko 1.23 + X/QT + debian

Home-Net
Debian WIFI Router ,OpenBSD Bridge Firewall ,Win 2k Domain Server , :) Sun Fire v120 , :) Gentoo Main Server: Dual PIII

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Openbsd On Whole Disk Sl-c3000
« Reply #5 on: January 19, 2006, 03:22:59 pm »
Quote
BTW as Im an OpenBSD since 2.8 I was thinking of making a siteXX.tgz just for Z installations when my Z is here!
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

OK, many thanks to DaemonsGR, we have a little space to hold the flash image and Linux kernel that will allow boot into a full 4Gb of OpenBSD

[a href=\"http://zaurus.daemons.gr/openbsd]http://zaurus.daemons.gr/openbsd[/url]

Have fun folks
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

DaemonsGR

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Openbsd On Whole Disk Sl-c3000
« Reply #6 on: January 19, 2006, 04:35:37 pm »
No prob  

BTW you dont have "little" space  your have as mach as you like .. hehe

EDIT: also add your openbsd/z Howto and docs!
« Last Edit: January 19, 2006, 04:36:45 pm by DaemonsGR »
Tasos Varoudis (Tech)
Tasos Varoudis (Architecture)

Zaurus sl-c3100 + Wlan, Lan ,BT ,etc
NOW running... pdaXrom 1.1.0beta3 + OOo + custom apps/setup + debian +.. not yet installed OpenBSD snapshot

WAS:Cacko 1.23 + X/QT + debian

Home-Net
Debian WIFI Router ,OpenBSD Bridge Firewall ,Win 2k Domain Server , :) Sun Fire v120 , :) Gentoo Main Server: Dual PIII

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Openbsd On Whole Disk Sl-c3000
« Reply #7 on: January 20, 2006, 09:01:04 am »
Anyone brave enough to try this yet?
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

darkloran

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • http://freeloran.free.fr/zaurus.html
Openbsd On Whole Disk Sl-c3000
« Reply #8 on: January 30, 2006, 01:10:24 pm »
Quote
Anyone brave enough to try this yet?
i'm volunteer !

i've tested OpenBSD a few months ago and was quite happy with it but i lacked the "kdepim" suite. Now that i've bought a used sl-5500 i can play along with my sl-c3000! and i must admit that i find the openbsd solution the most interesting for me.

I've followed the readme.txt provided with obsd....zip, step by step (i've read it once before going through it). Here is what i've noticed :

Quote
readthereadme.4=zimage.bin.
>> i've named it zImage.bin (with uppercase 'i', don't know if it makes a difference for the system)

Quote
iv. Hold down D+B on the keyboard and whilst these keys are held depress the reset button using the stylus.
>> vi. must be made before iv. Z won't boot without current (tested twice).

>> wait 3 seconds before v.
Quote
v. Release the D+B keys and within a few seconds the unit should start to boot into Emergency Linux.

Quote
iii. Insert the storage card and change to directory /mnt/card for SD or /mnt/cf for a CF card using the cd command. i.e.
>> it does not work with CF card. (tested with Sandisk 32MB fat16 and Sandisk UII 1GB ext3 -- even if card inserted before boot)
sd card is ok (inserted before or after boot does not matter -- it's correctly automounted).

Quote
v. Start the installation process by copying bsd.rd to the zboot proc entry.

cp bsd.rd /proc/bsd.rd
>> unable to open `/proc/bsd.rd': No such file or directory
>> work with cp bsd.rd /proc/zboot (the comment was explicit enough)

maybe you should tell the user to put the battery, cover and locker back in place?!   (just for completeness uh)

well after that it's up to OpenBSD instructions... creating filesystems is quite strange with this procedure because wd0a is pre-configured as full system without block-size and it won't work. The best is to delete 'a', create 'a' with 4.2BSD fs and / mount point and then create swap and apply.

my installation of obsd sets is in progress.

regards

loran
SL-C3000 -- Cacko1.23b1
CE-RH2 remote / Belkin usblan / Asus WL-110 / Sandisk SD UII 256MB / Sandisk CF UII 1GB
STOREX OTG Club 40GB / Belkin IR Keyboard / Logitech mouse

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Openbsd On Whole Disk Sl-c3000
« Reply #9 on: January 30, 2006, 01:35:29 pm »
Thanks Loran, I will update the readme file soon, have fun there

Btw, if you are just starting out on this with the 3.9 Beta then you should also follow the instructions for updating zbsdmod and zboot since the ones present in the initrd.bin are from a previous snapshot.

(actually zimage.bin isn't case sensitive in this instance... the updater looks for zimage.bin, zImage.bin or ZIMAGE.BIN )
« Last Edit: January 30, 2006, 01:38:38 pm by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

darkloran

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • http://freeloran.free.fr/zaurus.html
Openbsd On Whole Disk Sl-c3000
« Reply #10 on: January 30, 2006, 02:26:33 pm »
Quote
Btw, if you are just starting out on this with the 3.9 Beta then you should also follow the instructions for updating zbsdmod and zboot since the ones present in the initrd.bin are from a previous snapshot.
ok, i've applied the "update instructions" and it worked fine. Well as far as i can tell, because i don't know anyway to check the zboot or zbsdmod.o  

system is booting right away...

well startx does not work... d'oh
EDIT : machdep.allowaperture was set to '0'. Well it needs to be set to '2' so that X will start on obsd. It should have been set by installation process as i've said i wanted to use X11 and i was then provided with calibrating interface. update /etc/sysctl.conf with machdep.allowaperture=2 and rebooting did the trick.

Oh and i had time to follow the startup process and i saw zboot is up to date  
« Last Edit: January 30, 2006, 02:42:17 pm by darkloran »
SL-C3000 -- Cacko1.23b1
CE-RH2 remote / Belkin usblan / Asus WL-110 / Sandisk SD UII 256MB / Sandisk CF UII 1GB
STOREX OTG Club 40GB / Belkin IR Keyboard / Logitech mouse

Sequethin

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Openbsd On Whole Disk Sl-c3000
« Reply #11 on: March 22, 2006, 01:56:58 pm »
is what I read above true? this doesn't work with cf? I don't have a large enough sd card =/ grrr

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Openbsd On Whole Disk Sl-c3000
« Reply #12 on: March 24, 2006, 08:33:26 am »
Quote
is what I read above true? this doesn't work with cf? I don't have a large enough sd card =/ grrr
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119811\"][{POST_SNAPBACK}][/a][/div]

No, you can use cf card to do this but you will need to mount it manually to use it.

lol, it's so long since I booted my 3000 into Linux I can't tell you the hda name of the CF card to give you the exact mount command and the 3000 is busy doing some rebuilds after I did a /usr/ports/infrastructure/build/out-of-date run on it recently

-Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

Sequethin

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Openbsd On Whole Disk Sl-c3000
« Reply #13 on: March 29, 2006, 10:38:51 am »
Quote
Quote
is what I read above true? this doesn't work with cf? I don't have a large enough sd card =/ grrr
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119811\"][{POST_SNAPBACK}][/a][/div]

No, you can use cf card to do this but you will need to mount it manually to use it.

lol, it's so long since I booted my 3000 into Linux I can't tell you the hda name of the CF card to give you the exact mount command and the 3000 is busy doing some rebuilds after I did a /usr/ports/infrastructure/build/out-of-date run on it recently

-Andy
[div align=\"right\"][a href=\"index.php?act=findpost&pid=120082\"][{POST_SNAPBACK}][/a][/div]


Well I did this over the weekend and it works great so far! I had used the "whole disk" option before this hint and it sucked to get errors every time I booted and had the cf disk in. Thanks again for the great contributions (that reminds me, I need to implement those performance tweaks again )

Also a quick note... saturday (march 25?) snapshot seems stable so far...  am I wrong or is this recent snapshot actually 3.9+ (i.e. it includes code beyond 3.9 stable, so if I put 3.9 stable on my z when my cd's come in I'd actually be going backward...)?

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Openbsd On Whole Disk Sl-c3000
« Reply #14 on: March 29, 2006, 11:05:34 am »
Quote
...

Also a quick note... saturday (march 25?) snapshot seems stable so far...  am I wrong or is this recent snapshot actually 3.9+ (i.e. it includes code beyond 3.9 stable, so if I put 3.9 stable on my z when my cd's come in I'd actually be going backward...)?

That recent snapshot is 3.9-current so yes it contains additional work since 3.9-stable was snapshotted for CD distribution.

Incidentally you don't get all architectures on the CDs... I think Zaurus is one that you have to get from http/ftp but I congratulate you for buying it and sponsoring the project.

-Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card