如何在64位Linux上从32位Wine执行Shell脚本? [英] How to execute shell scripts from 32-bit Wine on 64-bit Linux?
问题描述
我的32位应用程序在Wine上运行,为了帮助它更好地与环境集成,它运行了一些Shell脚本。我只是在64位Ubuntu 14.04下进行测试,程序因以下错误而崩溃:
My 32-bit application is running under Wine, and to help it better integrate with the environment, it runs some shell scripts. I was just testing under Ubuntu 14.04 64-bit, and my program crashed with this error:
err:process:create_process starting 64-bit process L"Z:\\bin\\sh" not supported in 32-bit wineprefix
$ b $不支持位过程L Z:\\bin\\sh b
我尝试在系统上搜索32位版本的 sh,但是找不到。关于如何解决此问题,您有什么创意吗?
I've tried searching for a 32-bit build of "sh" on my system, but couldn't find one. Any creative ideas on how I can get past this issue?
推荐答案
我是该程序的用户,我做了一些
I am a user of the program in question and I did some experimenting with it.
运行文件/ bin / dash
它会打印:
/bin/dash: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), ...
正在运行文件/ bin / bash
但是会打印:
/bin/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), ...
破折号
是共享对象,而 bash
是可执行文件。显然, / bin / dash
似乎在某种程度上像可执行文件一样工作(我不知道这里的技术细节),但是看来这种差异对Wine很重要。
dash
is a "shared object" while bash
is an "executable". Clearly /bin/dash
seems to work like an executable in some way (I don't know the technical details here), but it seems that this difference matters to Wine.
我收到了与Wine 1.4相同的错误(无法启动64位进程),但是在较新版本的Wine上出现的错误是葡萄酒:Z:binbinsh的错误EXE格式。
I got the same error as you reported (can't start 64 bit process) for Wine 1.4, but the error I got on newer versions of Wine was wine: Bad EXE format for Z:\bin\sh..
如果您实际上只是替换 / bin / sh
和 / bin / bash
(即使是64位二进制文件)也可以使用。 Wine似乎也不喜欢运行符号链接,但是复制 / bin / bash
可行。
If you actually just replace /bin/sh
with /bin/bash
(even though that's a 64-bit binary) it will work. Wine also didn't seem to like running a symlink, but copying over /bin/bash
worked.
所以首先用以下命令备份现有的(符号链接的) / bin / sh
:
So first back up the existing (symlinked) /bin/sh
with:
sudo cp /bin/sh /bin/sh_orig
然后复制 bash
到 sh
:
sudo cp /bin/bash /bin/sh
然后,当我使用该程序运行Wine并调用 / bin / sh
工作正常。
Then when I ran Wine with the program and its calls to /bin/sh
work fine.
为32位bash shell下拉.deb文件:
Pull down the .deb file for the 32-bit bash shell:
wget http://us.archive.ubuntu.com/ubuntu/pool/main/b/bash/bash_4.3-6ubuntu1_i386.deb
我是您的主目录,将其解压缩到一个文件夹中:
I your home directory, extract it into a folder:
mkdir ~/bash_4.3-6ubuntu1_i386
dpkg -x bash_4.3-6ubuntu1_i386.deb ~/bash_4.3-6ubuntu1_i386
复制b灰脚本到/ bin / sh:
Copy the bash script into /bin/sh:
sudo mv /bin/sh /bin/sh64original
sudo cp ~/bash_4.3-6ubuntu1_i386/bin/bash /bin/sh
sudo chown root:root /bin/sh
或运行 schroot
,但仍必须将/ bin / bash复制到/ bin / sh
上面提到的Basile Starynkevitch关于在 schroot
环境中设置32位shell。我是在Ubuntu 14.04 32位环境中执行此操作的,遇到了 dash
vs。 bash
共享对象与可执行文件(但当我将 / bin / bash
复制到 / bin / sh
时, ),这使我意识到区别不是32位和64位的区别,而是与Wine有关的shell可执行文件的格式。
Or run schroot
, but still must copy /bin/bash to /bin/sh
Basile Starynkevitch mentioned above about setting up a 32-bit shell in an schroot
environment. I did that with an Ubuntu 14.04 32-bit environment and ran into the same issue with the dash
vs. bash
"shared object" vs. "executable" (but when I copied /bin/bash
to /bin/sh
it worked), so that helped me realize that the distinction wasn't the 32-bit vs. 64-bit difference but the format of the shell executables that mattered to Wine.
如果您希望我可以发布有关设置 schroot
环境的详细信息,但基本上我遵循了< a href = https://help.ubuntu.com/community/DebootstrapChroot rel = nofollow> https://help.ubuntu.com/community/DebootstrapChroot ,但需要配置 /etc/apt/sources.list
以获得 apt-get install wine $ c的软件包的完整列表(已安装在我的默认主机系统中)。 $ c>上班。
If you would like I can post details for setting up the schroot
evnironment but basically I followed the instructions at https://help.ubuntu.com/community/DebootstrapChroot but needed to configure the /etc/apt/sources.list
to have the full list of packages (as are installed in my default host system) for apt-get install wine
to work.
这篇关于如何在64位Linux上从32位Wine执行Shell脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!