20081231

Shape-Writing or "Swyping"

Shape-writing, or "swyping" (instead of typing) seems to be the newest trend among touchscreen enabled devices. Of course, along with any new idea comes a slew of conflicting software patents that were accepted (where else?) at the United States Patent Office.

I believe that Apple, the original T9 creator, and Shape Writer Inc each have patents for what is essentially the same 'technology'. Please humor my quoted use of the word technology, because I am one of several billions of people who do not believe that software (which is what this is) should be patented.

This technology is very interesting in that it uses 'intelligent algorithms' to determine what word the user is trying to write. I thought that I would outline the fundamentals of these intelligent algorithms, just in case anyone in the FLOSS universe would like to implement them for a fun project in their spare time.

First of all, let's define the path that the users' finger or stylus traces on the touch screen. There exists 1) a starting point, 2) a finite number of 'corners'. If we assume that such a trace or path lies atop a coordinate system, for example, the imaginary plane, then the sequence of 'corners' simply become ordered coordinates in the complex domain.

Let's use a box, for example.

[ (0 + 0j), (0 + 11j), (11 + 11j), (11 + 11j), (0 + 0j) ]

The above set of ordered coordinates traces a box, starting at the origin, and continuing clockwise. The area of the box is (11x11) units squared.

In fact, the sequence of ordered coordinates comprimises a signal in the complex spatial domain (i.e. a 1-D signal), and as such (making several rudimentary assumptions), it can be mapped to a different coordinate space (the frequency domain), using the DFT (discrete fourier transform).

The most interesting part of this, I find anyway, is that taking the IDFT (inverse discrete fourier transform) of the 0-frequency component of such a signal, actually the 'mean', results in a single point lying at the geometric center of the box (i.e. the center of mass). Furthermore, the IDFT of the first two components result in a ellipse containing all points defined in the signal. As one would expect from summing successive components of a fourier representation, IDFTs of the next successive components result in a shape that increasingly resembles the original signal (i.e. a box).

It's pretty cool, at any rate. I had a lab excercise in Grundlagen der Geometrische Signalverarbeitung (Introduction to Geometric Signal Processing) in my first year at Uni-Kiel, which used a Christmas tree as an example.

In any event, if you define several points of interest in the complex domain, by overlaying the center-points of an on-screen-keyboard, then by careful application of Z-domain filtering, it's possible to determine the exact word that a person is trying to 'swype'. The Z-domain filtering is linear, and also unfortunately non-linear in nature. Why? Well, if you consider that corners represent signal components, then if a letter included in the signal just happens to be underneath the path, where no corner exists, then it's as if a component in the signal has been 'lost' during 'transmission'. It's as if higher frequency components are actually filtered out, so the 'intelligent' part of this algorithm is trying to associate a signal with another signal containing higher frequency components. This can be done, for example, by maximum likelihood or MMSE methods.

Alternatively, given a large enough sample group of input / output pairs, this problem can be solved quite easily using a lexicon or word association database. Given a path with a certain number of components, or corners, one should be able to do a very fast search to look up associated words in order of decreasing probability.

Ta Da!

I'm fairly certain that this 'technology' will be implemented in Android. However, I would also like to see it in the OpenMoko project.

Maybe such an app has already existed in the open-source world for some time. If not, or if anyone would like to volounteer to write such an app, then I would be very open to further explaination. Just submit a comment below.

Update (20100412): It appears that Samsung has integrated the idea of 'swyping' into Android on their new(ish) Galaxy S devices, as you can see from the video below. Very Cool.

20081218

Triple Booting the Neo FreeRunner




Hi everyone,

It's been a while since my last post, so I must apologize for that. Things have been very busy since November.

However, as some of you may already know, I was also experimenting with the Android operating system on my FreeRunner directly after the source code was released. In fact, I was arguably the first person to compile Android for the ARMv4T architecture. Thanks to the work of the community, it is now possible to run Android on the FreeRunner using KoolU's sources.

The private Android repository is to be merged with the official public repository sometime in Q4 2008, while the first release featuring an on-screen-keyboard will be Q1 2009. The areas I would like to concentrate on are WiFi, and Glamo improvements.

In any event, I'm currently triple-booting the FreeRunner with the latest OM image (or FDOM image), Android, and Gentoo. I'm planning using the Gentoo install for debugging things that will eventually go into the OM and Android images.

I'm using an 8GB uSD card with 4 primary partitions:

/dev/mmcblk0p1: MokoData (vfat) 5 GB
/dev/mmcblk0p2: AndroidData (ext2) 512 MB
/dev/mmcblk0p3: MokoRoot (ext2) 512 MB
/dev/mmcblk0p4: GentooRoot (ext2) 2 GB

Android is of course installed to the 'rootfs' partition in nand flash. MokoData contains uImage-android (from Sean McNeil), uImage-2008.9.bin, and uImage-2008.12.bin - the latter two are official OpenMoko kernels. I've updated the nand boot menu so that menu_2 boots OM 2008.9, menu_3 boots Android, and menu_4 boots Gentoo.

At some point in the near future, I'm hoping to create a torrent so that the configuration can be downloaded and shared by everyone in the community, but you may have guessed that Free Time(TM) is limited these days.

20081111

EEE and Firefox Full Screen

I found that this little hack for your ~/.mozilla/firefox/[profile]/chrome/userChrome.css file greatly improved the usability of Firefox on the EEE PC. It makes the bookmarks toolbar, as well as the menubar (File, Edit, etc) visible from full screen mode simply by moving the mouse up to the top of the screen. When the mouse is moved away, all toolbars are autohidden, giving you that great full screen browsing ability!

#navigator-toolbox:hover > #PersonalToolbar,
#navigator-toolbox:hover > #toolbar-menubar
{
visibility: visible !important;
}

Many thanks to sewpafly for the above chrome fragment!

There is one shortcoming of this that I've already noticed. Namely, when I move the mouse up to the top of the screen, and then above a tab to close it, all of the toolbars autohide before I can close the tab. Normally, this is no problem for closing a tab (Ctrl+w), but for closing other tabs, no shortcut key exists yet, so it's only possible to do by mouse :P

This reminds me of two shortcut key proposals that I had way back when:

1) Ctrl+Shift+w - close all other tabs
2) Ctrl+Shift+PgUp/PgDown - move tab right / left

Those are both 'borrowed' from the Gnome Terminal, but I think they apply quite well to Firefox too.

20081103

SPSS 16 on the EEE PC


If you encounter an error in the SPSS 16 installer for Linux that says "No Java Runtime Environment (JRE) was found on this system", then I think I have the solution for you. The problem is that the installer does not properly run the bundled JRE that it installs in its own temporary directory. So, although the error sounds as though it's not finding your JRE, it's actually not finding its own JRE.

I'll start from the beginning, because this isn't the only part of the installation where I encountered errors.

A friend of mine asked me to install her copy of SPSS 16 for Linux on her EEE PC. She met all of the system requirements (aside from the screen resolution and minimum CPU speed), but still could not get the installation to work.



First I just tried to run the installer file, 'setup.bin', and the installer exited almost immediately. I scrolled up to find out that it could not find 'bc', the arbitrary precision calculator. So I followed the instructions here and installed bc with 'apt-get update; apt-get install bc'.

Then setup.bin failed with the message, "The directory /tmp does not contain enough space to extract temporary files. Please specify a temporary directory using the -is:tempdir option. Use the -is:help option for more information." So, I ended up using her 2 GB USB memory stick for the temporary directory (I reformatted it to use ext2). At this point, I was using './setup.bin -is:tempdir /media/D\:/tmp' for the setup command.

That failed as well, but this time with the message, "No Java Runtime Environment (JRE) was found on this system". I thought that was odd, so I ran './setup.bin -is:help' again and noticed that there was an '-is:javahome' option. So, I ran 'ls -la `which java`', and found that java was a symbolic link which pointed to /etc/alternatives/java, which was also a symbolic link pointing to /usr/lib/jvm/java-1.5.0-sun/jre/bin/java. Then I ran the installer again, and it failed with the same message. At this point, my setup command was './setup.bin -is:tempdir /media/D\:/tmp -is:javahome /usr/lib/jvm/java-1.5.0-sun/jre'.

I ran './setup.bin -is:help' again to see if somehow it could point me in the right direction, because the installation instructions were pretty horrible. I noticed the '-is:log' option, so I ran the setup again with the command './setup.bin -is:tempdir /media/D\:/tmp -is:javahome /usr/lib/jvm/java-1.5.0-sun/jre -is:log /media/D:\:/tmp/spss.log'. That gave me the hint at what was really happening. The log file ended with, "installing bundled JRE... Verifying... /media/D:/tmp/istemp2346224982367/_bundledJRE_/bin/java -cp /media/D:/tmp/istemp2346224982367/Verify.jar Verify java.vendor java.version Verification failed for /media/D:/tmp/istemp2346224982367/_bundledJRE_ using the JVM file /media/D:/tmp/istemp2346224982367/_bundledJRE_/jvm".


Sure enough, if I said '/media/D:/tmp/istemp2346224982367/_bundledJRE_/bin/java -cp /media/D:/tmp/istemp2346224982367/Verify.jar Verify java.vendor java.version', I would get the error message, "Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object".

I knew that this was a serious boo-boo on the part of whoever designed this installer (very poor quality control), so instead of hacking the jvm file during runtime, I thought I would try a different trick so that the various paths and environment variables where not messed up.

mount -o bind /media/D\:/tmp /tmp

This effectively gives me the storage space for -is:tempdir in /media/D\:/tmp, but allows programs to access /media/D\:/tmp from /tmp instead (the default place for -is:tempdir). Using only './setup.bin' this time, the setup proceeded past extracting the bundled JRE, verifying it, and extracting the installation archive, but then setup exited with the error, "The installer is unable to run in graphical mode. Try running the installer with the -console or -silent flag."

I knew that loss of X was pretty typical to using 'sudo', so I changed /etc/sudoers with the command 'visudo', and added "XAUTHORITY DISPLAY" to env_keep in the Defaults declaration. At that point, I had to end my sudo session and start a new one. I verified that XAUTHORITY and DISPLAY were preserved after I started my sudo session with 'sudo -s', 'env | grep "XAUTHORITY\|DISPLAY"'. At that point, all I had to do was close the terminal application, reopen it with Ctrl+Alt+t, start a sudo session with sudo -s, and run './setup.bin'. Then the installer worked perfectly. There are also a few patches to SPSS 16 for Linux as well, located here.

I haven't tried installing them yet, but hopefully they will work 'out of the box'.

I know that this wasn't a very short and sweet how-to, but ... well... I didn't write the installer script, and I didn't really feel like modifying it (which would probably be some kind of copyright violation if I redistributed it), so I thought I would just describe the fix for anyone to read. Hopefully the SPSS people will read this and fix this installation bug for their next release.

Install BC - The Arbitrary Precision Calculator
Format a USB memory stick with Ext2, use as tempdir
Mount tempdir (bind) at /tmp
Edit /etc/sudoers to preserve XAUTHORITY DISPLAY

20081028

Android Porting Progress

Hi everyone,

Sorry I haven't posted anything recently, but my days were busy with work, and then my nights were busy porting Android to the FreeRunner. In short, it's coming along, slowly but surely.

I've basically had to teach myself ARM assembly language in the last couple of days (fun, fun, fun!) and thought that I would quickly share all of useful resources that I've come across. So here they are:

The ARM Architecture Reference Manual

This is the definitive reference for pretty much everything. After reading this, I don't think I'll need any other reference material. In fact, I might even print myself a hard copy!

UNSW lab material on microprocessors and embedded systems

This is a surprisingly detailed tutorial for programming ARM in assembly language and C, which sort of bridges the gap between the two languages. It explains precisely the syntax of .S files and complies to the AAPCS (ARM Procedure Call Standard) and Thumb Procedure Call Standard (TPCS). I've archived the material for future reference in case this course website ever goes missing (which tends to happen often with universities).

Finally, the diff that I'm working from

Yes, I realize that it's pretty lame to cling to a single version of Android and not be constantly synchronizing with git and submitting code for review with gerrit, but I have no intentions of targetting anything aside from the FreeRunner / Neo1973 with my port, so I don't really want to deal with the build infrastructure right now. Ignore anything that starts with the less-compatible regular expression '^\- .*smull' (search by hitting '/') - I seem to have hastily deleted those routines in order to get my code to trivially compile before. Please, I don't recommend even trying to apply the diff as a patch - it will do nothing and may even inflict pain on some remote small kitten... and you wouldn't want that, would you? ... But seriously, the diff just highlights what code needs to be worked on. It actually has a lot of 'cruft', i.e. garbage, too, so just look for any lines matching '^\- ' that also contain one of the opcodes listed on the wiki.

Now from what I've been looking at in the code, there are 3 different options for optimizing the .S files for ARMv4T

1) using preprocessor macros for simple opcode translation
2) using globally visible AAPCS-compatible functions for emulating the v5TE instructions (this is where the UNSW tutorial has really come in handy). This is necessary for opcodes that are slightly more complicated, or ones with tricky addressing modes. The GNU preprocessor doesn't really have the capabilities to become a fully fledged scripting language unfortunately.
3) individual, call-by-call changes ... this is the ugly one that I don't really want to touch... but I'm guessing I will have to at some point.

Good luck with your porting efforts!

Chris


Enjoy!

PS: I find black sabbath very useful for putting myself into the 'zone' for programming in ARM assembly.

20081022

Android FreeRunner Updates

Well, I feel as though I've made significant progress in less than one day. I have Android trivially compiling for the ARMv4T / FreeRunner! By saying it compiles 'trivially', i mean that all I've done is remove the ARMv5E instruction extensions and gotten the build process to atually finish without errors. See my post on the android-porting mailing list for further info.

There obviously needs to be a different kernel configuration, but Benno has already done that.

20081021

Hello, Open-Source World!

It's official... Google's brainchild, Android, has finally said
Hello, Open-Source World!

I wonder how many hours it will take for the first Neo 1973 or Neo FreeRunner port to surface. The biggest challenge, it will seem, will be to provide a bridge between the (minimal) ARMv5TE instruction set that Android was designed for, and the OpenMoko handsets' ARMv4T instruction set (as present in the Samsung 2442 SoC).

Perhaps the next handset that OpenMoko releases will feature native ARMv5TE compatibility.

Update: I've been building android for the last few hours, having made a few build-oriented changes that I think will help bridge the ARMv5TE - ARMv4T gap. I'm going to list a few of the errors I've been running into below. Please note - although I only list each undefined instruction once, the errors occur in multiplicity and in different subdirectories. I will post ARMv4T compliant work-arounds soon. Please be patient.

  • bionic/libc/arch-arm/bionic/memcmp.S:44: Error: selected processor does not support `pld [r0,#0]
  • system/core/libpixelflinger/t32cb16blend.S:121: Error: selected processor does not support `smulbb lr,r7,lr'
  • system/core/libpixelflinger/t32cb16blend.S ... Error: selected processor does not support `smulbt ...'
  • external/jpeg/jidctfst.S:148: Error: selected processor does not support `smlabb r0,r2,r3,r5'
  • dalvik/vm/arch/arm/CallEABI.S:239: Error: selected processor does not support `blx ip'
  • dalvik/vm/mterp/out/InterpAsm-armv5.S:2653: Error: selected processor does not support `ldrd r2,[r0,#offStaticField_value]'
  • dalvik/vm/mterp/out/InterpAsm-armv5.S ... Error: selected processor does not support `strd ...'
  • external/sonivox/arm-wt-22k/lib_src/ARM-E_mastergain_gnu.s:77: Error: selected processor does not support `smulwb r4,r4,nGain'
  • external/sonivox/arm-wt-22k/lib_src/ARM-E_voice_gain_gnu.s:114: Error: selected processor does not support `smlawb tmp1,gainLeft,tmp0,tmp1'
  • external/opencore//codecs_v2/audio/aac/dec/src/calc_auto_corr.cpp
    /tmp/ccBi9nUH.s: Assembler messages:
    /tmp/ccBi9nUH.s:652: Error: selected processor does not support `clz r0,ip'
  • smultt, smlatt, smlawt, smulwt, qadd, qsub, qdadd, qdsub, smlabt
  • etc, etc, etc ...
Build problems that were not architecturally related:
  • out/target/product/generic/obj/SHARED_LIBRARIES/libdvm_intermediates/Misc.o: In function `dvmAllocBit': dalvik/vm/Misc.c:247: undefined reference to `ffs'
Theoretically, there are three possibilities to in order to have Android on the FreeRunner.
  • The first is to ] replace [ the red-highlighted mnemonics using an equivalent ARMv4 or ARMv4T instruction sequence. In some cases, this is impossible without a lot of context information.
  • The second is to completely re-implement each section from scratch, wherever one of the ARMv5TE instructions are issued, but using an algorithm optimized for the ARMv4 or ARMv4T architecture
  • The third option is to just remove it, e.g. for the pld instruction which only optimizes memory fetches by hinting (or not?)

20081014

The 2008 Election

It looks as though Canada will again be under a minority conservative regime until we hold our next election. The results of our 2008 election are almost identical to that of 2006 (300 000 000 #$!@#^@!ing dollars later) but with a few notes. Voter turnout was only 59% - the worst in the history of Canada - with only 13832972 of 23401064 registered electors casting a ballot (that does not include unregistered voters). However, I'm happy to see that the Liberals, NDP, Bloc Quebecois, and Green Party managed to prevent a majority conservative government disaster.

It's terribly tragic that Canadians were seduced into voting for the conservative party out of fear for our economic situation - a situation which the conservative party must take a large part of responsibility for. Please let me take this opportunity to apologize to the rest of the world; Canada had her chance to show the world's developing nations how we, the developed nations, deal with environmental issues. By allowing ourselves to continue subjugation to Harper's slippery oil-mafia, we have basically written an environmental cheque that our asses cannot cash.

Green party results by province
ProvinceNumber of Votes%
Alberta1115059
British Columbia1687239
Manitoba317237
New Brunswick226836
Newfoundland32742
Northwest Territories7526
Nova Scotia350228
Nunavut6758
Ontario4114448
Prince Edward Island34885
Quebec1262994
Saskatchewan232796
Yukon188013
Green Votes826747
The size of a metropolitan city...
6%
and we still don't have 1 single seat in the house of commons


I hope that the Harper government acknowledges that poor voter turnout had a huge hand in their minority victory yesterday. There are many Canadians who were unable to make it to the ballot box due to extenuating circumstances - the working class in particular - a huge contrast to Harper's generally upper-class representation. On the other hand, there are probably a lot of Canadians who have such little confidence in our system that they choose not to vote. Some vote because they have not been following the debates.

One thing that was very interesting to observe is that None of the metropolitan cities in Canada (Toronto, Vancouver, Montreal) were won over by the Conservative party. My guess is because we are the ones who primarily have to deal with the smog. People in urban environments are usually have the lesser addiction to oil.

In any event, the Green Party has achieved such an amazing increase in voter turnout from previous years. However, of the ~ 14 million people who voted, ~ 1 million of those voted for the Green Party, yet we still don't have a single seat representing our interests in the House of Commons due to the MP system.

Seriously, we need to reform the way that we vote in this country - why not assign a score to each political candidate instead of voting for a single one? Also, account for "no-shows" and "no-confidence" votes. Mathematically, proportional representation just makes more sense. Account for the loss of power by rural communities by giving rural areas more municipal and regional power, while the interests of the greater public are represented proportionally.

20081006

Linux-2.6.27-rc8 on the EEE 702

Although the Linux kernel version 2.6.27 has not yet been officially released, I was able to download, build and patch release-candidate-8 for my EEE PC with many notable improvements - most notably a working ath5k module. Correction: The Linux kernel version 2.6.27 was released 20081009 and you can read the changes here.

First of all, I was actually planning on using the 2.6.26-gentoo sources, which implemented the changes upstream that I had made for the 2.6.24-eee-r1 sources, because it already had the eeepc-laptop module sources included, and (limited) ath5k support.

However, when I tried to 'modprobe ath5k' with the 2.6.26-gentoo kernel, I encountered a nasty error message saying that the AR2425 chip is still under development (boo-urns!), and that support for the AR2425 chip would be included in the 2.6.27 sources. That made me revert back to my 2.6.24-eee-r1 linux kernel, but not for long!

Having never been the type to accept defeat so easily, I decided to use the vanilla-sources-2.6.27-rc8. The main difference between the vanilla and Gentoo sources are, that the Gentoo kernel sources (and subsequently the eee sources) are patched versions of the vanilla kernel, which include security fixes as well as various other features (SquashFS for example).

Now, I do need SquashFS for my squashed portage, but the security patches I could do without for the time being, until Kernel.org, and Gentoo, release their respective 2.6.27 kernel sources. Aside from that, I would need to compile external modules for the EEE pc, such as uvcvideo (webcam), eeepc-linux (Fan / CPU / FSB control).

Thanks to the inclusion of the eeepc-laptop sources, providing ACPI interfaces for all of the EEE PC Fn buttons, I could now omit the external asus-acpi module, as well as the quasi-proprietary ath_hal module provided with net-wireless/madwifi-ng.

Yes, that's right! Now the Atheros chipset on the EEE PC will work with the standard 'wext' wireless interface, allowing the unpatched version of NetworkManager to run seamlessly!!! Although I have switched to WICD since the last time I tried to use NetworkManager, but I thought I'd mention the changes anyway.

Here are a few patches that might be of interest:
eeepc-linux-2.6.27-rc8.patch
linux-2.6.27-rc8-squashfs3.4.patch
atl2-2.6.27-rc8.patch

All of these will work with sys-kernel/vanilla-sources-2.6.27_rc8.

Enjoy!

20080926

New Overlay for Syscomp Design

I recently used my digital storage oscilloscope and  function generator for the first time since retrieving all of my electronics from storage after returning from Germany. These are really handy devices for examining low-frequency (pre-micro) electronics. After I wrote a couple of ebuilds to install the Open Instrumentation Project software, I thought I'd make the ebuilds publicly available.

Syscomp Design is incidentally run by a former professor of mine from Ryerson, Peter Hiscocks. I thoroughly enjoyed his course on microprocessor / microelectronic interfacing, and luckily did so before he went into early retirement. On a somewhat unrelated note, we're both part of the TLUG :) It's good to see that Prof. Hiscocks is keeping himself busy these days - Syscomp just released a new device that obseletes both of the units I bought 3 years ago! Although he mentioned that the older oscilloscope circuit has more dedicated storage space and time resolution.

If anyone would like to check out the overlay using layman, then you should be able to do it with the following command
layman -o http://virtb.visibleassets.com:2080/layman.conf -a syscomp

After that, you should be able to do the following (as root)
for i in dso101 cgr101 wgm101; do
echo "sci-electronics/$i" >> /etc/portage/package.keywords
done
emerge -av1 dso101 cgr101 wgm101

I've contributed two patches (one for wgm and another cgr) which allow for more flexible storage of the program files in /usr/lib.

Enjoy!

20080919

EEE 702 Has Poor Graphics Performance

I've owned my EEE 8G for quite a long time and also fully customized the software on it as a binary Gentoo distribution. However, one thing that I've found noticeably lacking is the performance of full-screen video. The video device on the EEE is an Intel 915 Mobile Graphics chip, which I believe uses shared memory.

If you know of a way to improve the video framerate of the EEE, then please post your Xorg.conf and related mesa / intel driver versions.

Thane Heins' Demos on 'Back EMF'

The interpretation of the results obtained by Thane Heins are under quite a bit of debate. Many people doubt their own eyes because they seem to think that he's create 'free energy'. Even a prof at MIT is 'stumped'.

Another engineer friend of mine who's well versed in electric motors is going to try to replicate the experiment and hopefully see exactly where the extra energy is coming from. Many people have been able to charge a battery from their self-built apparatus.

Results of search "Thane Heins" on YouTube.com

20080917

My FreeRunner Debug Board v3 Has Arrived


Well, I finally received the Debug Board v3 that I've been hounding Koolu for ever since I received my FreeRunner. The Dboard, as it's sometimes called, provides a JTAG interface to the Neo FreeRunner from OpenMoko / FIC and can also be interfaced with any other ARM device via the unpopulated 20-pin JTAG header at the bottom of the image. I'm particularly interested in trying out BeagleBoard debugging with my Dboard after I build a 20-pin to 14-pin adapter.

It's a good thing that I ordered my Dboard from OpenMoko directly because Koolu has publicly stated that they will not be offering the Debug Board to their customers because the FreeRunner is unbrickable. Although, by assuming that the Debug Board's only use is for bootloader debugging, it precludes all sorts of other uses for the board such as step-debugging with GDB through static firmware images, kernel debugging, or the potential of debugging, say, Android, NetBSD or any other OS.

I'm happy now that I have mine anyway. I hope that they don't stop mass production of the Dboard either, because it might be a more versatile alternative than the FlySwatter, although both offer freely available schematics.

If anyone out there has experience JTAG debugging with both the FlySwatter and the Debug Board v3, then I would be very happy to hear comments detailing the pros and cons of each.

20080915

TS-7800: Linux RAID NAS for the Home User?

Update-20100328: Seeing as how Marvell are essentially the only ARM licensees who have gigabit ethernet technology, this device would decidedly make a really cool control board for the USRP2 from Ettus Research, Inc. Luckily, I've been doing some hacking with libusrp2 lately ;-)

I've had my TS-7800 for quite some time now, and I haven't really done anything fantastic with it yet, although, my original plans were to use it quite suitably as a NAS. The TS-7800 uses the Marvell Feroceon MV88F5182 CPU, and while lacking vector floating point (VFP) support, it is perfect for use as a storage controller.

This would be used by Erin & myself for fault-tolerant storage of important data.

Now, when I say fault-tolerant, I'm speaking of a redundant array of inexpensive disks (RAID). The TS-7800 does not come with a hardware RAID controller, as they are very expensive and usually only found in bulky server equipment, but any linux appliance is perfectly capable of acting as a software RAID controller.

The TS-7800 only supports two SATA connected drives, which means that if I only include these two devices in my software RAID configuration, the RAID level is limited to RAID 0 ("striping", improves speed, no redundant storage), or RAID 1 ("mirroring", data redundancy, slight speed overhead). Of course, I would choose the second option to have our data stored reliably. In that case, my capacity would be half of the total disk capacity.

If I were only including two SATA connected drives in my configuration, my RAID configuration would be limited. However, if I chose to make use of more devices connected via the TS-7800's USB ports, then I could have a RAID 5 configuration (striped, with parity). Just like a RAID 1 configuration, no data is lost if one disk is damaged. Unlike the RAID 1 configuration, rebuilding the damaged disk means more than simply copying the information from the other disk. Furthermore, if I implemented this and mixed SATA / USB disks, then there would surely be a performance hit when reading from / writing to a USB disk, which would slow down the array as a whole since operations would be striped across all disks in a RAID 5 configuration. RAID 5 also performs poorly in software when small files are being repeatedly updated because of the parity calculation requirement.

I think, in the end, I'll choose to use two 500 GB SATA disks, 3.5" in size just because the price is so relatively low, such as these, and start off with a simple RAID 1 configuration. Later on, if I feel the need to upgrade the capacity of the disks, or the raid array itself, I can hopefully buy some more similar disks and connect two more via USB, in spite of the slowdown that it might cause.

20080912

BeagleBoard Notes

My BeagleBoard recently arrived from DigiKey and after resoldering an RS232 connector and downloading the binary images, I was good to go.

If you're planning on only using the BeagleBoard as a USB gadget, connected to a PC, where the PC acts as the USB master, then you do not need to worry about a USB Mini A cable.

If you would like to network the BeagleBoard and a PC through the USB OTG port, then a USB Mini A cable is not necessary. You would use a regular USB Mini B cable which is the type used for most digital cameras.

20080905

Toolchain for the Neo FreeRunner

Well, it's been a while, hasn't it !?

Erin, Jules, & I were all quite busy over the last few weeks - we travelled all over the lower half of Ontario, and then went camping at Bruce Peninsula National Park & on Manintoulin Island.

(Note to self, make Google map containing a trail of our route + photos)

We're now back in Montreal, and it's pretty intense. I have 4 exams coming up in the next 3 weeks and will surely have my hands full for all of them. Hopefully the examination board at the Uni-Kiel allows me to write the exams remotely from Montreal, given my special circumstances (baby, f/t job, etc), so that I don't have an overly-demanding schedule when I return in March / April.

Soooo wie so, I was pleased to receive my new Neo FreeRunner mobile phone when I got back to Montreal. Last week I upgraded the firmware to om2008.8 which has a slick, webkit-based UI. After having used it for a week, I can honestly say that this guy will be the iPhone killer, for anyone who likes to do extreme things with mobile devices at least.

My EEE PC is doing very well, and another one is on the way for Erin. I was hoping that it would get here in time for her birthday, but it seems that there is an 8-10 week shipping delay from the Royal Bank!!! Daaaamn!!!

In a few days, I'm expecting to receive a BeagleBoard in the mail along with a 15.1" touchscreen panel - I can't wait ;-) Then is a cipherlabs 9400 handheld for industrial scanning. I'll be putting linux on that too.

I really have to say, though, that I'm really starting to feel the lack of a graphical package manager for Gentoo-based mobile devices. Seeing how it's my job now to implement a web-based, distributed (pushing) package management system, I don't think it will be very hard for me to implement a mobile (pulling / normal) graphical package manager.

There's another guy on the gentoo-embedded list from Portugal, named Ângelo (a.k.a. miknix), who is also aiming to do the same thing with the HTC Wizard (also a pretty sweet-looking handheld w/ integrated keyboard).

Anyway, if there are any Gentoo users out there who would like to download an i686-pc-linux-gnu -> armv4tl-softfloat-linux-gnueabi cross-toolchain suitable for OpenMoko cross-compilation, then check out my latest toolchain. Please don't forget to read the README file.

I guess the next cross toolchain I come up with will target the armv7a-c6x-linux-gnueabi BeagleBoard, which also happens to have Jazelle Technology (something I have wanted to experiment with for a while!).

20080812

Julien's First Cinema Experience

Last night was a momentus occasion - Julien had his first excursion to a movie theatre. In fact, this one was a drive-in movie theatre! The two films playing were 'The Dark Knight', which is the latest of the Batman series a la Bale and the main feature of the evening, and 'Journey To the Centre of the Earth', which is a poor rendition of a film based on the classic Jules Verne novel of the same name.

For those of you who I may not know in person, my son, Julien, was named after Jules Verne because as a young boy, he was always my favourite author. I remember reading 'Mysterious Island', 'A Journey to the Centre of the Earth', '10 000 Leagues Under the Sea', 'From the Earth to the Moon', and many others before even being presented with the idea of reading for academic purposes in the fourth or fifth grade. Only a few summers ago, I was surprised to find that 'Michael Strogoff' was not the boring novel that I judged it to be as a young boy (based on its cover art alone), but I think now it's actually one of Verne's best novels.

Back to the point at hand, Jules Verne is the so-called namesake of my son Julien, and I thought that it would be a fantastic opportunity to concretize his first film experience with a film based on one of the more famous novels of his namesake.

Jules (mine) actually paid attention to the film for a good 15 minutes before Erin gave him his pre-bedtime snack and laid him down to sleep in the back seat. Unfortunately, the 15 minutes that Julien saw of the film could not have been worse than any other 15 minutes of the film - it was atrocious!! Brenden Frasier, being the only actor of any fame, set a very poor precedent. I would say that the best actor in the entire film was the young nordic girl, whose name escapes me right now.

In any event, it was a 3D movie - which I find incomprehensibly cool - but the drive-in operators didn't give away 3D glasses (arg!), so now I'll most likely buy the film at some point, just so that one day Julien (well... and me too) can buy a pair of 3D glasses and reminisce. I would at least hope that Jules is inspired one day to read some of the classics that I enjoyed when I was a boy.

The latest Batman film, on the other hand, was awesome!

During the evening, the thought occurred to me that drive-in movie theatres are a relic from the past. I wonder if they will even exist any longer when Julien is my age. Even when my father was my age, they were still a relic of the past, having been around since the 50's, when everything began revolving around the automobile. It will make for a fun story to tell him in 10 years.

Anyway, I should get back to work ;-)

20080724

Bin-Ebuilds for Grails, Groovy, Gant, & Eclipse-3.4


Eclipse-3.4 has been out for some time. Unfortunately, the Gentoo-Java maintainer was devaway for a while and couldn't make an ebuild to build Eclipse-3.4 from source. Hence Gentoo bug #229609.

I say "to hell with building Eclipse from source" ... especially not for me, being an EEE PC user :)

For those who would just like the binary package for Eclipse 3.4 (eclipse-sdk-bin), and for those who may also be interested in groovy-bin, grails-bin, or gant-bin, try this out:
echo "dev-portage/eclipse-sdk-bin" >> /etc/portage/package.keywords
PORTAGE_BINHOST="http://virtb.visibleassets.com:2080/geeentoo/packages/All" \
FEATURES="getbinpkg" \
emerge -Kav1 =dev-util/eclipse-sdk-bin-3.4
For installing dev-java/grails-bin, dev-java/groovy-bin, or dev-java/gant-bin simply substitute the package name in the commands above.

Note: dev-java/grails-bin already contains precompiled Gant and Groovy jars, in order to run grails, but it doesn't support Groovy or Gant from the command line. If you need a command-line Groovy or Gant, then install groovy-bin or gant-bin as well.

As usual, you can download any of my Portage overlays with the command below (requires app-portage/layman).
layman -o http://virtb.visibleassets.com:2080/layman.conf -L -v --nocolor | less
Then use the '/' search function of the pager application 'less' to look for the string 'virtb' and you should be able to see my repositories. I guess for security purposes, and the fact that mine are not official gentoo overlays, they are not displayed by default unless you specify the '-v' option to layman.

You can add the overlay with
layman -o http://virtb.visibleassets.com:2080/layman.conf -a [overlayName]
Currently, overlayName can be one of "vuze-bin, eclipse, grails-groovy-gant, eee". If you'd like to check out any of my other overlays (mainly for ARM development), try using http://vaiprime.visibleassets.com/~cfriedt/layman.conf .

Debugging Groovy / Grails Apps in Eclipse

I finally found a page with some information on how to properly set up debugging in Eclipse for Groovy / Grails applications.

It was seriously painful to write a Grails app beforehand -  I hope this makes up for all of the time I've wasted restarting the app when I modified Service code.

Note to self:
  1. Try your damndest to get debugging in eclipse working
  2. Do more with Junit / Grails test cases
  3. If neither of those work - do it without Eclipse :)

20080721

Gentoo / EEE PC - Black Screen on Resume

I have been struggling with a bit of a productivity problem involving my EEE PC - I can't resume after suspending to ram (i.e. ACPI S3 sleep). All that I get is a black screen. I wish I had another machine to use to SSH in to the EEE, but my old work laptop has once again died. That is entirely another story but basically revolves around poor quality.

Using the ACPI S3 sleep state is actually not an uncommon problem with Linux end users, particularly the non-Ubuntu brand. I have to hand it to Ubuntu in that almost every machine I've ever owned has been properly detected and configured automatically. Getting a bug fixed is a bit more difficult, but whatever.

As many of you know, I use Gentoo almost exclusively on my EEE and Gentoo is historically one of the most difficult platforms to tweak. Gentoo has started offering only stage3 tarballs to get users off to a start, but when I began with Gentoo, they offered stage1 and stage2 tarballs, where building the compiler and baselayout from scratch was part of the installation routine.

The next generation of Gentoo-based distros sometimes offer what is called a stage4 tarball. A stage4 tarball is an entire pre-compiled root image and desktop environment, plus all of the tweaks and additional software necessary to exploit all of the capabilities of the hardware.

In my opinion, the stage4 scene is really lacking with Gentoo. Likewise with binary packaging. If there was a stage4 tarball publicly available for the EEE PC, then there would be thousands more users converted over, I'm sure. The same goes for the Maemo devices. The entire ultra-portable market is full of hardware that has unique specifications and tweaks. If Linux distributions don't start packaging the tweaks, then they'll find themselves falling behind the competition.

So far, I've found a few sites that have clearly explained things relating to building software for the EEE PC - one is by Nathan Coulson, and the other two are slightly outdated.

So the EEE PC model 702 (8GB SSD) has an intel 915 mobile graphics controller on the PCI bus. I would assume that this is the root of the issue when it comes to restoring the black screen after suspend / resume.

I've tried vbetool and saving / restoring /proc/bus/pci/00/02.0 to /tmp/video_state, but neither of those approaches has fixed the problem. Some Gentoo users have reported that the hibernate script works by default so that is my next option to try that out.

I thought I'd post the issue here - if you have any suggestions, please feel free to comment.

In the mean time, I wanted to post my eee overlay. Note that many things with linux-2.6.26 already obselete what is in the overlay, such as the atheros driver, atl2, all of the EEE PC platform-specific fixups, etc. Here is a pretty comprehensive 2.6.26 changelog.

If you feel like using my eee overlay, then you can either directly download the tarball or use layman with
layman -o http://virtb.visibleassets.com:2080/layman.conf -a eee
The overlay contains:
  • sys-kernel
    • asus-acpi (asus acpi module for /proc/acpi/asus)
    • eee-sources (The same patches for 2.6.23 brought forward to 2.6.24)
    • eeepc-linux (the eee module which allows users to overclock their FSB)
  • net-wireless
    • madwifi-ng (atheros madwifi driver)
    • madwifi-ng-tools (tools specifically for the driver)
  • app-laptop
    • eee-acpi (a collection of scripts for acpi events - currently only eee-suspend and eee-video are disabled)
  • x11-apps
    • asusosd (ASUS On-Screen-Display for hotkey events)

Aside from the overlay, I also have a binary package repository at http://virtb.visibleassets.com:2080/geeentoo/packages/All . If you feel like using any of my binary packages, then prefix your emerge command with:
export ACCEPT_KEYWORDS="**"
export EMERGE_DEFAULT_OPTS="-K"

export PORTAGE_BINHOST="http://virtb.visibleassets.com:2080/geeentoo/packages/All"
export FEATURES="getbinpkg"
emerge -av1 asusosd

Please help fix my Black-Screen-Of-Death !!

20080718

Last.fm has adopted a new UI :) I like it - hopefully it doesn't have to do full page refreshes nearly as much as the last one!!

Hopefully they didn't decide to use Grails on their site - I'm using it right now, and I hate it - Grails sucks balls (IMHO).

20080712

Dell Laser Printer 1700 Setup in Gentoo Linux

It took me approximately 1/2 hour this morning to install the Dell Laser Printer 1700 under Gnome using gnome-cups-manager.
The page at linuxprinting.org was helpful in that it said to use the 'generic PCL6 driver'. Ensure that your /usr/src/linux/.config contains CONFIG_USB_PRINTER=[m|y] CONFIG_USB_SUPPORT=[m|y] CONFIG_USB=[m|y] In my kernel CONFIG_USB=y and CONFIG_USB_SUPPORT=y, but CONFIG_USB_PRINTER=m In /usr/src/linux, run make && make modules_install if necessary. Run 'modprobe usblp' Ensure that cups, gutenprint, and gnome-cups-manager are emerged. My USE="cups foomaticdb gtk ppds readline gimp X acl avahi dbus java jpeg ldap pam perl png ppds python samba ssl tiff zeroconf" but feel free to alter that, although in doing so, your mileage may vary. Now, if you power on your Dell Laser Printer 1700 and plug it in to your computer via USB, monitor the last few lines of dmesg with dmesg | tail -n 50 and you should see something like: usblp0: USB Bidirectional printer dev 2 if 0 alt 0 proto 2 vid 0x413C pid 0x5202 usbcore: registered new interface driver usblp Running 'lsusb' should report something like Bus 003 Device 002: ID 413c:5202 Dell Computer Corp. Go to System -> Administration -> Printing -> New Printer Select 'Use Detected Printer', then for Manufacturer use Generic, for Model use PCL 6/PCL XL Printer, and for Driver use 'gutenprint'. Now just ensure that the default paper size is Letter and print a test page. I should also mention that the default paper size was originally set to A4, which is more of a European standard. Subsequently, when I printed a test page I received a page that said PCL XL error Subsystem: KERNEL Error: IllegalTag Operator: 0x2d Position: 6986 However, adjusting the paper size to Letter inside the printer properties fixed this issue. Happy Printing :)

20080710

VAI Prime Overlays Accessible Via Layman


After making my vuze-bin overlay accessible via layman, I decided to apply the same approach to my ts72xx related overlays on VAI Prime.

You can see the overlays via layman with

layman -o http://vaiprime.visibleassets.com/~cfriedt/layman.conf -i [overlay-name]

So far, the available overlay-names are as follows:

  • jvmcp (Miniaturized Java environment suitable for the ts72xx boards)
    • custom JamVM (1.5.1)
    • custom GNU Classpath (0.97.1)
  • vai (mainly custom apps for the ts72xx)
    • custom JamVM (1.5.1)
    • custom GNU Classpath (0.97.1)
    • custom battery monitor
  • maverick (overlays necessary for creating a EABI/MaverickCrunch toolchain for the ts72xx)
    • patched binutils
    • patched gcc
    • patched crossdev
    • patched uclibc
  • ts72xx (overlay of applications for the ts72xx)
    • patched fastjar
    • patched busybox
    • patched screen
    • patched portage-utils
    • patched bash
    • patched java-config
    • patched jamvm
    • patched rxtx
    • patched ant-core
    • patched ant-eclipse-ecj
    • patched eclipse-ecj
    • patched gnu-classpath
    • patched mpfr
    • patched nfs-utils
    • patched libnfsidmap
    • patched openvpn
    • patched dropbear
    • patched wpa_supplicant
    • patched binutils (2.15)
    • patched gcc (3.4.6
    • patched db
    • patched psmisc
  • ts72xxtc (binary-compatible toolchain for factory TS filesystem)
    • patched glibc
    • patched linux-headers
It would probably be wise to move at least the binutils and gcc from ts72xx to ts27xxtc.

Anyway, check out the overlay with

layman -o http://vaiprime.visibleassets.com/~cfriedt/layman.conf

20080709

How To Use Gmail's Trash Folder With Thunderbird Via IMAP

If you've decided to use Thunderbird to access your Gmail account via IMAP, then you might have run into the Trash problem - deleted items are sent to a new [Imap]/Trash folder, or just Trash, instead of the [Gmail]/Trash folder.

This article describes how to fix the problem.

20080708

Prebootmisc for the EEE

I thought I would share a few more of my tricks for utilizing as much of the RAM on my EEE as possible in order to spare the flash memory from excessive write cycles.

So here they are!

In order to minimize writes to flash I would advise adding this line to your /etc/fstab:
tmpfs /tmp tmpfs nodev,nosuid,noexec 0 0
Accordingly, to utilize the ram-based filesystem in /tmp, you can also make some adjustments to portage in /etc/make.conf:
PKGDIR="/tmp/binpkgs"
PORTAGE_TMPDIR="/tmp"
DISTDIR="/tmp/distdir"
Now, in order to prevent certain daemons and applications from vomiting all over you on boot, it's necessary to build a bit of structure in /tmp that such apps expect to find. For that we'll need an init.d entry that starts right after the local filesystems are mounted, but before anything else!

/etc/init.d/prebootmisc:
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
need localmount
before logger
before bootmisc
}

start() {
ebegin "Starting prebootmisc"

if [[ -e /etc/conf.d/prebootmisc.start ]] ; then
source /etc/conf.d/prebootmisc.start
fi

eend $? "Failed to start prebootmisc"
}

stop() {
ebegin "Stopping prebootmisc"

if [[ -e /etc/conf.d/prebootmisc.stop ]] ; then
source /etc/conf.d/prebootmisc.stop
fi

eend $? "Failed to stop prebootmisc"
}


# vim:ts=4
/etc/conf.d/prebootmisc.start:
if [ ! -h /var/cache/edb ]; then
rm -Rf /var/cache/edb && cd /var/cache && ln -sf ../../tmp/cache/edb edb
fi
mkdir -p /tmp/cache/edb
mkdir -p /tmp/{portage,binpkgs,distdir}
if [ ! -h /var/log ]; then
rm -Rf /var/log && cd /var && ln -sf ../tmp/log log
fi
mkdir -p /tmp/log/{gdm,samba,sandbox,news,cups}
Now just run the following commands to add prebootmisc to the boot runlevel
chmod +x /etc/init.d/prebootmisc
rc-update add prebootmisc boot
There is 1 catch that I've found after months of use - if your bootmisc is set to WIPE_TMP (wipe_tmp for openrc users), then it will destroy the directory structure that prebootmisc created. My suggestions are 1) disable wipe_tmp which is useless anyway if /tmp is a ram filesystem, 2) rename the service postbootmisc and change depends to have after bootmisc, if you really want /tmp to be wiped before it is mounted tmpfs.

After rebooting the machine you should find that many applications run faster and do much fewer write cycles to flash, preserving the longevity of your flash root filesystem.

To get Firefox to utilize /tmp as your cache (you will lose your cache after /tmp is unmounted), open firefox, navigate to about:config, and set this line:
browser.cache.disk.parent_directory /tmp
If you're a gnome user, you might also find it helpful to add the System Monitor applet to your panel and activate the disk monitor utility. I've changed my read indicator to a safe green colour and my write indicator to red. That way, whenever I'm using an application that is abusing my flash filesystem I'll see a red spike in the System monitor and I'll I know that I'll have to adjust the preferences for that app to use /tmp.

I hope this has helped speed up applications and spare the life of your flash and speed up your EEE!

Geeentoo Binary Package Repository

If anyone is also using an Asus EEE with Gentoo instead of the default Xandros operating system, feel free to use the binary package repository that I have set up here .

I'm going to try my best to put together some documentation about how I arrange my EEE PC, providing /etc/portage/{package,savedconfig}*, /etc/make.conf, /etc/init.d/portage_squashfs, etc. Although right now the documentation will probably consist of a static html page with links to the Gentoo Wiki and other places.

My eventual plans for the EEE are to get a full-blown GRP (Gentoo Reference Platform) set up on it, to create a stage4 for Geeentoo, and then of course to do hardware modifications :)

Planned modifications include:
Maybe I'll turn the static html page into some kind of RSS feed just to make people's lives easier.

In any event - stay posted!!

20080707

Running C and Python Code on The Web

Although I'm not a big fan of programming or web applications, this post sounds quite interesting.

20080622

Vuze-bin Overlay for the Gentoo Community


I thought I'd make my Vuze ebuild available to the rest of the world. Vuze (formerly Azureus before version 3.1.0.0) is the name of a pretty great Java BitTorrent client. This overlay contains ebuilds, launchers, and .desktop entries file for installing vuze-bin-3.1.0.0 and vuze-bin-3.1.1.0 .

Download the overlay here

Don't forget to check the md5sum with 'md5sum vuze_overlay.tar.bz2'. The md5 sum should be 9fc2955cb63a1404f1a35643b38d8085.

To install vuze-bin you have two options,

1) If you are not using layman

mkdir -p /usr/local/portage/vuze_overlay && \
wget -O - http://virtb.visibleassets.com:2080/vuze_overlay.tar.bz2 | \
tar xpvjf - -C /usr/local/portage/vuze_overlay
&& \
ACCEPT_KEYWORDS="~x86" \
PORTDIR_OVERLAY=/usr/local/portage/vuze_overlay \
emerge -av1 vuze-bin
2) If you're using layman (thanks to Donnie Berkholz)
layman -o http://virtb.visibleassets.com:2080/layman.conf -a vuze-bin

Enjoy!

20080611

How-To: The Full Portage Tree on the EEE PC




Gentoo is often considered to be 'bloated' because the Portage tree takes up at least 500 MB on disk. Depending on the filesystem, that could mean that the usage can be sometimes up to 750 MB!

On a UMPC such as the EEE, with only very limited hard-disk space, 750 MB is far over the limit of acceptibility.

My first solution was simply to use a binary Gentoo system. The portage tree was not necessary as long as an internet connection was available and a suitable binary package repository was configured. That has actually been working incredibly well and I have no complaints yet whatsoever. However, I do occasionally like to look into the portage tree for examples on creating ebuilds when I'm doing custom software packaging, so i thought it would be nice to have it wherever I can take my EEE.

Then someone on EEE-User mentioned using SquashFS for the Portage tree. This made absolute sense, because the Portage tree did not need to be updated frequently at all, and could easily be made read only. SquashFS enabled me to have the benefits of a source-based Gentoo distribution on my EEE but compressed the Portage tree from 700 MB to 42 MB !!!

The following 5 steps will demonstrate how easy it is to use Gentoo - even with it's "bloated" Portage tree - on the EEE PC.

Note: I performed these steps on a modified EEE PC with 2GB of physical RAM, which explains how I could mount 768MB of RAM as tmpfs. If you have less than 2GB of physical RAM, then I would suggest making the SquashFS Portage image on a regular desktop computer running Gentoo Linux.

Step 1: Find a portage mirror
You can find all of the Gentoo mirrors on the official Gentoo mirror list. I use


MIRROR="http://gentoo.mirrors.tera-byte.com"


Step 2: Install squashfs-tools


emerge -av1 squashfs-tools


Step 3: Download and Extract the Latest Portage Snapshot

mkdir -p /tmp/tmp2
mount -o size=768m -t tmpfs none /tmp/tmp2
wget -O - "${MIRROR}"/snapshots/portage-latest.tar.bz2 | tar xpvjf - -C /tmp/tmp2

Step 4: Create the SquashFS Image


mksquashfs /tmp/tmp2/portage /tmp/tmp2/portage.sqfs
mv /tmp/tmp2/portage.sqfs /usr

umount /tmp/tmp2
rmdir /tmp/tmp2

Step 5: Create init.d and conf.d entries to simplify or automate mounting

/etc/init.d/portage-squashfs:

#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
need localmount
}

checkopts() {
for var in "${MTPNT}"x "${PSQFS}"x; do
if [ "${var}" = "x" ]; then
eerror "one of the necessary variables was not defined"
return 1
fi
done

if [ "$(grep "squashfs" /proc/filesystems)" = "" ]; then
eerror "SquashFS is not supported by your kernel"
return 1
fi
if [ ! -e "${PSQFS}" ]; then
eerror "${PSQFS}: No such file or directory"
return 1
fi
if [ ! -d "${MTPNT}" ]; then
eerror "${MTPNT}: No such file or directory"
return 1
fi
}

start() {
local mtopts="-t squashfs -o loop,ro"

einfo "mounting ${PSQFS} at ${MTPNT}"
checkopts || ( eend 1; return 1 )
mount ${mtopts} ${PSQFS} ${MTPNT}
eend $?
}

stop() {
einfo "unmounting ${MTPNT}"
umount ${MTPNT}
}

# vim:ts=4


/etc/conf.d/portage-squashfs:

MTPNT=/usr/portage
PSQFS=/usr/portage.sqfs
Lastly, don't forget to make the init script runnable:

chmod +x /etc/init.d/portage-squashfs


Notes:

Extracting the portage tree and creating the SquashFS image in /tmp will work only if you have >= 1GB of RAM, approximately. I was using the EEE PC 8G, which comes with 1GB of RAM and there were no problems at all. Alternatively, if you have >= 800MB on your root device, then you could perform the operation there, but it would be much slower. If another desktop or laptop PC is available, a better alternative is to build the portage.sqfs file on the other machine and then copy it on to your EEE.

Also, it should go without saying that you will need to have root permissions to do this - use 'sudo -s'

You should also be aware, that this will make /usr/portage read-only. Therefore, in /etc/make.conf, set DISTDIR="/tmp/distdir" and PKGDIR="/tmp/binpkgs", or something similar.

20080603

Why Don't Manufacturers Build Mobile Phones to Last?

I bought a Motorola L2 14 months ago from a Fido store in Toronto - I was quite happy with it, considering that all I really ever want in a cellular phone is the ability to talk. The L2, although nothing special by today's standards, was a major step up for me because it had a colour LCD (Wow!!). Aside from that, it was my first major introduction to Google Mobile applications, such as Gmail and Google Maps. I was quite satisfied with the Motorola L2 - until the keys became completely unresponsive! Yes, only 2 months after the warranty had expired, the keys became fully unresponsive! I brought the device back to the nearest Fido outlet and they said it was most likely a short circuit they would not replace the handset, understandably, but also would not repair it. My L2 had not done much more than sit on a desk for the year that I owned it. Usually I used it for little more than a watch! It never got wet or experienced a single fall! Maybe dust was an issue, but it really shouldn't be.




In my opinion, if portable electronics are not built to last, then the manufacturers should be providing either recycling or repair facilities directly to the consumer. There are an estimated 130 million mobile phones disposed of annually in the U.S. alone!
In many cases, a large portion of the mobile phones depicted left were probably fully functional when they were disposed of. In many other cases, a replacement part is all that's necessary to restore the phone to its original fully working state.

I fell back to my previous mobile and it works marvellously!! That was a much more modest device - a DRASTICALLY more modest device than what is common by todays standards. It was a Siemen's A56, with a monochrome display ;-) These sort of devices were built to last !!

Oddly enough, you never see mobiles like this being sold in North America anymore, because the retailers have told us that we need colour LCDs, with games and cameras, and iTunes built-in. But if the phone doesn't work as a phone, what good is the rest?

The Siemen's should be fine for me until the OpenMoko / eo1973 GTA2 is being sold to the general public.

20080523

Improperly Credited Article on Slashdot

Slashdot is a funny place - don't get me wrong, I love to read it. The only problem I've ever had with it is that they edited the OpenMoko article I wrote on their site, and now someone else is claiming to have written it (kdawson).

Originally when I wrote the article, it was credited to 'Anonymous Coward'. I did that on purpose so that I wouldn't make anyone in the OpenMoko community offended, seeing as how they may have wanted to make a post themselves. I just wanted to beat them to it!

In my opinion, the article should have remained credited to 'Anonymous Coward' as opposed to kdawson, whoever the hell that is. Apparently kdawson believes that it is completely fine to assign credit of a work to someone who had nothing to do with the work at all.

What I find even funnier, is that I made a comment to the post I wrote only a week after noticing it was no longer attributed to 'Anonymous Coward'. Then the editors changed it back. Now, approximately 6 months later, someone else has again inappropriately taken credit for another's work.

What's the lesson in all of this? Always post under your real name if you intend to have something show up in the slashdot headlines. I guess I shouldn't feel bad then for copying the Slashdot logo to use with this post :)

A Baby New World


We have a new baby boy!
After a long night of bowling (hoping that would inspire Julien to pop out naturally) with my dad, Wendy, Nora and myself, Erin was called in to have labour induced at about 9:30 PM on Monday the 19th. Erin & I went for a little walk in the park (she was actually biking) to give each other pep-talks - are we ready for this? - and then Bo drove us all over to St. Mary's.

Erin was put on a hormone drip intravenously, which was increased by 6 μg every 1/2 hour. She wasn't feeling any contractions for about 5 hours and was only 1 cm dialated. We were up all night just keeping each other company (Bo, Nora, Erin & I) by playing games, telling stories, etc. Actually, we were only allowed to have 3 people in the room in total, but the nursing staff was very nice and let us all be there. Another nurse came in and boosted our hopes saying that she was 1 1/2 cm dilated. To tell you the truth, we were a little worried that Erin was going to need a caesarian section performed because she was at the maximum drip for a while and there were no signs of progress. Every time they examined Erin, they noticed that Julien's head was really far down, and that he was ready, but Erin had still not started to dilate. Actually 3 or 4 examinations had gone by with exactly the same results.

Then, Erin started getting contractions - she thought it was just indigestion at first, but then they became more and more intense. We all started helping Erin with Le Mas breathing patterns. A doctor came in to puncture Erin's membrane (i.e. water) and as she was lying down so that they could put an internal sensor on Julien to get his heart beat.

After that, contractions became more frequent and increasingly painful. Erin was lying down for them and she was in so much pain. We were all massaging her and practicing the breating. The nurses kept asking her to stop pushing, but she wasn't pushing at all -
I think it must have been the hormones that were causing the contractions to be so intense that they were just pushing the baby along all by themselves. Erin started to lose coherence because the pain was so intense, and then I said - "Erin, breath like your mom - just watch how your mom is breathing, and do it like mom does ok?" Bo jumped right in and was like the breathing coach. She sat Erin up, and told her when to hold it, when to inhale, and when to exhale. They had such a strong connection. After sitting up, and holding her breath for a second or two like Bo, Erin said that the contractions started coming under control after about 20 minutes.

Between about 5:30 AM and 9:00 AM she went about 2cm every hour, which is twice as fast as normal! She went from 2 cm dilated to 10 within about 2 hours - it was unbelievable! Bo was helping Erin keep the contractions under control while Nora and I were massaging Erin's back and legs. Nora & I waited outside while Erin received her epidural. The anesthesiologist had to really tell me to get out of the room because I wasn't fully prepared to leave Erin there, but she saw that Bo was helping Erin's breathing, and Erin asked if it was ok for her mom to stay there. So Bo got a mask on and helped Erin while she had the epidural.

After that, it literally took 5 pushes and about 20 minutes - things moved so quickly! Nora graciously stayed in the waiting room because they would only let Bo & I be there for the delivery. We were standing right there helping Erin along as she pushed, and then... well ... I don't think there are any words to describe the euphoria that we were all experiencing and even if there were I doubt that I could do it justice. I will never forget as long as I live.

Julien Michael Jacob Friedt was born on Tuesday, May 20th at 10:48 AM. He
weighed 8 lbs and 5 ounces at birth. He's totally healthy and scored a solid 9.9 on whatever test it is that they use. Labour lasted about 8 hours.

We got to hold him and talk to him immediately. I cut the cord. He was so real - it was so hard to believe what I just experienced happened - but at the same time, it was like we knew eachother all along. He recognized immediately when I started playing with his feet, just like when he was in his mom.

My dad came to visit right afterwards and they got to say hello to little Julien. Then we were moved to a bed in another wing for the next 48 hours. I was a little detached from the world because we weren't allowed to use cellular phones in the hospital, and they don't have public internet access anywhere inside. I only really left the hospital once or twice to get some food and necessities.

Bo & Nora were really helpful for those 48 hours while Erin & the baby were under supervision. Me? I was having the time of my life playing with my new little boy. He's so alert and inquisitive and incredibly well behaved... oh and he's just CRAZY cute!! hahaha...

When we were finally dischared to go home, stepping out of the hospital with my son was like stepping into a wholly different world.

It's been really nice being back home. We've had a few visitors already and lots of support from family and friends with phone calls, SMS, or even e-mails.

Soon we'll have lots of pics posted on facebook or picassa.

20080513

Julien Updates

Yesterday, Erin, Bo, Julien & myself had a nice long day at various doctor's offices. First thing in the morning we went to Dr. Shine's office and he said that Erin still isn't dilating, so we booked an appointment to have Julien induced next Monday. Then we went to the women's pavilion at St. Mary's and waited around for a while to get a stress test done on Julien & Erin. The test checks the baby's heart rate, movement and Erin's contractions. The baby showed textbook-perfect patterns for his heart rate, so we know that he's doing well and he's healthy and comfortable. On the other hand, Erin still hasn't had any contractions that she's noticed. So since Julien is already 4 days late, and it's bad if the baby is any more than 2 weeks late, and we can only book induction mondays or wednesdays, we thought it was probably safer than not to book it for next monday. I'll have more updates later on.

Today for lunch Erin & I are going to pick up some peppermint & tarragon for the planters on our balcony. So far, we have basil, greek oregano, spearmint, savory, and rosemary. On the weekend we also picked up a set of chairs and table for the front balcony and a couple of reclining / folding chairs for the back balcony (or for taking into the park).
I'll put up some photos eventually of the front balcony with a view of the park & our little hanging garden at some point.

Cheers!