树莓派3b刷android9.0系统,树莓派3b支持DirectX 9.0吗?想用wine跑点游戏

Stage 1:寻找消失的指令集

对比加载新内核前后树莓派3B上执行lscpu的输出:

Before:Architecture:          armv7l

...Flags:                 half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32After:Architecture:          aarch64

...Flags:                 fp asimd evtstrm crc32

显然,有许多指令集莫名消失。

笔者使用的aarch-linux-gnu-工具链:

$ aarch64-linux-gnu-gcc -v

Using built-in specs.

COLLECT_GCC=aarch64-linux-gnu-gcc

COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/aarch64-linux-gnu/6/lto-wrapperTarget: aarch64-linux-gnu

Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-18' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-arm64-cross/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-arm64-cross --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-arm64-cross --with-arch-directory=aarch64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libgcj --enable-multiarch --enable-fix-cortex-a53-843419 --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=aarch64-linux-gnu --program-prefix=aarch64-linux-gnu- --includedir=/usr/aarch64-linux-gnu/includeThread model: posix

gcc version 6.3.0 20170516 (Debian 6.3.0-18)

笔者遂使用crosstool-ng制作编译工具链,并惊喜地发现:

$ ls /opt/crosstool-ng/samples/aarch64-rpi3-linux-gnueabi

...

crosstool-ng-1.23.0-75-ga9f8a8e6中已添加针对树莓派3的支持。

于是笔者开始制作工具链。

选中了linaro分支的gcc。

并按照与前文相似的方法编译内核,然而没有效果,指令集仍未被识别。

后来笔者查阅资料后发现,aarch64是一套全新的指令集,asimd代替了neon。

Stage 2:使用debootstrap制作64位组件

尽管内核工作于64位模式,但系统大多数组件仍旧处于32位模式下。

我们的目标是引入Debian 9 arm64,自然会想到使用debootstrap。

在树莓派上,给一张SD卡分两个区:

一个在前面,大小100M左右,使用mkfs.vfat,类型为W95 FAT32

一个占用后面所有的空间,视/boot/cmdline.txt中rootfstype的设置选择分区格式

然后开干:

sudo debootstrap --verbose --arch=arm64 stretch . https://mirrors.ustc.edu.cn/debian/

编辑sources.list:deb http://mirrors.ustc.edu.cn/debian/ stretch maindeb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/ jessie main non-free contrib

apt.conf:

APT::Default-Release "stretch";

Chroot和之前的准备工作:sudo mount -t proc proc procsudo mount -t sysfs sysfs syssudo mount -o bind /dev devsudo chroot .

视具体情况安装软件包。apt install hostapd wpasupplicant udhcpd screen dnsmasq sudo openssh-server firmware-brcm80211 ...

firmware-brcm80211:使系统识别树莓派3板载网卡

hostapd,udhcpd,dnsmasq:启动AP必备

wpasupplicant:用于连接Wifi热点

openssh-server:SSH服务器

sudo,screen:这两个想必大家都听说过吧……

退出Chroot环境,复制配置文件及其它核心组件,例如:/boot/lib/modules/etc/passwd/etc/shadow/etc/sudoers/etc/hostapd/etc/default/etc/udhcpd.conf/etc/udev//etc/dnsmasq.conf

etc...

注:笔者实际上把整个(除了/etc)64位根文件系统覆盖到了树莓派启动的SD卡上。

成功启动。

但是有烦人的提示:

ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

解决方案显而易见:sudo mv /etc/ld.so.preload /etc/ld.so.preload.bak

sudo touch /etc/ld.so.preload

如果你使用了一张新的SD卡,记得编辑/etc/fstab!

Stage 3:站稳脚跟

*执行apt-get update,提示:Ign:1 https://mirrors.ustc.edu.cn/debian stretch InRelease

Get:2 https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease [22.9 kB]

Hit:2 https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease

Get:3 https://mirrors.ustc.edu.cn/debian stretch Release [113 kB]

Hit:3 https://mirrors.ustc.edu.cn/debian stretch ReleaseCan't locate Storable.pm in @INC (you may need to install the Storable module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/aarch64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/aarch64-linux-gnu/perl-base) at /usr/bin/apt-show-versions line 37.

BEGIN failed--compilation aborted at /usr/bin/apt-show-versions line 37.

Reading package lists... Done

N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease' doesn't support architecture 'arm64'N: Skipping acquire of configured file 'non-free/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease' doesn't support architecture 'arm64'

N: Skipping acquire of configured file 'contrib/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease' doesn't support architecture 'arm64'N: Skipping acquire of configured file 'ui/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease' doesn't support architecture 'arm64'

E: Problem executing scripts APT::Update::Post-Invoke-Success 'test -x /usr/bin/apt-show-versions || exit 0 ; apt-show-versions -i'

E: Sub-process returned an error code

笔者尝试执行sudo apt-get install apt-show-versions,问题解决。

小结

路曼曼其修远兮,吾将上下而求索。

目前整个系统仅仅只是能用,还有许多不完美的地方。

更新

4.11的内核可以使树莓派工作得更好,ACT灯和VCHI将正常工作。

Git切换分支:git checkout rpi-4.11.y

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值