斐讯N1-ArmBian系统写入EMMC及优化
免贵姓操 • 2020 年 07 月 26 日
前言
最近想搞个本地测试服务器,看到了斐讯N1,所以折腾下,安装Linux系统,再安装宝塔
教程详情下载ssh工具,推荐下面这款,该工具可以可视化编辑系统文件
FinalShell :Mac版 Winsows版
使用SSH工具登录U盘armbian系统,保持screen连接screen -S lnmp将U盘系统写入N1的EMMC中nand-sata-install写入成功后,输入命令关闭armbian系统,拔出U盘,重新启动N1shutdown now在/etc/apt/sources.list中修改Debian源deb [ arch=arm64,armhf ] https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
deb [ arch=arm64,armhf ] https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
deb [ arch=arm64,armhf ] https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
deb [ arch=arm64,armhf ] https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free
#deb [ arch=arm64,armhf ] https://mirrors.tuna.tsinghua.edu.cn/debian/ sid main contrib non-free更新和升级软件包:apt-get update
apt-get upgrade设置时区为北京时间ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone删除默认 DNSrm /etc/resolvconf/resolv.conf.d/head && touch /etc/resolvconf/resolv.conf.d/head开启 BBR 加速echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
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 服务systemctl disable serial-getty@ttyS0
systemctl stop serial-getty@ttyS0在文件/etc/sysctl.conf的末尾添加以下代码,禁用IPV6# IPv6 disabled
net.ipv6.conf.all.disable_ipv6 =1
net.ipv6.conf.default.disable_ipv6 =1
net.ipv6.conf.lo.disable_ipv6 =1#使用命令刷新系统变量
sudo sysctl -p固定N1的mac地址ifconfig #指令查看系统当前的MAC并记录下来#编辑/etc/network/interfaces,在iface eth0 inet dhcp的下一行添加以下代码并保存
pre-up ifconfig eth0 hw ether 1A:33:E6:90:1F:27安装蓝牙(需要就安装,不需要就可以略过)armbian-config → Network → BT install
#安装完毕后,返回终端
apt-get install python3-pip libglib2.0-dev python3-setuptools
pip3 install bluepy #安装过程有报错,但最终提示成功安装
bluetoothctl #确保蓝牙正常运作
[bluetooth]# power on
[bluetooth]# scan on #能扫描到蓝牙设备则代表正常工作了
[bluetooth]# power off #关闭吧,开着浪费电
[bluetooth]# exit #退出蓝牙操作安装中文字体apt install fonts-arphic-bkai00mp fonts-arphic-bsmi00lp fonts-arphic-gbsn00lp fonts-arphic-gkai00mp fonts-arphic-ukai fonts-arphic-uming
sudo fc-cache -v#编辑/etc/default/locale文件,将下面代码覆盖原先的保存
LC_MESSAGES=zh_CN.UTF-8
LANG=zh_CN.UTF-8
LANGUAGE=zh_CN.UTF-8#在root目录下,编辑.bashrc这个文件,在末尾 添加一行
export LC_ALL=zh_CN.UTF-8重启系统reboot