LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Misc Binary Format Handler (https://www.linuxquestions.org/questions/linux-general-1/misc-binary-format-handler-44545/)

xcon 02-08-2003 02:22 AM

Misc Binary Format Handler
 
OK, there is weirdness afoot.
In Slackware 8.1:
Discovered binfmt_misc.
Read about wrapper scripts.
Tried default Windows exe support, adjusting for my mini-wrapper.
(echo ':WIN32:M::MZ::/bin/wintegration:' > /proc/sys/fs/binfmt_misc/register)
No good. Can't echo into register, since there was reading yet to do.
Read about mounting under /proc/.../binfmt_misc, tried it, commands now work.
No good. inside /win98/WINDOWS, bash reports "bash: ./WRITE.EXE: cannot execute binary file"
Repeatedly echo '1' into status and WIN32, the format name. cat'ted all repeatedly, each reports 'enabled'.
Nada.
Make 2 new formats, now based on extension "EXE" and "exe", pointing to same wrapper.
Nope.

/bin/wintegration is just "wine $1 -- $2 $3 $4 $5 $6 $7 $8 $9" so I can pass options, but this never gets that far.

I'm asking here since I don't see other documentation that doesn't merely echo the kernel docs and the binfmt_misc webpage.

One thing that just might be the issue is my Win4Lin patched kernel 2.4.20. that's the only modification at this time.

Anyone?

i'm rebooting my pure kernel, if it works i'll delete this post.


--later--

plain vanilla is no better. BTW, both kernels have binfmt_misc internal, not as a module. At one time I thought it might be bash, so I tried other shells (csh, ksh, zsh) without success.

I even opened WRITE.EXE in a hex editor to make sure it wasn't the most impossible Windows binary ever, the one that DIDN'T begin with MZ. But there they were. MZ, a.k.a. 0x4D 0x5A just like the output of "cat /proc/sys/fs/binfmt_misc/WIN32". Something can't be right, but that something isn't WRITE.

addon: I tried other progs, too.


xcon 02-08-2003 02:42 AM

---------

xcon 04-01-2003 07:40 AM

I installed slack 9.0 from the ground up, and copied config files in as needed. here's what happens:

/etc/mtab includes the following
Code:

proc on /proc type proc (rw)
binfmt on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

/etc/rc.d.rc.w32:
Code:

echo "Fixing WINE integration..."
echo '1' > /proc/sys/fs/binfmt_misc/status
echo ':WINE:M::MZ::/bin/wintegration:' > /proc/sys/fs/binfmt_misc/register
echo '1' > /proc/sys/fs/binfmt_misc/WINE

ls -l /proc/sys/binfmt_misc:
Code:

cat /proc/sys/fs/binfmt_misc/
-rw-r--r--    1 root    root            0 Apr  1 03:40 WINE
-r--------    1 root    root            0 Mar 31 22:39 register
-rw-r--r--    1 root    root            0 Mar 31 22:39 status

cat /proc/sys/fs/binfmt_misc/WINE:
Code:

enabled
interpreter /bin/wintegration
offset 0
magic 4d5a

/bin/wintegration is same as listed above...

cat /proc/sys/fs/binfmt_misc/status:
Code:

enabled
Everything here is apparently in order according to all the docs I've read. I'm using 2.4.20, built from source--quite a few times, actually... and the misc. binary format option is built-in, i.e. NOT a module. I tried it once as a module, and it also proved nothing. The only thing I get is the thing I always get:

Code:

xcon@labserver:/win98/Program Files/Winamp$ ls -l winamp.exe
-rwxrwxr-x    1 root    root      622080 Aug 22  2002 winamp.exe*
xcon@labserver:/win98/Program Files/Winamp$ ./winamp.exe
bash: ./winamp.exe: cannot execute binary file

Is this wrong?

xcon 04-01-2003 07:52 AM

hmmm... i thought the 'wrapper script' was supposed to work.

i changed the registered interpreter to /opt/wine/bin/wine and now it launches... no more script, I wonder if the command line opts still operate.


All times are GMT -5. The time now is 12:09 AM.