Author Topic: Dualbooting Pdaxii & Openbsd  (Read 12932 times)

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting Pdaxii & Openbsd
« on: August 15, 2007, 08:37:22 am »
After exploring for a while with dinorex, i've succeeded in setting up a dualbooting environment for pdaXii (5.4.8 Sally on NAND) and OpenBSD 4.2 beta (on my internal Extreme III 16GB CF):

Here is how it plays:    
(Sorry for the poor quality of the pics    )

1. First load the pdaXii (5.4.8) kernel. Then answer the question if i want to boot into OpenBSD or pdaX.

 

[img]http://farm2.static.flickr.com/1095/1125555877_79d24f6090.jpg\" border=\"0\" class=\"linked-image\" /]
« Last Edit: August 15, 2007, 08:38:54 am by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

HoloVector

  • Hero Member
  • *****
  • Posts: 533
    • View Profile
    • http://
Dualbooting Pdaxii & Openbsd
« Reply #1 on: August 15, 2007, 10:59:17 am »
Whoa!  So, in theory, I could have pdaXii13 Akita with a full upgrade on my 4GB SD and OpenBSD 4.2 on the MD of my 3200?  Nice Work!

What magic is needed to be done in order to get this working?
I think I'm coming down with what kahm's got!  I now have 3 Zaurii in house!  ;)
Current: Zaurus SL-C3200 -  Bobby (Configuring pdaXii13 Akita with Full 5.4.9 upgrade running IceWM)
Zaurus SL-C1000 - Hachiko (Configuring Cacko 1.23 with evilJazz's new kernel)
Zaurus SL-C860 - Fett (Customized Cacko 1.23 with handmade Boba Fett Theme)
Symbol WiFi CF card|Buffalo WiFi CF Card|Buffalo Ethernet CF Card|Red Piel Frama Case|PDAir Case|Black Pelican 1020 Case|Pentopia Stylii|SaruTek Protectors|Transcend SDs (4GB 150X, 1GB 80X, 256MB 45X, 128MB 45X)|2GB PNY SD|2GB SanDisk SD|Transcend CFs (1GB 80X, 512MB 80X)|Sandisk CFs (4GB, 512MB, 256MB)|256MB Netac USB-CF|RH-1 Remote
Check out the ScummVM@tyrannozaurus page if you are an "adventurer" type of person.

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Dualbooting Pdaxii & Openbsd
« Reply #2 on: August 15, 2007, 07:27:40 pm »
Quote
2. Booting up pdaX. Everything is fine.



Dual-Boot Cacko/OpenBSD
« Last Edit: August 18, 2007, 07:42:58 pm by mathemajikian »

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting Pdaxii & Openbsd
« Reply #3 on: August 15, 2007, 08:58:30 pm »
Actually I don't make much use of the cacko/openbsd dualboot script, except the small segment about choosing booting with obsd.    But thanks, mathemajikian! Without your script i will still be getting nowhere.  
It's just a small tweak of /etc/rc.d/rc.rofilesys in pdaXii.
But for now I cannot extract the file as my 3200 is now compiling packages for OpenBSD 4.2 Beta at full tilt.
Could someone attach the original file in pdaXii so that I can post my how-to and the modified script? Thanks! [edit: got a backup; see the very next post below...]
(btw in the pictures i forgot to change the word "Cacko" in the boot script...   )
« Last Edit: August 15, 2007, 11:53:31 pm by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting Pdaxii & Openbsd
« Reply #4 on: August 15, 2007, 10:00:21 pm »
[UPDATED]

[span style=\'font-size:12pt;line-height:100%\']Dualbooting pdaXii & OpenBSD: a mini how-to (for C3100/3200 only; do it at your own risk)[/span]

*******************************************************************************
To set up a dualboot environment of pdaXii and OpenBSD, you have to do three things:

1. Flash pdaXii (in the usual flash "OK mode") & OpenBSD (in the emergency "D+B mode")
2. Modify /etc/rc.d/rc.rofilesys in pdaXii
3. Create a directory to hold the OpenBSD bootloader and kernel.


*******************************************************************************

1. (I suppose you know how to do this. If not, you'd better stop here for your safety.)

2. Modify /etc/rc.d/rc.rofilesys in pdaXii
This is how I change the /etc/rc.d/rc.rofilesys in pdaXii (5.4.8)
(This also seems to work for other pre-Beta4 builds which uses the older bootloader, including Beta1 and Beta3, but YMMV):

Quote
#!/bin/sh

export PATH=$PATH:/usr/bin:/bin:/sbin

get_dev_pcmcia()
{
while read SOCKET CLASS DRIVER INSTANCE DEVS MAJOR MINOR;
do
    echo $DEVS
done
}
get_dev_pcmcia_slot()
{
    grep "^$1" /var/lib/pcmcia/stab | get_dev_pcmcia
}

RW_MTD_LINE=`cat /proc/mtd | grep "home" | tail -n 1`
if [ "$RW_MTD_LINE" = "" ]; then
    RW_MTD_LINE=`cat /proc/mtd | grep "\<NAND\>.*\<2\>" | tail -n 1`
fi
if [ "$RW_MTD_LINE" = "" ]; then
    RW_MTD=""
    RW_MTDBLK=""
    RW_MTD_SIZE=0
else
    RW_MTD_NO=`echo $RW_MTD_LINE | cut -d: -f1 | cut -dd -f2`
    RW_MTD_SIZE_HEX=`echo $RW_MTD_LINE | cut -d" " -f2`

    if [ -x /sbin/devfsd ]; then
        RW_MTD=/dev/mtd/$RW_MTD_NO
        RW_MTDBLK=/dev/mtdblock/$RW_MTD_NO
    else
        RW_MTD=/dev/mtd$RW_MTD_NO
        RW_MTDBLK=/dev/mtdblock$RW_MTD_NO
    fi

    RW_MTD_SIZE=`dc 0x$RW_MTD_SIZE_HEX 1024 / p`
    initlog -s $"found $RW_MTD ${RW_MTD_SIZE}\"Kbyte\""
fi

if [ "$ZAURUS_RESET" = "HARD" ]; then

if [ ! -x /sbin/devfsd ]; then
    mount -t tmpfs -o size=12m none /dev
    cd /
    tar xf /root/.dev_default.tar 2> /dev/null > /dev/null
    mkdir /dev/shm
else
    mount -t tmpfs -o size=12m none /dev/shm
fi

STRING=$"Starting filesystem: "
msg -n $STRING

mount -o remount / 2> /dev/null > /dev/null

if [ $RW_MTD_SIZE -ne 0 ]; then
    /sbin/eraseall --j --q $RW_MTD 2> /dev/null > /dev/null
    mount -t jffs2 -o rw,noatime $RW_MTDBLK /home 2> /dev/null > /dev/null
    mkdir /home/root
    cd /
    tar --no-same-owner -xf /root/.home_default.tar 2> /dev/null > /dev/null
fi

#OpenBSD Boot
if [ /bsd ]; then
        echo "Would you like to boot OpenBSD or pdaXrom (openbsd/pdaxrom)?"
        read acceptance
        if [ "$acceptance" != "pdaxrom" ]; then
                echo "Booting OpenBSD"
                cardmgr -o >/dev/null 2>&1    #<-- This line is necessary, or the bootloader won't be able to find /bsd on the internal CF/MD.#
                cd /bsd
                /sbin/insmod /bsd/zbsdmod.o
                ./zboot
        fi
        echo "Booting pdaXrom"
fi

mkdir /dev/shm/tmp
mkdir /dev/shm/run
chmod 4777 /var/tmp
chmod 777 /tmp
touch /var/run/utmp
cd /
tar --no-same-owner -xf /root/.var_default.tar 2> /dev/null > /dev/null
touch /var/log/lastlog

rc=$?
if [ "$rc" = "0" ]; then
    success "$STRING"
else
    failure "$STRING"
fi
msg

else
### SW Reset !
......
......

Probably this is just a quick and dirty trick. I suppose there is a better way of doing that.
Anyway here is the full script.
[span style=\'font-size:12pt;line-height:100%\']USE IT AT YOUR OWN RISK!  DON'T BLAME ME IF IT BRICKS YOUR BUDDY Z. [/span]

Two small notes:
-- In case OpenBSD fails to load for some reason, in the bootloader prompt (i.e., boot>), simply type reboot and the system will boot into pdaX.
-- You don't actually have to type "openbsd" to answer the boot question. Just a [ENTER] will do.


3. Create a directory to hold the OpenBSD bootloader and kernel.
-- Create a new directory under pdaXii:
Code: [Select]
  mkdir /bsd-- Copy zboot and zbsdmod.o into this directory:
Code: [Select]
   cd /WHEREEVER/YOUR/OBSD/FILES/ARE
    cp zboot zbsdmod.o /bsd


Reboot. And then you'll see your glutton dog enjoy both penguin and puffyfish meat  ...  
« Last Edit: August 15, 2007, 11:24:05 pm by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting Pdaxii & Openbsd
« Reply #5 on: August 15, 2007, 10:22:16 pm »
Right, i forgot to mention that pdaXrom seems to lack the kernel module for FFS filesystem support, so for now pdaX won't be able to "see" the FFS partitions where OpenBSD lives.
Can someone provide this small piece, please?  

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Dualbooting Pdaxii & Openbsd
« Reply #6 on: August 15, 2007, 10:44:16 pm »
I can probably do it for r198, but that's not what you want, is it? Does this even work on r198?
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting Pdaxii & Openbsd
« Reply #7 on: August 15, 2007, 10:48:45 pm »
I guess, technically speaking, dualbooting is also possible for the post-Beta4 builds, provided that there is a fully functional uboot which can easily let user choose which distro to boot.

I'm afraid the kernel module for r198 won't work for pdaXii/Beta1/Beta3.

It's beyond my intelligence to make one. Any help out there?  
« Last Edit: August 15, 2007, 10:49:46 pm by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting Pdaxii & Openbsd
« Reply #8 on: August 21, 2007, 07:23:15 am »
So has anyone tried this solution so far?  

I am also thinking of experimenting with tribooting:
cacko ==> NAND
openbsd ==> internal MD/CF
pdaXii ==> SD

But now the key is: is it possible to run pdaXii full off SD?
I will go about working out a trick if it's possible.

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

climber

  • Full Member
  • ***
  • Posts: 189
    • View Profile
Dualbooting Pdaxii & Openbsd
« Reply #9 on: August 21, 2007, 07:40:14 am »
At the moment I have no time but I will try it later!

You mentioned that you have build in a 16GB CF card in you Zaurus instead of the Microdrive. That's very interesting but I'm not so familiar with the hardware of my zaurus.

Did you made pictures of the different steps of putting the microdrive out of the zaurus and putting the CF in. This would be greate and maybe more zaurus users would give them a chance. I too :-)
I saw your pictures on your side and they are really good but for doing this it should be more steps between.


I'm not sure whether I saw a configurations document of the different steps you did to get the CF work!?

Regards
Climber
« Last Edit: August 21, 2007, 07:42:34 am by climber »

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting Pdaxii & Openbsd
« Reply #10 on: August 21, 2007, 07:52:27 am »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

climber

  • Full Member
  • ***
  • Posts: 189
    • View Profile
Dualbooting Pdaxii & Openbsd
« Reply #11 on: August 21, 2007, 08:30:32 am »
Yeah, this is what I wished to see :-)

Do you have also a document how to get the CF work inside the zaurus. I would guess that I do my partitions and formatting inside the flash modus of the different roms (for example pdaXii13 or pdaXrom)!?

Regards
climber

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting Pdaxii & Openbsd
« Reply #12 on: August 21, 2007, 08:41:18 am »
I don't quite get what you meant by "how to get the CF work in side the zaurus".
If you are talking about formatting and partitioning, it's all done by the OpenBSD installation process (i.e. the very first few steps).
pdaXii Sally lives entirely in NAND, and won't touch the internal MD/CF at all during installation.  

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

climber

  • Full Member
  • ***
  • Posts: 189
    • View Profile
Dualbooting Pdaxii & Openbsd
« Reply #13 on: August 21, 2007, 09:03:37 am »
Yes, I'm talking about the formatting and partitioning! Sorry for the bad statement.

Ok, that looks fine! If the hardware exchange is successful the other steps should be easy going.

Could you find out anything negative since you have the CF inside the zaurus? Do any scripts which the zaurus needs for booting or configurations complain about that the microdrive is gone?

climber

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting Pdaxii & Openbsd
« Reply #14 on: August 21, 2007, 09:09:40 am »
No, the CF runs very well.  I think one very nice feature of OpenBSD is that it consistently does filesystem checking after rebooting as a result of hanging/freezing (which does not happen often), which may help protecting the card itself.

And of course speedwise and powerwise, the CF beats the original MD hands down.

There is a recent thread discussing wearing of cards: https://www.oesf.org/forums/index.php?showtopic=23959

Have fun!

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]