diff options
author | Joey Hess <joey@kitenet.net> | 2013-12-16 01:51:19 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-12-16 01:51:19 -0400 |
commit | 04958b79b37842a30c48d7bbe8ee6f79b4ee7e7b (patch) | |
tree | 73b7b8d433afa0f1443313314b11461f5bce112a /standalone | |
parent | 2fb59a5f4deb2741a85ad5c1afd0ceb0eab986e6 (diff) |
Linux standalone build now includes its own glibc and forces the linker to use it, to remove dependence on the host glibc.
Diffstat (limited to 'standalone')
-rw-r--r-- | standalone/linux/README | 23 | ||||
-rw-r--r-- | standalone/linux/glibc-libs | 45 | ||||
-rwxr-xr-x | standalone/linux/runshell | 21 |
3 files changed, 24 insertions, 65 deletions
diff --git a/standalone/linux/README b/standalone/linux/README index 18983fd7a..2a321845f 100644 --- a/standalone/linux/README +++ b/standalone/linux/README @@ -1,4 +1,5 @@ -You can put this directory into your PATH, and use git-annex the same +You can put this directory into your PATH, or symlink the programs in this +directory to anyplace already in your PATH, and use git-annex the same as if you'd installed it using a package manager. Or, you can use the runshell script in this directory to start a shell @@ -6,20 +7,14 @@ that is configured to use git-annex and the other utilities included in this bundle, including git, gpg, rsync, ssh, etc. This should work on any Linux system of the appropriate architecture. -More or less. There are no external dependencies, except for glibc. -Any recent-ish version of glibc should work (2.13 is ok; so is 2.11). +More or less. How it works: This directory tree contains a lot of libraries and programs -that git-annex needs. But it's not a chroot. Instead, runshell sets PATH -and LD_LIBRARY_PATH to point to the stuff in here. +that git-annex needs. But it's not a chroot. Instead, runshell sets a lot +of environment variables to cause files from here to be used, and a shim +around the binaries arranges for them to be run with the libraries in here. -The glibc libs are not included. Instead, it runs with the host system's -glibc. We trust that glibc's excellent backwards and forward compatability -is good enough to run binaries that were linked for a newer or older -version. Of course, this could fail. Particularly if the binaries try to -use some new glibc feature. But hopefully not. - -Why not bundle glibc too? I've not gotten it to work! The host system's -ld-linux.so will be used for sure, as that's hardcoded into the binaries. -When I tried including libraries from glibc in here, everything segfaulted. +It shouldn't even be dependent on the host system's glibc libraries. +All that's needed is a kernel that supports the glibc included in this +bundle. diff --git a/standalone/linux/glibc-libs b/standalone/linux/glibc-libs deleted file mode 100644 index d37ad4eb4..000000000 --- a/standalone/linux/glibc-libs +++ /dev/null @@ -1,45 +0,0 @@ -libanl-.*.so -libutil-.*.so -libnss_hesiod-.*.so -libcrypt-.*.so -libnss_compat-.*.so -libm-.*.so -libr.so -libpcprofile.so -libnss_nis-.*.so -libSegFault.so -libpthread-.*.so -librt-.*.so -libnss_dns-.*.so -libdl-.*.so -libBrokenLocale-.*.so -libnss_nisplus-.*.so -libthread_db-1.0.so -libmemusage.so -libcidn-.*.so -libnss_files-.*.so -libnsl-.*.so -libc-.*.so -ld-.*.so -libnss_nis.so -libthread_db.so -libanl.so -libr.so -libnss_compat.so -libm.so -libnss_dns.so -libpthread.so -libc.so -librt.so -libcidn.so -libnss_nisplus.so -libnsl.so -libutil.so -libBrokenLocale.so -ld-linux.so -libnss_files.so -libdl.so -libnss_hesiod.so -libcrypt.so -linux-vdso.so -linux-gate.so diff --git a/standalone/linux/runshell b/standalone/linux/runshell index 76ed94df5..40440a1bd 100755 --- a/standalone/linux/runshell +++ b/standalone/linux/runshell @@ -46,12 +46,20 @@ export ORIG_PATH PATH=$base/bin:$PATH export PATH -ORIG_LD_LIBRARY_PATH="$LD_LIBRARY_PATH" -export ORIG_LD_LIBRARY_PATH +# This is used by the shim wrapper around each binary. for lib in $(cat $base/libdirs); do - LD_LIBRARY_PATH="$base/$lib:$LD_LIBRARY_PATH" + GIT_ANNEX_LD_LIBRARY_PATH="$base/$lib:$GIT_ANNEX_LD_LIBRARY_PATH" done -export LD_LIBRARY_PATH +export GIT_ANNEX_LD_LIBRARY_PATH +GIT_ANNEX_LINKER=$(cat $base/linker) +export GIT_ANNEX_LINKER +GIT_ANNEX_SHIMMED="$base/shimmed" +export GIT_ANNEX_SHIMMED + +ORIG_GCONV_PATH="$GCONV_PATH" +export ORIG_GCONV_PATH +GCONV_PATH=$base/$(cat $base/gconvdir) +export GCONV_PATH ORIG_GIT_EXEC_PATH="$GIT_EXEC_PATH" export ORIG_GIT_EXEC_PATH @@ -68,8 +76,9 @@ export ORIG_MANPATH MANPATH="$base/usr/share/man:$MANPATH" export MANPATH -# Indicate which variables were exported above. -GIT_ANNEX_STANDLONE_ENV="PATH LD_LIBRARY_PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR MANPATH" +# Indicate which variables were exported above and should be cleaned +# when running non-bundled programs. +GIT_ANNEX_STANDLONE_ENV="PATH GCONV_PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR MANPATH" export GIT_ANNEX_STANDLONE_ENV if [ "$1" ]; then |