如何在 64 位 Linux 上从 32 位 Wine 执行 shell 脚本? [英] How to execute shell scripts from 32-bit Wine on 64-bit Linux?

查看:48
本文介绍了如何在 64 位 Linux 上从 32 位 Wine 执行 shell 脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 32 位应用程序在 Wine 下运行,为了帮助它更好地与环境集成,它运行了一些 shell 脚本.我刚刚在 Ubuntu 14.04 64 位下测试,我的程序崩溃了这个错误:

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

我尝试在我的系统上搜索 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.

运行 file/bin/dash 它打印:

/bin/dash: ELF 64-bit LSB  shared object, x86-64, version 1 (SYSV), ...

运行 file/bin/bash 但是打印:

/bin/bash: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), ...

dash 是共享对象",而 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 上遇到的错误是 wine: Bad EXE format for Z:insh..

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:insh..

如果您实际上只是将 /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

将 bash 脚本复制到/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 位环境中做到了这一点,并在 dashbash共享对象"与可执行文件"中遇到了同样的问题(但是当我将 /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 环境的详细信息,但基本上我按照 https://help.ubuntu.com/community/DebootstrapChroot 但需要配置 /etc/apt/sources.list 以获得完整的软件包列表(安装在我的默认主机系统中)让 apt-get install wine 工作.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆