My Book World Edition II

1
Filed under Development
Tagged as , , , , ,

This week I bought myself a network attached storage device, Western Digial My Book World Edition II. The device runs BusyBox Linux distribution under the hood. It has an Arm926T series ~200Mhz processor and 128 megabyte system memory.

As far as I could see from various forums, in the previous firmware versions it already had the necessary gcc toolchain inside the device but it is no longer present in the current versions. I have bumped into some tutorials on cross-compiling software for the device but as a regular scratchbox user I wanted to create a scratchbox target for the device so cross-compiling stuff(especially with autotools and similar stuff) would be less painful.

First, I created a target with the cs2005q3.2-glibc2.5-arm toolchain that comes with scratchbox 1.0, and managed to compile and run some software successfully(e.g. gnu screen and transmission 2.03). But then later on with some other stuff that I tried to compile started spitting out runtime errors about missing symbols.

Then I downloaded the archive file from Western Digital’s web site which included all the source code of the software used in the distribution and also the gcc toolchain that was used to compile the system. After struggling for some hours and following the instructions on scratchbox website for importing foreign toolchains, now I can cross-compile for the device without problems. The only problem I encountered while importing the toolchain was a compile error while compiling gdbserver application. The solutions to the problem seemed a bit complicated and as I do not urgently need the gdb server I made some changes in the Makefiles and removed it from the build. For those who don’t want to go through importing the toolchain I created the tarball and deb package for the firmware version I have, feel free to download. After installing the package just select the mybook-arm toolchain and qemu-arm-cvs as the cpu transparency method, things should work fine.

Besides the gdb server error, while trying to build glib library it failed with errors of undefined reference to some inotify_* calls. I saw that the inotify related headers are present in the toolchain but the libc that comes along does not have the methods. I have no idea why it is like that, but then I managed to compile glib after I removed the headers.

The linux distro in the device has no package management system, so I was a bit afraid to mess stuff up with libraries. Currently I am compiling all the applications with statically linked libraries. Seems to work fine so far.

Git and Cherries

0
Filed under Development
Tagged as , ,

Today I needed to pick some specific changes from a local git branch and merge them to another. git cherry-pick does the job.

Usage:

git log source_local_branch #check the sha1 hash of the commit we want
git checkout destination_local_branch #switch to the branch we want to merge the commit.
git cherry-pick -x <commit_id>

the -x parameter adds the original commit id to the commit message.



				

Showing trailing whitespace in Vim

0
Filed under Development
Tagged as , , ,

Git has been warning me for leaving trailing whitespace in code files every now and then. So I decided to put this in my .vimrc:

Source: here

Showing current git branch on shell prompt

1
Filed under Development
Tagged as , , , ,

Found this useful piece of code to put into .bashrc, which shows the current branch when the current working directory is versioned by git.

Listing debian packages sorted by size

0
Filed under Development
Tagged as , , , , , , , ,

[cc lang="bash"]dpkg-query –show –showformat=’${Package;-50}\t${Installed-Size} ${Status}\n’ | sort -k 2 -n |grep -v deinstall
[/cc]

This was the most useful thing I’ve found today.

found it here.

Vim settings

0
Filed under Development
Tagged as , , , , ,

I used to carry all my vim settings in a .tar.gz file wherever I would go. Sometimes it would get messy because I would forget to get something from somewhere so I would need to create it from scratch. Now I’ve got everything in a public git repository, and I hope it could be useful for other vim beginners too.

The repository can be found here.

Something better than grep – Part II

2
Filed under Development
Tagged as , , , ,

As I mentioned previously, I kind of liked the ack-grep tool. I made a small patch for it so that it ignores moc_*.cpp files generated by Qt’s moc tool, which I think makes not much of sense to include in the search as they are automatically generated files.

Rubik’s Cube patterns, 4x4x4

0
Filed under Daily
Tagged as ,

Instead of directly jumping to the 5x5x5 cube I decided to learn some cool patterns on the 4x4x4 cube. Just for being more annoying in a group of friends playing with the cube constantly :)

Here I found some really nice patterns and also instructions for solving the cube:
link

Rubik’s Cube Patterns

0
Filed under Daily
Tagged as ,

Out of boredom, while searching, I found this web site showing how to build different patterns on a 3x3x3 rubik’s cube.

http://www.math.ucf.edu/~reid/Rubik/patterns.html

Toilet With The Best View

1
Filed under Non-sense output
Tagged as , ,

Here is the toilet from Torni(tower)/Helsinki. You have the pleasure to pee against whole city.

Torni Tower

Torni Tower