Bob Proulx wrote:
Matthew Woehlke wrote:
Бојан Ландекић wrote:
Is it possible to put bash on some portable media and use it on a
system that is bash-less without worrying about dependencies?
Not unless you build it statically, it isn't. :-) Although I think if
you build bash it gives you all the libraries you need except for libc
(or your OS's equivalent). IOW if you have an entire bash install on
your 'portable media', you should be able to run that bash on any system
the same as, or newer than, your build system.
Actually as long as you include all of the libraries in the same
bundle and call ldso with the path to the bundled libc then it is
perfectly possible to build a complete set that will work on most
distros, on the same architecture and across compatible kernel
versions of course. On my system that would be libncurses.so.5,
libdl.so.2, libc.so.6, ld-linux-x86-64.so.2 plus bash itself and a
portable sh script wrapper to tie it all together. I do that with
other tools frequently.
Oddly enough, I can get this to work on OSF, but not Linux. I don't want
to use a bundled libc unless the system libc is sufficient, so what I
did was drop a "sufficient" libc somewhere I can LD_LIBRARY_PATH it
before trying to run bash. Like I said, this works on OSF, but on Linux
I get:
$ ldd /path/to/bash
/path/to/bash: /lib/i686/libc.so.6: version `GLIBC_2.3' not found
(required by /path/to/bash)
libtermcap.so.2 => /lib/libtermcap.so.2 (0x40021000)
libdl.so.2 => /lib/libdl.so.2 (0x40025000)
libc.so.6 => /lib/i686/libc.so.6 (0x40029000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
...At some point I was also getting:
$ ldd /path/to/bash
/bin/sh: /lib/ld-linux.so.2: version `GLIBC_PRIVATE' not found (required
by /path/to/my/private/libc.so.6
...but I can't seem to reproduce this any more (I think it happened if I
dropped in libdl also).
Apparently selectively shadowing libc is non-trivial... any
suggestions/hints?
--
Matthew
Obscurity: +5
_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash