01/28/2008

Self compiling - ncftp

I tried today to build ncftp on Angstrom Zaurus, so called self-compiling. I've already cross-built it with Code Sourcery's toolchain. This is another experiment to see how Angstrom toolchain works.

Following packages are required to build ncftp.
# ipkg update
# ipkg install task-sdk-bare
# ipkg install gcc
# ipkg install gcc-symlinks
# ipkg install binutils-dev
# ipkg install make
Let's see how Zaurus compiles ncftp by itself.
# wget ftp://ftp.ncftp.com/ncftp/ncftp-3.2.1-src.tar.bz2
# tar jxvf ncftp-3.2.1-src.tar.bz2
# cd ncftp-3.2.1/

# time ./configure
real 2m 51.54s
user 1m 51.79s
sys 0m 56.83s

# time make
ERROR: busybox ar [-o] ....
It seems archiver's version difference. I found ar in my Zaurus is just a symbolic link to busybox, so I changed it to Angstrom toolchain.
# ls -l /usr/bin/ar
ar -> busybox

# cd /usr/bin
# rm ar
# ln -s arm-angstrom-gnueabi-ar ar
Try again.
# make clean
# time make
make[1]: strip: Command not found
It was not exactly an error but it's easy to fix.
# cd /usr/bin
# rm ar
# ln -s arm-angstrom-gnueabi-strip strip
Last try.
# make clean
# time make
real 9m 1.36s
user 8m 18.01s
sys 0m 38.55s
With my cross compile environment on my Ubuntu PC, same thing could be done way faster.
$ time ./configure --host=arm-none-linux-gnueabi --prefix=/opt/arm-cc
real 0m24.485s
user 0m7.580s
sys 0m3.092s

$ patch -p0 < ncftp-3.2.1-arm-linux.patch

$ time make
real 0m33.728s
user 0m22.741s
sys 0m2.908s
But. Question is how easily we can make a patch. If there's already some patches available, cross compiling is good and fast. If not, self compiling environment would be a nice backup.
posted by 安藤恐竜 at 17:48 | Comment(0) | TrackBack(0) | 日記

Maintenance Kernel and re-partitioning

Well, I decided to re-partition the HDD in my Zaurus. I don't need vfat patition anymore, neither Qt environment.

But backup is backup. Following is only a memo for myself. Please do not try on your Zaurus if you are not sure what's going on.
$ ssh root@zaurus
# cd /media/hdd
# tar zcvf hdd3.dict1.tar.gz dict1
# mv hdd3.dict1.tar.gz /media/card
# rm -rf dict1
# tar zcvf hdd3.dict2.tar.gz dict
# mv hdd3.dict2.tar.gz /media/card
# rm -rf dict2
# tar zcvf hdd3.Documents.tar.gz Documents
# mv hdd3.Documents.tar.gz /media/card
# rm -rf Documents
# cd /
# tar zcvf /media/hdd/hdd2.home.tar.gz home
# mv /media/hdd/hdd2.home.tar.gz /media/card
# poweroff
I saved these tar files in my PC and delete them from SD.

Now the maintenance kernel. While pressing [D] and [B] at the same time, unlock the battery cover, push reset switch, lock the battery cover back then power on.

The maintenance kernel is yet another version of Zaurus ROM. I played with it for a while.
# dmesg | more
# fdisk -l /dev/hda
# mount -woremount /
# mount -t jffs2 /dev/mtdblock2 /hdd1
# mount -t jffs2 /dev/mtdblock3 /hdd2
OK. I go a step further.

fdisk /dev/hda and delete all the partitions. Create a new partition from cylinder 1 to 7872 and let left space be another one then set type as 82 (Linux Swap). Then mkfs.ext2 /dev/hda1 and mkswap -v1 /dev/hda2. Now most of 4GB HDD becomes root and around 32MB swap.

I have downloaded the stable Angstrom console image to my SD card. Just flash it as usual. Last command for my new Angstrom envrionment is swapon /dev/hda2 so that a new 32M swap joins in.

My purpose for a big / is install self compiling envrionment. After ipkg update, I did some ipkg install like gcc, gcc-symlinks, task-sdk-bare.

I'll see what I can do on this new environment.
posted by 安藤恐竜 at 00:06 | Comment(0) | TrackBack(0) | 日記

広告


この広告は60日以上更新がないブログに表示がされております。

以下のいずれかの方法で非表示にすることが可能です。

・記事の投稿、編集をおこなう
・マイブログの【設定】 > 【広告設定】 より、「60日間更新が無い場合」 の 「広告を表示しない」にチェックを入れて保存する。


×

この広告は1年以上新しい記事の投稿がないブログに表示されております。