The world of Zaurus software is split in two. This quick hack makes it easier to hand-install OPIE-based packages when using a Sharp-based ROM (once you get Perl installed). It just extracts files from an OPIE-based package file ('ar' format?).

#!/usr/bin/perl -w use strict; my $line= <>; die "Not a Debian archive.$/" if "!<arch>$/" ne $line; while( defined( $line= <> ) ) { next if $/ eq $line; my( $name, $size )= ( split ' ', $line )[0,-2]; $name =~ s-/$--; if( -e $name ) { warn "Saving $name as $name.tmp$/"; $name .= '.tmp'; } open OUT, "> $name" or die "Can't create $name: $!$/"; warn "Writing $name ...$/"; local( $/ )= \4096; while( $size ) { $/= \$size if $size < ${$/}; print OUT <>.''; $size -= ${$/}; } close OUT or warn "Error closing $name: $!$/"; }

Just 'dx file.ipk' to extract the files into your current directory.

...though my original method that combined the Zaurus versions of head, tail, dd (which are all quite limited), and several by-hand iterations including copy'n'pasting sizes was rather fun...

- tye        

Replies are listed 'Best First'.
Re: Installing Zaurus software
by theorbtwo (Prior) on Aug 30, 2004 at 13:10 UTC

    Assuming those are, in fact, more-or-less current Debian packages, they should be an ar archive, with two (gz-compressed) tarballs and a file that has no purpose other then to provide a nice magic number. They were designed to be easy to process with nothing but standard UNIX tools. It looks like this just splits out the ar archive. That should produce three files. debian-binary is there just to function as a magic number. control.tar.gz is metadata -- including a script (normaly sh or bash) that should be run on install, but you can probably ignore the whole file for your purposes. You may want to consider extending this to untar data.tar.gz and just ignore the two other files.


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      It was a quick hack. And I don't ignore the control archive since it can contain scripts that do important steps.

      For the next step, I'd teach this script to extract one named file to stdout and write another script that used it to perform the common steps (thus saving disk space, which is often in short supply on a Zaurus):

      • List non-directories in either archive
      • Pipe all control files to 'more'
      • Extract the data (or control) archive 'here'
      • Become root and extract data to / or /home
      • Extract a named file from data archive to 'here' or (as root) to named directory

      But instead I'm ordering a CF RAM card so I can switch to the OpenZaurus ROM.

      - tye