June 14th, 2009

How do you cp -a, omitting certain directories

Ok, so I'm trying to move / filesystem from zaurus to G1. That should be as easy as cp -a --one-file-system / /mnt/sdcard ... right?

No, that would be too easy, zaurus is full of kernel sources, and sdcard is too small. cp must have --exclude option ... right?

Wrong, unfortunately. It has many options, but excluding subtree is not there. I did a dirty hack -- mount /dev/zero -t proc /usr/src ... is there better solution?

Zaurus clock workarounds

Sharp Zaurus c-3000 (aka spitz) is pretty good machine. Basically small linux system with arm cpu; able to self-compile kernel in cca 3 hours. So far so good. It lacks mouse, making copy&paste hard, but...

Mine seems to have some stability problems... maybe bad RAM or something? If I leave it sleeping for 8 hours, it will be probably dead; sometimes it wakes with corrupted memory, and I seen corruption during run-time, too (miscompiled kernel). I'm not sure if other spitzes have that problem; collie was/is rock solid.

So I need to reboot from time to time, usually at least twice a day.

Unfortunately, it seems to lack rtc clock, too. And that means time going backwards, and that means all the hell breaking loose. Like 5 minutes recompile after single file changed turning into 3 hour rebuild or worse.

I have created a script that verifies if time of day is later than timestamp on disk, adjusts time of day when it is not, and writes new timestamp. I run it from cron each minute... that seems to work, mostly, but... is there a better solution?

Did all the old unix machines have reliable time of day sources?