PdaXrom: pdaXrom-builder
From OESF
Contents |
Getting pdaX86
PdaX86 is a Live Linux distribution built with pdaXrom-builder for x86 based PCs. It's like Knoppix or Slax, but it isn't based on them. The main feature of this Linux distribution is the ability to be the host OS for the pdaXrom-builder scripts. To get it, download the bootable CD image, from http://mirror1.pdaxrom.org/pdaX86/ and burn it to a CD-R or a CD-RW disk. Reboot the system from this CD and login as root.
To work with the builder you need space on a hard drive. If a Linux partition exists, you can use it. In this case, all settings will be placed in the partition's /.pdaX86 directory. If the partition is FAT, all settings will be written in the root directory, in a file named .pdaX86.dsk. If there aren't any partitions or you don't have free space on them, you may use fdisk or cfdisk to create/add partitions. To install the system, enter setup and choose a partition from the menu. After that, enter reboot. On the next boot, pdaX86 will use the saved settings from the selected partition.
Note: Setup doesn’t destroy the selected partition, it just creates a directory or file there for storing the settings. Just remove the.pdaX86 directory (Linux partition) or .pdaX86.dsk file (for FAT) if you no longer need the saved settings.
Getting pdaXrom-builder and necessary sources
For building pdaX distributions it's necessary to have:
- pdaX86 as host OS
- pdaXrom-builder scripts
- program sources
In order to build the distribution, it's good if the computer meets the following requiments:
- powerful CPU with a minimum of 512 MB of RAM
- at least 15 GB of hard disk space
- it’s desirable to have 512MB of swap space as a minimum
If you have a permanent connection to the Internet then the program sources will be automatically downloaded from original sites during the build of the system, or they can be downloaded from http://mirror1.pdaxrom.org/source/. You can build the distribution without connecting to the Internet if all sources are available on the hard drive.
Setup pdaXrom-builder
The structure of the compressed pdaXrom-builder file: pdaXrom-builder-03.12_09.02.05.tar.bz2, where
- pdaXrom-builder – name of the system
- 03.12 – time of the archive
- 09.02.05 – date of the archive
- tar.bz2 – tar-bzip2 archive extension
- Select a directory, where the builder will be installed
cd /some/where
- Unpack the file:
tar jxf pdaXrom-builder-03.12_09.02.05.tar.bz2
- Make a link to the sources
ln -s <path to sources> pdaXrom-builder/src
- Create a directory for the compiled binary packages. Usually it's pdaXrom-builder/bootdisk/feed:
mkdir -p pdaXrom-builder/bootdisk/feed
Choose a platform from ready configurations
Enter the builder directory:
cd pdaXrom-builder
Config-sys directory includes examples of ready configurations.
The structure of directory names is:
<platform>-<architecture CPU>-<type of mathematical coprocessor>-<version of C compiler>-<version of glibc>-<version of kernel>
Explore what directory corgi-xscale-softvfp-3.3.2-2.2.5-2.4.18 includes:
- Corgi platform:
- Processor Intel Xscale PXA (armv5tel architecture by ARM classification)
- Coprocessor – vector float point unit emulation
- Version of gcc 3.3.2
- Version of glibc 2.2.5
- Version of Linux kernel 2.4.18
- File config_xtools has the configuration for compiling cross-development tools for given architecture.
- File config_qtopia21 has the configuration for compile distribution.
Compile cross-development tools
Copy the file config_xtools to the builder's top directory with a name .config:
cp config-sys/corgi-xscale-softvfp-3.3.2-2.2.5-2.4.18/config_xtools .config
Set a directory where will be install compiled tools:
make menuconfig
Go to the Target Architecture submenu:
Change prefix for cross-development tools:
Cross-development tools will be placed in directory /tmp/crosstools.
Don’t forget to save changes before leaving the configuration:
Start to compile cross-development tools:
make world
The compilation time depends on the hardware. For example, the time for compilation takes 30 minutes on PC with RAM of 512 MB, processor AthlonXP 2500+ and motherboard with NVidia NForce2 chipset.
When work is finished, we can compress the compiled tools and then use it without recompilation:
make archive-toolchain
In the parent directory there's an archive: armv5tel-cacko-linux-gnu-3.3.2-2.2.5-softfloat-23.06_10.02.05.tar.bz2, where
- armv5tel-cacko-linux-gnu – full name of architecture for its cross-development tools will be compiled code.
- 3.3.2 – version of gcc
- 2.2.5 – version of glibc
- softfloat mean use emulation for arithmetical coprocessor
- 23.06_10.02.05 time and date of creating archive.
We should check whether the compiled tools are working correctly. To do this, we compile a simple program. Create a file with this content and name it hello.c:
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello, world!\n");
return 0;
}
Compile the program:
/tmp/crosstools/bin/armv5tel-linux-gcc hello.c -o hello
Check the compiled binary file:
file hello hello: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped
The utility file shows that hello was created for ARM architecture.
Sometimes Linux kernels require a specific version of gcc and binutils to be used to compile with. This depends on patches and commercial drivers being used by the kernel. For example, platforms collie and corgi use kernel 2.4.18 with Lineo company patches must be compiled with gcc 2.95.3 and binutils 2.11. A ready configuration with these cross-tools is found in directory corgi-arm-hardfloat-2.95.3-2.2.5-2.4.18.
Configure and build the Linux distribution
Clean working directories from sources, which were used for compiling the cross-development tools:
make clean
Choose the ready made configuration for the Linux system:
cp config-sys/corgi-xscale-softvfp-3.3.2-2.2.5-2.4.18/config_rom .config
Customise the configuration for the Linux system for yourself:
make menuconfig
Target Architecture – setting of the selected architecture for which the code will be compiled.
Prefix for root filesystem – prefix, where the root directory of pdaXrom-builder will be found.
Change the Prefix for development environment to the path where the compiled cross-development tools can be found - /tmp/crosstools.
Back to main menu.
Select kernel menu:
The selected kernel in our configuration uses a certain version of compiler for building. Change the compiler path to the directory where this compiler is located (for example, if the tools are compiled in /tmp/crosstools-2.95.3 then you need add suffix /bin - /tmp/crosstools-2.95.3/bin – it shows the location for cross-compiler executable files).
The configuration setting for building is over, so we can now delete or add packages. These packages will be compiled automatically. If you want you may include package in automatically compiled image OS which is ready for install on target device.
Choose menu Ipk Packages:
After choice of required packages is finished you must save your pdaXrom configuration:
Type
make world
and wait until the compilation of the distribution is over. At the end of compilation, the compiled packages will be placed in the bootdisk/feed directory. In order that make the filesystem image ready for install on device, type:
make image
JFFS2 filesystem image with the name initrd.bin will be placed in the bootdisk directory. Linux kernel will be located in the same directory with zImage.bin name.
Install ready Linux system on the device
Installing system on Sharp Zaurus architecture corgi does with the help of CF, SD, serial, USB port or CF network card. For updating system need a script, which controlling update (updater.sh), kernel (zImage.bin), filesystem image (initrd.bin). We use own version of control script and additional toolchain for getting new service functions (tools.tar), which include Linux kernel too.
For updating kernel unpack it in parent directory, where builder placed:
tar xf <path where placed install tools>/tools.tar -C ..
Then copy new kernel:
cp bootdisk/zImage.bin ../tools/kernel-SL-C860/
Note: directory kernel-SL-C860 is chosen because in kernel configuration selected model boxer. According by Sharp classification it means Zaurus SL-C860.
After updating kernel compressed new file tools.tar:
tar c -C .. tools > ../tools.tar
Everything is ready for updating. For updating system copy to card CF necessary files: initrd.bin, tools.tar, updater.sh. You may copy to card with Card Reader or via network with command scp, if Card Reader connected to another computer:
For load updating system turn off external power supply (PSU) from Zaurus. Open an accumulator’s cover and take battery. Insert battery back in 10 seconds and put down cover. Turn on PSU. Insert CF card with updating files to device. Then press and hold button OK on keyboard simultaneously press on/off on back side of Zaurus. After switching-on you will see service menu. Select point 4 for updating system. There is menu choice of updating way. Select point 2 for updating from CF card. Reply yes(Y), it means that you agree on updating system. In one minute you will see installation menu. Select point 1 Install new ROM. Process of updating kernel will be run and will write new filesystem image to flash memory. When updating is over then select point 6 Reboot for restart device and run your installed system.
After system loaded you get login prompt for enter a system.
With the ssh, installed in system, you can login to device through network. For this use emulation of network through USB (TCP over USB). Connect USB cable to device and host-computer. When connection detected, host-computer automatically (though hot-plug system) up support of USB interface as network (usb0) with address 192.168.129.1. Automatically runs interface usbd0 with address 192.168.129.201 on device.
For provide security remote access without authorization doesn't permit. Login system console as root and make new password, which is absent after new system installation:
passwd
Enter new password twice. Then we can have remote access:
For finishing session type
logout
or press Ctrl+D keys.
The HOWTO is completed, but there are some spelling errors in it. Please correct, if you find one.















