joseph's blog

tsrpmv now does diffs, install-time dependency resolution

There are a couple of new features in the latest version of tsrpmv, available at https://www.timesys.com/blog_files/tsrpmv. I added the --diff option to scratch one of my own itches and added install-time dependency resolution to satisfy a customer request.

Free Memory by dropping caches

I found this cool tip today from Avishay Traeger at linux-mm.org about how to free memory by dropping the system caches.

Kernels 2.6.16 and newer provide a mechanism to have the kernel drop the page cache and/or inode and dentry caches on command, which can help free up a lot of memory. Now you can throw away that script that allocated a ton of memory just to get rid of the cache...

To use /proc/sys/vm/drop_caches, just echo a number to it.

To free pagecache:

# echo 1 > /proc/sys/vm/drop_caches

Google Chrome - a better embedded linux browser?

While Google Chrome's Linux build instructions state that all that runs is a command-line "all tests pass" executable, can a small-footprint yet full-featured linux-based browser suitable for embedded use be far off?

I hope not.

Intel acquires OpenedHand: good news for TimeSys

The announcement today that Intel has acquired Opened Hand is good news for anyone building a multimedia appliance with LinuxLink.

tsrpmv: making tsrpm easier

I use tsrpm a lot but find its output hard to interpret and it's invocation difficult to remember. Additionally I was always passing options to tsrpm like --verbose, so I wrote a wrapper script to automatically add that to any tsrpm command. I call the script tsrpmv, short for tsrpm verbose. It can be downloaded from http://www.timesys.com/blog_files/tsrpmv. Mark it executable and place it in /opt/timesys/bin.

TSRPM and %pre/%post scripts

RPM packages will many times have %pre or %post scripts embedded in them. These scripts are supposed to be run before or afte the package is installed or upgraded and do things like set up specific configurations.

When creating an RFS, tsrpm can't run these scripts perfectly because your RFS is for a different architecture and those programs won't execute natively on your x86 host. So tsrpm tries to execute a native version, telling it to operate inside the RFS if it can. This process is problematic and doesn't always work.

checking RPM dependencies quickly

tsrpm is great for cross-compiling but because it is implemented primarily as a bunch of perl scripts, it handles certain tasks slowly. One of those tasks is dependency checking.

Dependencies can be just as easily checked using plain vanilla rpm. Put all the RPM files you want in your RFS inside a directory and run this on the command line to check for missing dependencies:

$ rpm -Uvh --test --ignorearch *.rpm

Getting RPMs using wget

I have a machine at my desk that's mainly for administrative tasks (GUI, browsing, e-mail, etc.) and a different machine that's purely dedicated to development. I generally ssh from my main box to my dev box, and don't like to keep a GUI or a browser on that box at all.

building debug RPM packages

Occasionally programs crash and the only way to debug them is under a debugger such as gdb. Of course, gdb needs debug symbols and both standard gcc compilation commands and RPM packaging strip debug symbols. Here's how to get around that.

You can normally tell gcc to add debug symbols by adding -g to the gcc command line, such as in CFLAGS. This doesn't work all the time; when rebuilding the python RPM I had to change

make OPT="$CFLAGS" %{?_smp_mflags}

to

Which RPM?

It's not unusual for developers, including those at TimeSys, to forget which rpm contains which file or library. It happens to me, often when I try to install some packages and rpm can't find the dependencies.

Here's a little script that checks RPMs to see which one provides something you need. It's called whichrpm and you call it like this:

$ whichrpm libcrypto.so.6

at which point it dutifully prints out:

..........[lots of dots means it is searching]
openssl-0.9.8a-5.2.armv5l.rpm:
libcrypto.so.6

Syndicate content