O NixOS não possui suporte multiarch nativamente.
O único pacote Nix que contém o arquivo ld-linux.so.2
do interpretador ELF de 32 bits é a versão i386 da glibc.
Por sorte, podemos contornar o problema pegando emprestado o pacote do debian.
- Instale
dpkg
:nix-env -i dpkg
- Faça o download do pacote
libc-i386
para sistemas de 64 bits do debian:curl -O http://ftp.us.debian.org/debian/pool/main/e/eglibc/libc6-i386_2.11.3-4_amd64.deb
- Extraia esse pacote:
dpkg -x libc6-i386_2.11.3-4_amd64.deb libc6-i386
- Executar
mksdcard
com o interpretador ELF de 32 bits:./libc6-i386/lib32/ld-linux.so.2 /path/to/mksdcard
Uma forma de executar coisas como mksdcard
via ./mksdcard
é corrigi-las usando patchelf
instalado por meio de: nix-env -i patchelf
Você pode fazer algo como patchelf --set--interpreter /path/to/libc6-i386/lib32/ld-linux.so.2 /path/to/mksdcard
Caso contrário, você pode tentar colocar links simbólicos para o seu ld-linux.so.2
nos lugares em que ldd
está informando que ele os espera.
[root@nixos:/tmp]# ./libc6-i386/lib32/ld-linux.so.2
Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
You have invoked 'ld.so', the helper program for shared library executables.
This program usually lives in the file '/lib/ld.so', and special directives
in executable files using ELF shared libraries tell the system's program
loader to load the helper program from this file. This helper program loads
the shared libraries needed by the program executable, prepares the program
to run, and runs it. You may invoke this helper program directly from the
command line to load and run an ELF executable file; this is like executing
that file itself, but always uses this helper program from the file you
specified, instead of the helper program file specified in the executable
file you run. This is mostly of use for maintainers to test new versions
of this helper program; chances are you did not intend to run this program.
--list list all dependencies and how they are resolved
--verify verify that given object really is a dynamically linked
object we can handle
--library-path PATH use given PATH instead of content of the environment
variable LD_LIBRARY_PATH
--inhibit-rpath LIST ignore RUNPATH and RPATH information in object names
in LIST
--audit LIST use objects named in LIST as auditors