Build root filesystem
Build the system components from scratch
HOWTO build the system with Buildroot
Now buildroot is capable to build all the system - kernel, uboot, rootfs and nano-X.
Sources are in SVN.
1. Packages, needed for compilation and development, ALWAYS install development versions of this packages (-dev):
|32 bit linux host. 64 bit systems are known to not work|
|bzip2, gzip, tar|
|gcc-4.1.2, binutils-2.18, g++, glibc-2.6|
|mc, doxygen, ncurses (or libncurses), wget, texinfo|
|xorg, libjpeg, libpng|
|perl, python, sed, patch, libtool, bison, flex, gettext|
|autoconf, automake, make, cmake, cvs, git, strace, subversion|
Some useful tools:
- Kdesvn, eSvn, qSvn - Subversion GUI clients (Qt based)
- Qgit - Qt gui for GIT
- Kdiff3 - very useful tool to compare directories ( e.g. old and new versions of some package )
2. Install SVN support (subversion)
3. Checkout copy of buildroot sources:
cd ~ svn co https://linux-on-sx1.svn.sourceforge.net/svnroot/linux-on-sx1/trunk/host/buildroot
4. Configure buildroot :
cd buildroot make menuconfig
You will get to the buildroot configurator, like the one in linux kernel.
Go to the "Target options" submenu, you can change "hostname" and "banner" at your option.
Then go to the "TI OMAP device support" and change "also copy image to ..." path to your home folder.
Also go to the "Target filesystem options" and change "also copy image to ..." path to your home folder.
5. Build all the system:
# add the path to the toolchain and tools to the PATH # you SHOULD set it permanently in your environment, for example put the next line in .bashrc file in your home dir export PATH=$PATH:~/buildroot/build_arm/staging_dir/bin # run the build process make
If you get this error:
fixdep: arch/arm/boot/compressed/.piggy.o.d: No such file or directory
- just restart "make" one more time.
If you get error like this:
/usr/lib/libmad.so: could not read symbols: File in wrong format
- try to rename /usr/lib/libmad.so, build buildroot and then rename back to libmad.so
Now you can go and get some coffee while buildroot download and build all the packages.
After that you will have:
Detecting amount of internal flash
Use application "flashsize.exe" (see Download section), put it somewhere on your phone, then start it with filemanager.
It should display you the size of your flash - 24 or 32 MB.
To determine amount of SX1 internal flash you should read value at address 0x44 (0x50000044 in Symbian). You can use FCAMem for this, or Uboot.
SX1# md 44
- should give you a value at 0x44. Then if it is 0x01000000 - you are lucky to have 32Mb flash, if 0x04000000 - you have old 24Mb strataflash.
Universal bootloader (U-Boot) has SX1 support.
Download uboot sources here - uboot-1.1.4.tar.bz2
Unpack it somewhere.
Then copy sx1 uboot-1.1.4-sx1.patch (see Download section) to uboot-1.1.4 dir and apply it
cat patch-1.1.4-sx1 | patch -p1 make SX1_config make
Now you have u-boot.bin ready. Then apply firmware patch sx1.uboot.patch.v1.8.sxp (see Download section) to original SX1 fw 15, it installs u-boot binary into disk Z replacing file z:\system\data\testserver.mbm. You should know how to apply patches, if not - visit http://forum.oslik.ru. After all this stuff you should have uboot running when pressing 9 + POWER buttons. Remember to plug in standart USB cable. To work with uboot console your linux kernel on host machine should have "usbserial" compiled as module:
make menuconfig Device drivers->USB support-> USB Serial Converter support-> [M] USB Serial Converter support [*] USB Generic Serial Driver
and loaded with commands:
rmmod usbserial rmmod cdc_acm modprobe usbserial vendor=0x0525 product=0xA4A6
Now after starting uboot you should see messages with "ttyUSB0" in system log. Read sx1.uboot.pdf for complete instructions on how to work with uboot.
Get standart vanilla kernel sources - linux-18.104.22.168.tar.bz2
Unpack it somewhere.
Get omap support patch for the 2.6.16 kernel - patch-2.6.16-omap2.bz2
Get SX1 support patch - 0001-sx1-support.patch (see Download section)
Put kernel patches into the 22.214.171.124 kernel sources:
cat patch-2.6.16-omap2 | patch -p1 cat 0001-sx1-support.patch | patch -p1
Then copy linux-126.96.36.199.config.sx1 to .config and place it into kernel source dir. Run
make menuconfig make uImage
To make use of XIP kernel you should flash it into internal flash. Connect to u-boot console, then do from it:
SX1# loadb press Ctrl+A S, select uxipimage.bin,wait while uploading SX1# protect off 1:192-214 SX1# erase 1:192-214 SX1# cp.b 10000000 01800000 $(filesize) SX1# protect on all SX1# setenv bootcmd bootm 01800000 SX1# saveenv SX1# boot
Now you should see linux kernel booting on SX1 LCD!
Your host machine should have NFS server up and running. Unpack root filesystem image to /rootfs and export it with NFS - add this line to /etc/exports
Start uboot, then from uboot console:
SX1# setenv bootargs root=/dev/nfs rw nfsroot=188.8.131.52:/rootfs,rsize=1024,wsize=1024,nolock ip=184.108.40.206 SX1# saveenv SX1# loadb
now press Ctrl-A + S, choose uImage and send it to SX1.
now you will see kernel booting on SX1 LCD screen.
Exit from uboot (Ctrl-A + X). Kernel uses USB Gadget Ethernet to establish network communication with host. So after a few seconds you should see new network device on host - usb0 attached in system logs. You should configure it with IP adress:
ifconfig usb0 220.127.116.11
Now you should see kernel continue booting with NFS. Then it will be Busybox invitation on LCD. By default there is telnetd running on SX1, so you can login to it:
telnet 18.104.22.168 login: root password: oslik SX1 >
By default keypad CAMERA key is binded to "soft reset" function. So after you see some error and want to get back to uboot simply press CAMERA + 9.
Using Symbian UbootLoader v.1.4
1. Creating on you MMC card following partitions:
1)FAT16 2)Ext2 3)Linux Swap
2. Unpack on Ext2 the last rootfs.tar
3. Unpack on Fat16 last ubootloader.zip:
4. Download last u-boot and kernel linux for sx1.
Put files to the root of MMC card: E:\u-boot.bin E:\uImage.bin
5. Final step:
Rename "Load_uboot.exe" to "starter.exe" then put file "starter.exe" to E:\System\Programs\
Reboot the phone. and Linux should start now. To boot to the Symbian just turn the phone on without MMC inserted.