N1 刷入 armbian

注意:操作以下步骤前,必须将N1出厂系统降级为2.19及以下版本,然后开启adb,并且已经刷入webpad官改固件(例子中使用的是2.2版),才可继续进行。

1.连接HDMI,网线,先不要插电源线

(1) 注意事项 & 准备工作
**** 千万不要在安卓系统开机的情况下插入U盘,否则U盘中的文件权限会被安卓系统篡改!
**** 一定要在关机状态下插入U盘!

	a. 烧录软件为:Etcher
	b. 烧录系统版本为:Armbian_5.77_Aml-s905_Debian_stretch_default_5.0.2_20190401.img
	c. 烧录后,将恩山xiangsm大神dtb文件考入boot/atb路径下,在PC端进入以下路径文件/boot/uenv.ini
	   将第一行最后的文件名改为meson-gxl-s905d-phicomm-n1-xiangsm.dtb
	d. 烧录后如弹出提示请格式化,请将其直接关闭,不要格式化


	在不插U盘的情况下(只连接鼠标!HDMI,网线,电源线)
	在PC端,以管理员权限打开cmd,在C:/WINDOWS/路径下,输入以下代码:
		adb connect 192.168.1.xxx(ip地址以实际为准)
		adb shell reboot update		
	进入recovery模式,选择 power off 关机
	
	执行过以上步骤后,下次插电后即可直接U盘启动!
	
( 如未能从U盘启动,则在android启动刚开始一瞬间拔掉U盘,
   进入android后,在PC端再次执行上文的 adb connect 和 reboot update 指令
   在显示器黑屏后2秒左右在远离HDMI的接口插入U盘,则可以进行U盘启动!)

拔掉鼠标,在N1端插入烧录好的USB2.0的U盘(插入远离HDMI接口的一端)

(2) 连接USB键盘(近HDMI的接口),现在插上电源线直接冷启动,N1从U盘启动。

(3) 启动后,进入命令行模式(因版本而定,也可选择带desktop的固件)。
可用putty连接N1的ip地址进行远程登陆。
默认用户名为root,默认密码1234

2.重新设置登陆密码,至Please provide a user name 处,按Ctrl+C退出putty连接,重新用新密码登陆。ls -l /确认一下目录权限没有被安卓篡改,都是root用户即可。

3.将armbian刷入emmc

真正有效的刷写方式是执行如下命令:

nand–sata-install

它可以完成所有刷写emmc所需的事情,完成后halt关机拔掉U盘,所有刷机工作就结束了。

如果你想重刷armbian系统,那么还是U盘启动armbian,重新执行nand-sata-install即可完整覆盖掉emmc中的数据,网上的教程一般是教你ddbr或者线刷先恢复到安卓系统再重来,这都是胡扯。

4.如不进行步骤3,则可以将系统运行在插入的U盘上。步骤3和4可以根据实际场景需要,进行二选一

5.armbian常用配置

armbian-config 可以用来配置网络、时区、语言、常用软件等内容

nmcli 查看/配置网络端口

uptime 系统使用状况,如运行时长、负载

armbianmonitor -m 实时查看系统负载

解决syslog中每10s出现一次ttyS0服务启动失败的日志

systemctl disable serial-getty@ttyS0
systemctl stop serial-getty@ttyS0
ddbr 备份/恢复emmc写入的系统

启用bbr

/etc/sysctl.conf末尾添加下面两行

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
sudo sysctl -p

通过以下命令检查 BBR 是否启动:

sysctl net.ipv4.tcp_available_congestion_control

返回值应为 net.ipv4.tcp_available_congestion_control = reno cubic bbr

sysctl net.ipv4.tcp_congestion_control

返回值应为 net.ipv4.tcp_congestion_control = bbr

sysctl net.core.default_qdisc

返回值应为 net.core.default_qdisc = fq

lsmod | grep bbr

返回值应包含 tcp_bbr 模块

关闭 serial-getty@ttyS0 服务
syslog 中每 10s 出现一次 ttyS0 服务启动失败的日志。不理它也没关系,但看着不舒服,所以:
systemctl disable serial-getty@ttyS0

6.安装后,如遇执行 sudo apt-get update 报错:
Err:1 http://httpredir.debian.org/debian stretch InRelease
Could not resolve ‘httpredir.debian.org’
Err:2 http://httpredir.debian.org/debian stretch-updates InRelease
Could not resolve ‘httpredir.debian.org’
Err:3 http://httpredir.debian.org/debian stretch-backports InRelease
Could not resolve ‘httpredir.debian.org’
Err:4 http://security.debian.org stretch/updates InRelease
Could not resolve ‘security.debian.org’
Err:5 http://apt.armbian.com stretch InRelease
Could not resolve ‘apt.armbian.com’
Reading package lists… Done
Building dependency tree
Reading state information… Done
3 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
W: Failed to fetch http://httpredir.debian.org/debian/dists/stretch/InRelease Could not resolve ‘httpredir.debian.org’
W: Failed to fetch http://httpredir.debian.org/debian/dists/stretch-updates/InRelease Could not resolve ‘httpredir.debian.org’
W: Failed to fetch http://httpredir.debian.org/debian/dists/stretch-backports/InRelease Could not resolve ‘httpredir.debian.org’
W: Failed to fetch http://security.debian.org/dists/stretch/updates/InRelease Could not resolve ‘security.debian.org’
W: Failed to fetch http://apt.armbian.com/dists/stretch/InRelease Could not resolve ‘apt.armbian.com’
W: Some index files failed to download. They have been ignored, or old ones used instead.

则:
The problem was related to DNS. I’ve fixed it by adding DNS nameservers as follow:

$ sudo vi /etc/resolv.conf

Modify or enter nameserver as follows:
nameserver 8.8.8.8
nameserver 4.2.2.4
即可解决。

关于家用NAS刷OMV
如果无法在 armbian-config 中安装 OMV(各种奇怪报错和关联性问题等),则有可能需要在刚刷完5.77版armbian后第一时间进入armbian-config进行OMV安装,即可解决。

给N1设置一个固定IP只需
命令行输入 armbian-config
选 network
选 eth0
选 ip
选 static
然后按需求填写即可。

Wi-Fi设置命令行输入 armbian-config
选 network
选 eth0
选 WiFi
找到对应WiFi信号回车
输入密码选OK
如果第一次没连上,可以多尝试几次

参考链接:
https://bbs.hassbian.com/thread-5631-1-1.html
https://yadi.sk/d/pHxaRAs-tZiei/5.99/default
https://www.right.com.cn/forum/thread-344896-1-1.html
https://www.right.com.cn/forum/thread-389277-1-1.html
https://www.nmza.net/archives/phicomm-n1-armbian.html
https://www.znds.com/tv-1153270-1-1.html
https://github.com/kasicass/blog/blob/master/debian/2018_11_19_armbian_on_n1_box.md
https://zhuanlan.zhihu.com/p/38456769
https://www.right.com.cn/forum/thread-324242-1-1.html
https://newsw.online/topic/3/n1%E5%AE%89%E8%A3%85armbian%E4%BD%9C%E7%BD%91%E5%85%B3%E6%8C%87%E5%8D%97
https://www.tok9.com/archives/407/
https://www.shephe.com/2019/07/phicomm-n1-armbian-omv-nas/
https://www.troyqi.com/archives/353/%E8%B6%85%E5%A5%BD%E7%8E%A9%E7%9A%84%E5%B0%8F%E6%9C%BA%E5%99%A8%EF%BC%8C%E6%96%90%E8%AE%AFn1%E5%AE%89%E8%A3%85armbian/
https://www.leonlu.cc/hobby/note005-phicomm-p1-linux/
https://forum.armbian.com/topic/6533-solved-broken-repositories/
https://www.right.com.cn/forum/thread-510423-1-1.html
https://www.right.com.cn/forum/thread-342558-1-1.html
https://zhuanlan.zhihu.com/p/54905523
https://www.right.com.cn/forum/thread-342558-1-1.html

以上及未罗列大神在此一并谢过

你可能感兴趣的:(N1,linux)