Linux chroot under OpenBSD /bin/bash: Exec format error
Hi !
I'm under OpenBSD 5.5, and i would like to run some Linux programs inside a chroot. # chroot ./ /bin/bash chroot: /bin/bash: Exec format error First, is it possible (to some extent) ? And if yes, how ? |
You should get bash for OpenBSD ... just copying a linux binary won't work (although there may be some compatibility cheat).
|
I installed bash under BSD with pkg_add . Maybe you mean that i have to copy the BSD version inside the chroot ?
|
Bump !
|
This isn't going to work the way you want it to.
First off, the operating system syscall numbers (which any non-trivial program is more than likely going to call) are different, as well as the method for calling syscalls. Second, Linux-compiled libraries will need to be present (i.e. a Linux binary wouldn't be able to call an OpenBSD library of the same name as the Linux library it needs). Third (and perhaps most critically), even if you got everything else to line up properly, the calling conventions are different between Linux and OpenBSD (Linux passes parameters in registers and uses the stack for overflow parameters, OpenBSD passes all parameters on the stack). Fourth, Linux emulation was removed from OpenBSD many, many moons ago (which required syscall emulation and linux libraries to be installed). Fifth, what are you trying to accomplish? |
Linux emulation was not removed, was it? If i am not mistaken they even talk about it on the FAQ
|
FreeBSD has Linux emulation. I'm not sure about OpenBSD. However, do take heed that the Linux emulation binaries are not as modern as a true Linux system.
|
Quote:
It's no longer in the default kernel build, however, so running Linux binaries would require a custom kernel. |
What Linux programs are you trying to run? Have you checked to see if there are ports?
|
I try different things. Some of them are pre-compiled libraries which relies on a Linux rootfs.
|
All times are GMT -5. The time now is 03:24 AM. |