Tuesday, September 2, 2008

Re: [BLUG] Amarok

On Tue, Sep 02, 2008 at 11:17:38AM -0400, Michel Salim wrote:
> On Tue, Sep 2, 2008 at 10:35 AM, Shei, Shing-Shong <shei@cs.indiana.edu> wrote:
> > Make sure that your UID is consistent between these two; i.e., if
> > you create an account foo on both distro's, the UID on both distro's
> > should be the same. The tricky part is that the program you compiled
> > on distro 1 (and put in /home/foo/bin) might use different shared libraries
> > than the one on distro 2. In this case, the program can only be run on
> > distro 1 but not distro 2.
> >
> So anything in ~/bin should preferably be architecture-independent
> scripts, or statically-compiled binaries. Of course, that won't help
> you if /home is shared between two different architectures
> (i386/x86_64 and ppc, perhaps)

You can have a totally shared /home with multiple platforms, you just
need to be trickier.

You can use `uname -p` and `uname -o` to get the basic processor and
operating system information. (Though note that you can be x86 and have
a number of potential options for "uname -p". Ex. A distribution which
supports 386's may report i386.)

Provided you actually install lsb-release (or whatever package contains
lsb_release) you can reliably get the distribution information using
`lsb_release -si` and `lsb_release -sr` (or `lsb_release -sc`).

Using this information you should be able to generate some unique key
value for your setup. You would then have a ~/bin with the universal
scripts, and have sets of ~/my/SOMEKEY directories which mirror the
structure of /usr. You could then have a ~/my/src directory and use that
to generate a ~/my/SOMEKEY/stow directory, and use GNU Stow to handle
versioning.

All it requires is setting some information in your ~/.profile to assign
the correct environment variables. Once you have the platform key you'll
be using, that should be relatively straight-forward.

> Perhaps you can get by with compiling against a pre-defined LSB
> target, though. Anyone knows how feasible that is in current
> distributions?

There's a problem. Not all distributions support LSB fully.

It can be easier to just recompile it for the systems where you need it.
I'm thinking it will usually be something fairly small, as big packages
tend to have native alternatives.

Of course, in some cases binaries will work across distributions. You do
need to know what to do when things fail, though.

Cheers,

--
Steven Black <blacks@indiana.edu> / KeyID: 8596FA8E
Fingerprint: 108C 089C EFA4 832C BF07 78C2 DE71 5433 8596 FA8E

No comments: