OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: cortez on July 09, 2007, 07:26:21 am

Title: Pdaxrom Builder Setup Guide On Windows Host
Post by: cortez on July 09, 2007, 07:26:21 am
I've struggled quite a long time setting up the pdaXrom builder. Since building from within other distributions (I've tried Ununtu and Redhat) didn't work, I started a while back with pdaX86. I'm now finally able to build a complete personalised ROM. It's much easier to cross-compile software from pdaX86 because all host libraries are compatible with the target-Zaurus libraries.

In the good tradition of open source hereby my findings and detailed documentation written down along the way. Hopefully this helps others to setup a development environment quickly, being able to build an even better pdaXrom  

I use Windows XP as my host system, and the VirtualBox (http://www.virtualbox.org/) virtual machine running pdaX86 (http://ftp://distro.ibiblio.org/pub/linux/distributions/pdaxrom/download/1.1.0beta1/pdaX86/pdaXrom.iso) as guest.

1. Setup VirtualBox in combination with pdaX86
Code: [Select]
- Create 2(!) virtual harddisks with 25Gb space each (dynamically expanding)
 - Mount pdaXrom.iso as CD-ROM
 - Start virtual machine and login to pdaXrom with 'root'

   # fdisk /dev/hda -> Create new partition
   # fdisk /dev/hdb -> Create new partition
   # mkfs.ext3 /dev/hda1
   # mkswap /dev/hdb1
   # mount /dev/hda1 /mnt/hd
2. pdaX86 harddisk installation
Code: [Select]
# setup-hd /mnt/hd
 # reboot

IMPORTANT: unmount CD before reboot (in VirtualBox)
* On error: "Warning: unable to open an initial console." reboot with CD (mount in VirtualBox)
* Using Midnight Commander (mc from console), copy /dev into /mnt/hd/dev
* Reboot without CD (unmount in VirtualBox)

3. Initial setup
Code: [Select]
  # mkdir ~/zip
   # mkdir ~/src
   # mkdir ~/pdaXrom-builder
   # mkdir ~/work
   # startx
Now download some source packages to build the Subversion client, which we'll need to get the latest pdaXrom-builder.
 - Download Apache httpd-2.2.4 (http://apache.dsmirror.nl/httpd/httpd-2.2.4.tar.bz2) in ~/zip
 - Download openssl.org (http://openssl.org/source/openssl-0.9.8e.tar.gz) in ~/zip
 - Download Subversion (http://subversion.tigris.org/downloads/subversion-1.4.4.tar.bz2) and the dependencies package (subversion-deps (http://subversion.tigris.org/downloads/subversion-deps-1.4.4.tar.bz2)) in ~/zip

Extract the source code as follows:
Code: [Select]
  # cd ~/src
   # tar xjf ~/zip/httpd-2.2.4
   # tar xzf ~/zip/openssl-0.9.8e.tar.gz
   # tar xjf ~/zip/subversion-1.4.4.tar.bz2
   # cd ~/src/subversion-1.4.4
   # tar xjf ~/zip/subversion-deps-1.4.4.tar.bz2
4. Build OpenSSL
Code: [Select]
  # cd ~/src/openssl-0.9.8e
   # ./config
   # make
   # make test
   # make install
5. Build Apache
Code: [Select]
  # cd ~/src/httpd-2.2.4
   # ./configure --enable-ssl --with-ssl=/usr/local/ssl
   # make
   # make install
6. Build Subversion
Code: [Select]
  # cd ~/src/subversion-1.4.4
   # ./configure --with-ssl
   # make
   # make install
   # make clean
   # ./configure --with-neon=/usr/local
   # make
   # make install
7. Preparing the PdaXrom-builder environment
 
Code: [Select]
  # cd ~/pdaXrom-builder
   # svn co https://pdaxrom.svn.sourceforge.net/svnroot/pdaxrom/trunk
8. Preparations for building the VirtualBox Linux Additions
Code: [Select]
  # cd ~/pdaXrom-builder/trunk
   # ./configure i686-livecd-bootstrap ~/work http://distro.ibiblio.org/pub/linux/distributions/pdaxrom/src

The building system is now setup for pdaXrom livecd, target bootstrap

   # cd ~/work
   # uname -a

- Write down the exact kernel version
- Edit ~/work/.config
- Mark out the current kernel (in my case 2.6.17=y) and select the kernel version you just wrote down (in my case 2.6.15=y)

   # make kernel_prepare

Answer all questions with the default option (just press Enter)
   Select only drivers expected to compile cleanly (CLEAN_COMPILE) [Y/n/?] (NEW)
   Legacy /proc/pci interface (PCI_LEGACY_PROC) [N/y/?] (NEW)
   IP tables support (required for filtering/masq/NAT) (IP_NF_IPTABLES) [N/y/?] (NEW)
   ARP tables support (IP_NF_ARPTABLES) [N/m/y/?] (NEW)
   ... lots more ...

   # cd /opt/native/i686/3.4.6-2.2.5/bin
   # ln -s ld i686-cacko-linux-gnu-ld
   # ln -s as i686-cacko-linux-gnu-as
   # ln -s ar i686-cacko-linux-gnu-ar
   # ln -s nm i686-cacko-linux-gnu-nm
   # ln -s objcopy i686-cacko-linux-gnu-objcopy
   # cd ~/work
   # make kernel_compile (on error try again)
   # cd /usr
   # mkdir src
   # cd src
   # ln -s ~/local/work/build/linux-2.6.15 linux
9. Install VirtualBox Guest Additions
9a. Mount VBoxGuestAdditions.iso (in VirtualBox)
9b. Create file /etc/debian_verion which contains the text "4.0" (without parenthesis)
Code: [Select]
  # mount /dev/cdroms/cdrom0 /mnt/cdrom
   # cp /mnt/cdrom/VBoxLinuxAdditions.run ~/zip
   # ~/zip/VBoxLinuxAdditions.run
Strangely enough,  at this point I had to run following command manually, I don't know if this is normally needed:
Code: [Select]
  # ~/zip/vboxadd.sh10. Building the Cross Compile Toolchain
Code: [Select]
  # cd ~/pdaXrom-builder/trunk
   # ./configure corgi-kernel-2.6-xtools ~/work http://distro.ibiblio.org/pub/linux/distributions/pdaxrom/src

The building system is now Setup for SHARP ZAURUS SL-C7x0/7500/860 pdaXrom, target xtools

   # cd ~/work
   # make virtual-xchain_install
   # make archive-toolchain
   # make clean
11. Building the ROM and all packages
Code: [Select]
  # ./configure corgi-kernel-2.6-rom

The building system is now Setup for SHARP ZAURUS SL-C7x0/7500/860 pdaXrom, target rom

   # make world

  Answer all questions with the default option
   Support long options (--hctosys,...) (CONFIG_FEATURE_HWCLOCK_LONGOPTIONS) [N/y/?] (NEW) -> N
   ... lots more ...

   # make image

That's all folks, have fun   ...
Title: Pdaxrom Builder Setup Guide On Windows Host
Post by: pelrun on July 09, 2007, 09:01:04 am
I used the beta4 pdaX86 iso at: ftp://ftp.ibiblio.org/pub/Linux/distribut...aXrom-nosmp.iso (http://ftp://ftp.ibiblio.org/pub/Linux/distributions/pdaxrom/download/1.1.0beta4/pdaX86/new/pdaXrom-nosmp.iso)

No need to go through all that hassle (building Apache? Seriously?) to get svn, it's included. Still has that /dev bug though...

(It's also fine for the 2.4 toolchains too, that's what I'm using it for)
Title: Pdaxrom Builder Setup Guide On Windows Host
Post by: kkazakov13 on July 09, 2007, 09:59:51 am
Building was always so painfully slow on my system ... now that I upgraded to core2duo + 2gb ram ... soon i might reserve some time to install the builder again.
Title: Pdaxrom Builder Setup Guide On Windows Host
Post by: shula on July 09, 2007, 05:28:45 pm
I remember running a Zaurus real ARM virtual-machine on QEMU or on VirtualBox, but i might as well just dreamt it :-) as i sometimes dream of technical desires.

Is there such thing as virtual zaurus machine running in x86 host?
Title: Pdaxrom Builder Setup Guide On Windows Host
Post by: Meanie on July 10, 2007, 04:31:10 am
when I get time, I will build a vmware image with pdaXrom builder and cross-compilers ready to go.
my company just bought me a Toshiba Tecra M5 with Centrino Duo processor, 4GB RAM and 100GB HDD, etc...
damn thing is so heavy compared to my Z, but it got lots of RAM and other useful features...not sure what I am gonna do with it. maybe just leave it at under my bed or carry it around everywhere...
Title: Pdaxrom Builder Setup Guide On Windows Host
Post by: desertrat on July 11, 2007, 05:22:24 am
Quote from: cortez,Jul 9 2007, 11:26 AM
1. Setup VirtualBox in combination with pdaX86
Code: [Select]
- Create 2(!) virtual harddisks with 25Gb space each (dynamically expanding)Presumably you've used this setup for a little while now, how much space does it actually use? I want to setup something similar but can only spare about 10GB of space.
Title: Pdaxrom Builder Setup Guide On Windows Host
Post by: cortez on July 11, 2007, 05:37:04 am
Quote
Presumably you've used this setup for a little while now, how much space does it actually use? I want to setup something similar but can only spare about 10GB of space.

Currently roughly 1Gb for the first partition and 1Mb for the swap partition. Make sure you reserve enough space, because there's nothing more frustrating than a "no space left on device" error  
Title: Pdaxrom Builder Setup Guide On Windows Host
Post by: cortez on July 12, 2007, 04:44:29 am
Just to make sure we understand each other correctly:
In Windows the virtual image file currently is rougly 1.5Gb in size
The Virtual machine (linux) reports a disksize of 25Gb, from which 10Gb is in use.
Title: Pdaxrom Builder Setup Guide On Windows Host
Post by: desertrat on July 12, 2007, 05:07:30 am
Quote
Just to make sure we understand each other correctly:
In Windows the virtual image file currently is rougly 1.5Gb in size
The Virtual machine (linux) reports a disksize of 25Gb, from which 10Gb is in use.
Does that mean the virtual image file is compressed? Anyway I've setup a vmware virtual machine with 4GB virtual drive - 3.5GB for the system and 500MB for swap. I've just completed the "setup-hd" part and rebooted, df inside the newly booted pdaxrom shows 613MB being used. I'll post an update when I've progressed further.
Title: Pdaxrom Builder Setup Guide On Windows Host
Post by: Meanie on July 12, 2007, 08:50:16 am
Quote
Quote
Just to make sure we understand each other correctly:
In Windows the virtual image file currently is rougly 1.5Gb in size
The Virtual machine (linux) reports a disksize of 25Gb, from which 10Gb is in use.
Does that mean the virtual image file is compressed? Anyway I've setup a vmware virtual machine with 4GB virtual drive - 3.5GB for the system and 500MB for swap. I've just completed the "setup-hd" part and rebooted, df inside the newly booted pdaxrom shows 613MB being used. I'll post an update when I've progressed further.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=164764\"][{POST_SNAPBACK}][/a][/div]

usually there are two modes, one the space for the virtual disk is preallocated at creation time, ie if you create a 10GB virtual disk, that much space is used to create it from your HDD. alternatively, a virtual disk can also dynamically allocate the space and only does so when it is needed. in this mode, a 10GB virtual disk will only consume as much from the real HDD as is actually used by the files on it and when it needs more space, it is dynamically allocated, so if you create a 10GB virtual disk and put 1GB of files onto it, only 1GB is allocated to it from the physical disk. the os in the virtual machine will always say that the disk is has is 10GB in size.
Title: Pdaxrom Builder Setup Guide On Windows Host
Post by: desertrat on July 12, 2007, 11:40:57 am
Quote
... a 10GB virtual disk will only consume as much from the real HDD as is actually used by the files on it and when it needs more space, it is dynamically allocated ...
I knew all that  But my reading of this:
Quote
The Virtual machine (linux) reports a disksize of 25Gb, from which 10Gb is in use.
Is that the guest OS, ie inside pdaxrom, it is already using 10GB out of the allocated/pre-allocated 25GB. However the host OS is reporting that only 1.5GB of real disk space is being used:
Quote
In Windows the virtual image file currently is rougly 1.5Gb in size
Which implies some real heavy duty compression is taking place or something. But that's not important right now, since I already installed it I'm going to play around with it and see if I eventually run out of space

But my immediate concerns right now is that pdaxrom under vmware has a tendency to lose my mouse pointer. I've got a Win98 and WinXP running under vmware and have tried loads of different linux distros using it and have never come across a disappearing mouse pointer before  I think I'll just stick to the console for the moment - no scratch that, I'll use ssh.

Meanie, when you get round to making an updated pdaxrom ISO, could you please add some essential utils to it? At least add less and vim. Using more is a pita, and all versions of vi that I've used on practically all manners of systems suffer from corrupt display - after a little bit of editing the display does not reflect the actual contents of the file.