提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
前言
该实验主要针对定位在 ARM(aarch64)结构机器上借助 Box86 使用 Wine 安装微信过程中的报错进行对比分析。目前在 ARM机器上借助 Box86 使用 wine 安装微信会在最后的启动界面弹出的时候提示 SIGSEGV 的报错并 core dump 。 所以决定在 X86 环境下构建同样的情况进行对比分析。一、在 X86_64 Linux 系统下搭建 i386 文件系统
在 X86_64 Linux环境下执行下面操作:
$ sudo mkdir -p /srv/chroot/i386
$ sudo apt-get install debootstrap
$ sudo apt install schroot
$ sudo debootstrap --foreign --arch=i386 xenial /srv/chroot/i386 http://mirrors.tuna.tsinghua.edu.cn/ubuntu/
使用 debootstrap
工具将 i386 文件系统从网站上拉取下来后,使用下面命令将本机的环境包安装到新下载的文件系统中:
$ sudo chroot /srv/chroot/i386/ /debootstrap/debootstrap --second-stage
此时,基本完成了 i386 文件系统在 X86_64 系统下的构建过程。
二、配置 Schroot 工具使得文件系统切换更方便
1.修改 schroot 配置文件
在 /etc/schroot/schroot.d/
目录下添加新文件系统的配置文件 i386
$ sudo vi /etc/schroot/chroot.d/i386
添加以下配置内容:
[i386]
description=Debian strectch armhf
directory=/srv/chroot/i386
#aliases=test
type=directory
root-users=root
root-groups=root
profile=desktop
personality=linux
preserve-environment=true
users=greatwall
并且修改默认的文件系统挂载配置文件 /etc/schroot/default/fstab
, 具体内容如下:
原始信息:
# fstab: static file system information for chroots.
# Note that the mount point will be prefixed by the chroot path
# (CHROOT_PATH)
#
# <file system> <mount point> <type> <options> <dump> <pass>
/proc /proc none rw,bind 0 0
/sys /sys none rw,bind 0 0
/dev /dev none rw,bind 0 0
/dev/pts /dev/pts none rw,bind 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/home /home none rw,bind 0 0
/tmp /tmp none rw,bind 0 0
# It may be desirable to have access to /run, especially if you wish
# to run additional services in the chroot. However, note that this
# may potentially cause undesirable behaviour on upgrades, such as
# killing services on the host.
#/run /run none rw,bind 0 0
#/run/lock /run/lock none rw,bind 0 0
#/dev/shm /dev/shm none rw,bind 0 0
#/run/shm /run/shm none rw,bind 0 0
修改为:
# fstab: static file system information for chroots.
# Note that the mount point will be prefixed by the chroot path
# (CHROOT_PATH)
#
# <file system> <mount point> <type> <options> <dump> <pass>
/proc /proc proc defaults 0 0
#/sys /sys none rw,bind 0 0
#/dev /dev none rw,bind 0 0
/dev/pts /dev/pts none rw,bind 0 0
tmpfs /dev/shm tmpfs defaults 0 0
#/home /home none rw,bind 0 0
/tmp /tmp none rw,bind 0 0
# It may be desirable to have access to /run, especially if you wish
# to run additional services in the chroot. However, note that this
# may potentially cause undesirable behaviour on upgrades, such as
# killing services on the host.
#/run /run none rw,bind 0 0
#/run/lock /run/lock none rw,bind 0 0
#/dev/shm /dev/shm none rw,bind 0 0
#/run/shm /run/shm none rw,bind 0 0
2.切换文件系统,并完成初始环境安装
使用以下命令进入新搭建的 i386 文件系统中:
$ sudo -i
# schroot -c chroot:i386
安装中文语言包及环境依赖:
# apt install locales
# dpkg-reconfigure locales
继续安装字库:
# apt install xfonts-wqy
安装环境依赖库
# apt install git
# apt install wget
# apt install zenity
# apt install cabextract
# apt install libcanberra-gtk-module
# apt install libcanberra-gtk*
# apt install locate
三、编译 Box86
- 下载 box86 源代码:
# su ww //切换到普通用户下
$ mkdir -p /home/ww/box86/source
$ cd /home/ww/box86/source
$ git clone https://gitee.com/beimangshan/box86.git
2. 使用 cmake 构建编译:
这里官网上有相关描述,
我们使用的是 X86 Linux 环境,所以使用以下命令进行构建编译
$ cd box86
$ mkdir build && cd build
$ cmake .. -DLD80BITS=1 -DNOALIGN=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
$ make && sudo make install
四、编译 Wine
从 wine 官方网站获取最新稳定版本的 wine 源码包,这里使用的是 wine-5…19 版本。然后解压编译,具体如下:
$ tar -xvf wine-5.19.tar.gz
$ cd wine-5.19/build
这里需要注意,编译 wine 所依赖的环境库会很多,所以都需要事前安装好,具体如下:
# 修改环境源:
$ sudo apt-get install apt-transport-https
$ sudo vi /etc/apt/source.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt-get install aptitude
$ sudo apt-get install lib32-nvidia-utils
$ sudo apt-get install libxnvctrl-dev
$ sudo apt-get install mingw-w64-i686-dev
$ sudo apt-get install libxcursor-dev
$ sudo apt-get install libxi-dev
$ sudo apt-get install libxxf86vm-dev
$ sudo apt-get install libxrandr-dev
$ sudo apt-get install llibxfixes-dev
$ sudo apt-get install libxinerama-dev
$ sudo apt-get install libxcomposite-dev
$ sudo apt-get install libosmesa6-dev
$ sudo apt-get install beignet-dev
$ sudo apt-get install libpcap0.8-dev
$ sudo apt-get install /testing 1.004-1 all
$ sudo apt-get install libbusiness-isbn-perl
$ sudo apt-get install libsane-dev
$ sudo apt-get install libusb-libusb-perl
$ sudo apt-get install libusb-ocaml-dev
$ sudo apt-get install libv4l-dev
$ sudo apt-get install libgphoto2-port12
$ sudo apt-get install libgphoto2-dev
$ sudo apt-get install liblcms2-utils
$ sudo apt-get install libpulse-ocaml-dev
$ sudo apt-get install libpulse-dev
$ sudo apt-get install librust-gstreamer-sys-dev
$ sudo apt-get install libqt5gstreamer-1.0-0
$ sudo apt-get install libgudev1.0-cil-dev
$ sudo apt-get install libsdl2-net-dev
$ sudo apt-get install libfaudio-dev
$ sudo apt-get install libcapi20-dev
$ sudo apt-get install libcupsfilters-dev
$ sudo apt-get install libcups2-dev
$ sudo apt-get install libfcft-dev
$ sudo apt-get install libxft-dev
$ sudo apt-get install libgsm1-dev
$ sudo apt-get install libkrb5-dev
$ sudo apt-get install libtiff5-dev
$ sudo apt-get install libmpg123-dev
$ sudo apt-get install libopenal-dev
$ sudo apt-get install libvulkan-dev
$ sudo apt-get install libvkd3d-utils1
$ sudo apt-get install libldap2-dev
$ sudo apt-get install libldap-ocaml-dev
$ sudo apt-get install binutils-mingw-w64-i686
$ sudo apt-get install libhbalinux-dev
$ sudo apt-get install liblcms2-dev
$ sudo apt-get install libvkd3d-dev
$ sudo apt-get install vkd3d-demos
编译构建wine:
$ ../configure --prefix=/usr/local/wine-i386-5.19/
$ make && sudo make install
在 i386 文件系统中配置环境后,可以正常使用 wine,如下:
$ export PATH=$PATH:/usr/local/wine-i386-5.19/bin/
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/wine-i386-5.19/lib/
$ export DISPLAY=:0
运行结果
将环境搭建好之后,执行命令测试是否可以正常安装微信。
$ box86 wine winecfg
执行该操作能够正常显示wine环境设置菜单,表示基本环境已经配置好了。
$ box86 wine WeChatSetup.exe
确实是能够正常安装微信,但是中文字符有乱码的现象。不过安装完成后却运行不了,显示如下现象:
总结
实验最终,还是未能正常运行启动微信,并且发现连一直在ARM环境下能够正常启动的红警(rad2.exe)也不能正常运行起来。最后判断应该是在X86环境下编译构建的box86并不能良好运行。所以对于ARM下不能正常安装并且运行微信(box86+wine)的问题还是没有得到解决,只能另找方法了。