尝试向树莓派3B引入Drbian 9 arm64-PART 1
Stage 1:试图加入arm64软件包
笔者默认您清楚这些指令背后的意义以及其可能造成的后果,并默认您已备份重要资料
sudo dpkg --add-archietcture arm64
sudo apt update
尝试在树莓派上执行上述两条指令,结果如下(笔者的Raspbian已升级至Stretch):
Get: https://mirrors.ustc.edu.cn/raspbian/raspbian stretch InRelease [15.0 kB]
Get: https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease [22.9 kB]
Get: https://mirrors.ustc.edu.cn/raspbian/raspbian stretch/main armhf Packages [11.7 MB]
Get: https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie/main armhf Packages [163 kB]
Fetched 11.9 MB in 1min 7s ( kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
packages can be upgraded. Run 'apt list --upgradable' to see them.
N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/raspbian/raspbian stretch InRelease' doesn't support architecture 'arm64'
N: Skipping acquire of configured file 'rpi/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/raspbian/raspbian stretch InRelease' doesn't support architecture 'arm64'
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'
易得:Raspbian里并没有arm64的软件包——至少没有索引文件……
笔者遂修改sources.list:
deb https://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main rpi
deb https://mirrors.ustc.edu.cn/debian/debian/ stretch main
并执行:
wget https://mirrors.ustc.edu.cn/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2017.5_all.deb
sudo dpkg -i debian-archive-keyring_2017.5_all.deb
sudo apt update
得:
Hit: https://mirrors.ustc.edu.cn/raspbian/raspbian stretch InRelease
Hit: https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease
Get: https://mirrors.ustc.edu.cn/debian stretch/main arm64 Packages [6,936 kB]
Get: https://mirrors.ustc.edu.cn/debian stretch/main armhf Packages [6,925 kB]
Get: https://mirrors.ustc.edu.cn/debian stretch/main Translation-en [5,395 kB]
Fetched 19.3 MB in 1min 30s ( kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
packages can be upgraded. Run 'apt list --upgradable' to see them.
N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/raspbian/raspbian stretch InRelease' doesn't support architecture 'arm64'
N: Skipping acquire of configured file 'rpi/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/raspbian/raspbian stretch InRelease' doesn't support architecture 'arm64'
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'
似乎是成功了……
然而,尝试选择安装一个arm64软件包,都会遇到不可描述的依赖问题:
pi@raspberry:~ $ sudo apt install libc6:arm64 libgcc1:arm64
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation: The following packages have unmet dependencies:
bluez : Depends: libc6 (>= 2.15) but it is not going to be installed
Depends: libdbus-- (>= 1.1.) but it is not going to be installed
Depends: libglib2.- (>= 2.28.) but it is not going to be installed
Depends: libreadline6 (>= 6.0) but it is not going to be installed
Depends: libudev1 (>= ) but it is not going to be installed
Depends: init-system-helpers (>= 1.18~) but it is not going to be installed
Depends: kmod
Depends: udev (>= -)
Depends: dbus
libgcc1:arm64 : Depends: gcc--base:arm64 (= 6.3.-) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Stage 2:尝试在32位环境中执行64位程序
首先,口胡编写一个C程序,存为test64.c:
#include <time.h>
#include <stdio.h> long long fastpow_m(long long base,long long power,long long k)
{
long long result = ;
while (power!=)
{
if (power% == )result = (result*base)%k;
base = (base*base)%k;
power /= ;
}
return result;
} int main()
{
long long b,p,faq;
long t1,t2;
scanf("%lld %lld %lld",&b,&p,&faq);
printf("%lld %lld\n",b,p,faq);
t1 = clock();
printf("result :%lld\n",fastpow_m(b,p,faq));
t2 = clock();
printf("fastpow_m(): %f s.\n",((double)(t2-t1)/(double)CLOCKS_PER_SEC)); t1 = clock();
long long r = ;
for (int i=;i<=p;i++)r*=b,r = r%faq;
printf("result :%lld\n",r);
t2 = clock();
printf("normal: %f s.\n",((double)(t2-t1)/(double)CLOCKS_PER_SEC));
return ;
}
(参加过NOI/NOIP/ACM之类竞赛的人一眼就能看出:这是一个模意义下的二分快速幂计算程序:))
安装交叉编译工具链并编译:
sudo apt install gcc-aarch64-linux-gnu
aarch64-linux-gnu-gcc fastpow.c -static -o /tmp/test64
file /tmp/test64
/tmp/test64
得:
/tmp/test64: ELF -bit LSB executable, ARM aarch64, version (SYSV), statically linked, for GNU/Linux 3.7., BuildID[sha1]=a8009a666be247cfdf0b6d7827a8099dee36f1ba, not stripped -bash: /tmp/test64: cannot execute binary file: Exec format error
看样子还是不行,我的程序白口胡写了……唉……
Stage 3:编译64位内核:
偶然间发现一篇旧的文章,阐述了自行编译内核的方法,笔者遂依葫芦画瓢编译内核。
至于编译内核用的工具链?
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
然后……
git clone https://github.com/raspberrypi/linux.git
#4.12解决了VCHI和WiFi问题
git checkout rpi-4.12.y cd linux
#带##的是注释掉的原文指令
## make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcmrpi3_defconfig
# 调整配置
# 详见 https://www.cnblogs.com/UMRNInside/p/7197656.html
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
## make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j $(nproc)
然后是就是漫长的等待(git clone 会产生1.54GiB的流量,消耗2G以上的磁盘空间;至于编译过程……我想大家都懂得。)
工具链来源(可选):
sudo apt install gcc-aarch64-linux-gnu
接下来:
#设SD卡根分区位于/mnt/ext4,boot分区位于/mnt/boot
cp arch/arm/boot/Image mnt/fat32/kernel8.img make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=/mnt/ext4 modules
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=/mnt/ext4 modules_install
mv /mnt/boot/bcm2710-rpi--b.dtb bcm2710-rpi--b.dtb_32 cp arch/arm64/boot/dts/broadcom/bcm2710-rpi--b.dtb /mnt/boot
试着启动树莓派,一次成功,板载无线网卡以AP模式正常工作。
此时系统大部分组件仍为32位版本,RPi.GPIO无法正常使用,且无法使用硬浮点指令集(使用aarch64-linux-gnu-)。
尝试向树莓派3B引入Drbian 9 arm64-PART 1的更多相关文章
- 树莓派3B+上运行.Net Core项目
最近买了个树莓派3B+,准备把自己写的一个.Net Core爬虫挂在上面跑 买之前没有想到树莓派因为是今年新出的,导致驱动以及系统啥的都不是很完善,导致走了很多弯路,早知道买树莓派3就不用那么多折腾了 ...
- 树莓派3b+ Ubuntu 16.04 MATA系统 ssh远程登陆后修改主机名、用户密码和用户名
写在前面: 刚刚开始写博客,记录下自己的学习过程,备忘. 最近在使用树莓派做智能小车的开发,使用的是树莓派3b+,安装的是Ubuntu 16.04 MATA 系统,安装系统后需要修改主机名,登陆密码以 ...
- 树莓派3b安装Nginx和php7和百度语音合成模块
1.安装sox系统mp3音频播放模块(项目需要) sudo apt-get install lame sudo apt-get install sox sudo apt-get install lib ...
- [记录]学习树莓派3B接DHT11和LCD1602和修改树莓派时区
前提 树莓派系统安装好 apache web 服务器,如未安装,可在树莓派内执行sudo apt-get install apache2 进行安装apache 也可以通过命令获取GPIO信息: gpi ...
- Linux实现树莓派3B的国密SM9算法交叉编译——(二)miracl库的测试与静态库的生成
先参考这篇文章 Linux实现树莓派3B的国密SM9算法交叉编译——(一)环境部署.简单测试与eclipse工程项目测试 部署好环境,并简单测试交叉编译环境是否安装成功,最后实现在Eclipse上进行 ...
- 树莓派3B+之Raspbian系统的安装
概述 因为之前一段时间在研究物联网的原因,所以对树莓派这个东西早就有所耳闻.在我的印象里,树莓派几乎无所不能,它可以用来学编程. 搞物联网. 做服务器,甚至还能用它来进行渗透测试.终于,没禁的住诱惑, ...
- 树莓派3B/3B+/4B 刷机装系统烧录镜像教程
树莓派3B/3B+/4B 刷机装系统烧录镜像教程 树莓派 背景故事 刚拿到树莓派的第一件事,应该就是要装系统了,那么应该怎么操作呢?下面就给大家介绍一下吧. 硬件准备 树莓派:3B/3B+/4B,本教 ...
- 树莓派3B上手一二
树莓派3B上手一二 早些时间心血来潮买过一个树莓派,但是当时只是玩一玩,买来按照网上的教程摆弄了一下就闲置了.最近毕业设计,做时序数据分析的相关的工作,刚好想起能够用到树莓派+Node-RED来生成模 ...
- 树莓派3B搭建NODE-RED运行环境并构建数据流
树莓派3B搭建NODE-RED运行环境并构建数据流 树莓派搭建Node-RED环境 树莓派自2015年开始是默认就带NODE-RED的,但是如今已是2018年:)自带的版本已经很老了,可通过下面的命令 ...
随机推荐
- JAVAEE规范基础知识
JavaEE规范基础知识 本人博客文章网址:https://www.peretang.com/basic-knowledge-of-javaee-standard/ JavaEE简介 JavaEE,J ...
- Javascript中this关键字
this 是谁调用的时候,指定的是谁,通俗一点讲就是,函数是谁执行是不是由其中一个对象点出来的那就是代表它, 比如执行对象a中b函数a.b();这个b函数中this代表a; 当换成var c=a.b; ...
- 学习sql基础注入的方法
作为一个初学者的我,经学习发现基础真的十分重要, 这个随笔是写给我自己的希望我能坚持住 当然,我也希望对其他人有点帮助 在sql注入的过程中,我越发感觉那些基础函数的重要性 其实我感觉sql注入其实就 ...
- 软件开发的一些"心法"
从事软件开发也有好几年了,和一开始那个懵懵懂懂的小菜鸟相比,自己也感觉到了一些变化. 也许是熟能生巧, 趟过很多坑,但核心的绝不是这些细节的东西. 打个比方,如果说对某种语言的特性和技巧的掌握属于身法 ...
- Docker - 虚拟网桥
容器的网络模式 None --- 容器不能访问外部网络,内部存在回路地址. Container --- 将容器的网络栈合并到一起,可与其他容器共享网络. Host --- 与主机共享网络. Bridg ...
- MNIST机器学习
MNIST是一个入门级的计算机视觉数据集,它包含各种手写数字图片: 1. MNIST数据集 MNIST,是不是听起来特高端大气,不知道这个是什么东西? == 手写数字分类问题所要用到的(经典)MNIS ...
- hdu1054 Strategic Game 树形DP
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1054 思路:树形DP,用二分匹配也能解决 定义dp[root][1],表示以root 为根结点的子树且 ...
- dubbo 入门
1 介绍 1.1 背景 随着互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,亟需一个治理系统确保架构有条不紊的演进. 1.2 说明 DUBB ...
- 分享一个超级好用的php程序员工具箱
分享一个超级好用的php程序员工具箱,是由php中文网开发的. 集合了php环境搭建.在线小工具.原生手册.文字与视频教程.问答社区等 (php程序员工具箱 v0.1版本,点此下载:http://ww ...
- 【SoDiaoEditor电子病历编辑器】阶段性更新--新增复选框、日期控件、表格排版支持等
转眼距离上一次v2正式发布已经过去一个半月了.github期间不定期push了二十几次,同时感谢分布在广州.福建.上海.北京的一众小伙伴,正是你们给出的建议,才让SoDiaoEditor不断完善. 我 ...