1 刷入Armbian5.77
1.1 、安装【安卓】切换卡载系统
通过U盘在已经刷好atv6.0的比特米盒子安装“切换卡载系统”。比特米盒子刷atv6.0的方法参考。
若没有安装包,下载链接:https://drive.uc.cn/s/9bbb963b30104?public=1
1.2制作armbian硬盘镜像启动盘
使用win32磁盘映像工具Win32DiskImager将Armbian_5.77写入到硬盘【需要硬盘盒】(U盘,sd卡,移动硬盘)
1.3 修改uEnv.ini文件
写入成功后,重新连接电脑,在弹出的文件夹中找到“uEnv.ini”文件,记事本或其他工具打开并修改代码:
```shell
将第一行中的“dtb/meson-gxl-s905x-khadas-vim.dtb”,改成“dtb/meson-gxl-s905x-p212.dtb 存盘退出
```
修改完成后,将U盘插入比特米盒子,通过“切换卡载系统”APP选择从U盘启动,就可以启动CoreELEC系统。
1.4 将硬盘系统安装至EMMC中
通过SSH工具连接到比特米盒后,首先设置密码, 初始密码为1234,修改成你自己需要的密码(两遍)
Welcome to ARMBIAN 5.77 user-built Ubuntu 18.04.2 LTS 5.0.2-aml-s905
System load: 0.34 0.19 0.07 Up time: 1 min
Memory usage: 12 % of 833MB IP: 192.168.3.206
CPU temp: 54°C
Usage of /: 9% of 15G storage/: 55% of 128M
[ General system configuration (beta): armbian-config ]
New to Armbian? Check the documentation first: https://docs.armbian.com
Changing password for root.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
Thank you for choosing Armbian! Support: www.armbian.com
Creating a new user account. Press <Ctrl-C> to abort
Please provide a username (eg. your forename): ^C
Disabling user account creation procedure
root@aml:~#
通过ls命令可以看到root目录下有
root@aml:~# ls
fstab install-2018.sh install.sh test-docker.sh
通过install 脚本命令可以将系统安装到EMMC中
root@aml:~# /root/install.sh
# 这里是安装到emmc的过程
root@aml:~#
就此拔掉电源和硬盘,系统到此就已经刷入到EMMC中,重启就可以自动进入armbian系统。
1.5 优缺点
- 缺点
系统是古老的,而且不支持蓝牙,led屏幕不亮等等。 - 优点
简单,快捷
2、刷入armbian更新的系统
更新Armbian_21.08.1_Ubuntu_CumeBox2_5.10.602.img。此系统支持蓝牙和wifi。期。
2.1 上传镜像
设置好之前的系统后,ssh通过rz命令将Armbian_21.08.1_Ubuntu_CumeBox2_5.10.602.img上传至root目录下
root@aml:~# sudo apt install lrzsz
root@aml:~# rz
# 这里会弹出对话框,Armbian_21.08.1_Ubuntu_CumeBox2_5.10.602.img即可
root@aml:~# cd /root
root@aml:~# ls #查看上传到了没有
Armbian_21.08.1_Ubuntu_CumeBox2_5.10.602.img
2.2 更新系统
利用dd if=Armbian_21.08.1_Ubuntu_CumeBox2_5.10.602.img of=/dev/mmcblk1 #(有可能是mmcblk2这里根据自己的显示)命令进行安装
root@aml:~# dd if=Armbian_21.08.1_Ubuntu_CumeBox2_5.10.602.img of=/dev/mmcblk1
这个过程约5分钟
3448832+0 records in
3448832+0 records out
1765801984 bytes (1.8 GB, 1.6 GiB) copied, 193.614 s, 9.1 MB/s
root@aml:~#
当看到命令提示行出现了root@aml:~# 断电重启设备(登录密码为1234)
2.3 系统配置
2.3.1 设置新的密码
Welcome to Armbian 21.08.1 Focal with Linux 5.10.60-meson64
System load: 27% Up time: 1 min Local users: 2
Memory usage: 13% of 961M IP: 192.168.3.207
CPU temp: 55°C Usage of /: 20% of 7.0G
[ 5 security updates available, 16 updates total: apt upgrade ]
Last check: 2021-08-26 09:00
[ General system configuration (beta): armbian-config ]
Last login: Thu Aug 26 09:00:00 2021
Waiting for system to finish booting ...
New to Armbian? Documentation: https://docs.armbian.com Support: https://forum.armbian.com
New root password: ********
Repeat password: ********
Choose default system command shell:
1) bash
2) zsh
Shell: BASH
Creating a new user account. Press <Ctrl-C> to abort
Please provide a username (eg. your forename): ^C
Disabling user account creation procedure
2.3.2 设置时区及更新
sudo apt update
sudo apt upgrade -y
#这个过程中会出现选项
Installing new version of config file /etc/issue ...
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
# Y 或 I:安装软件包维护者提供的版本。
N or O : keep your currently-installed version
# N 或 O:保留当前已安装的版本。
D : show the differences between the versions
# D:显示新旧版本之间的差异。
Z : start a shell to examine the situation
# Z:启动一个 shell 来检查情况。
The default action is to keep your current version.# 默认保留当前版本
*** issue (Y/I/N/O/D/Z) [default=N] ? y
*** issue.net (Y/I/N/O/D/Z) [default=N] ? y
*** armbian-apt-updates (Y/I/N/O/D/Z) [default=N] ? y
#设置时区
date -R
# Mon, 14 Aug 2023 7:00:41 +0000
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
date -R
# Mon, 14 Aug 2023 15:00:41 +0800
# 重启
reboot
2.3.3 配置风扇起停
2.3.3.1 配置脚本
/home/fan 创建个控制的bash脚本叫ctrl.sh,脚本内容如下:
#!/bin/sh -e
temp_cpu=(/etc/update-motd.d/30-armbian-sysinfo | grep temp | awk '{print substr(4,1,2)}' )
temp_warn=57
if [ temp_cpu -lttemp_warn ]; then
/home/fan/fan_off.sh
else
/home/fan/fan_on.sh
fi
/home/fan 创建个控制的bash脚本叫fan_off.sh,脚本内容如下:
#!/bin/sh -e
###-------gpio-fan driver gen this ------###
if [ -e /sys/class/hwmon/hwmon0/fan1_target ]; then
echo 0 > /sys/class/hwmon/hwmon0/fan1_target
else
echo missing fan-driver
fi
###--------gpio-led driver -------###
if [ -e /sys/class/leds/blue/brightness ]; then
echo 0 > /sys/class/leds/blue/brightness
else
echo missing blue-led-driver
fi
if [ -e /sys/class/leds/red/brightness ]; then
echo 0 > /sys/class/leds/red/brightness
else
echo missing red-led-driver
fi
if [ -e /sys/class/leds/green/brightness ]; then
echo 1 > /sys/class/leds/green/brightness
else
echo missing green-led-driver
fi
/home/fan 创建个控制的bash脚本叫fan_on.sh,脚本内容如下:
#!/bin/sh -e
###-------gpio-fan driver gen this ------###
if [ -e /sys/class/hwmon/hwmon0/fan1_target ]; then
echo 4500 > /sys/class/hwmon/hwmon0/fan1_target
else
echo missing gpio-fan
fi
###--------gpio-led driver -------###
if [ -e /sys/class/leds/blue/brightness ]; then
echo 1 > /sys/class/leds/blue/brightness
else
echo missing blue-led-driver
fi
if [ -e /sys/class/leds/red/brightness ]; then
echo 1 > /sys/class/leds/red/brightness
else
echo missing red-led-driver
fi
if [ -e /sys/class/leds/green/brightness ]; then
echo 0 > /sys/class/leds/green/brightness
else
echo missing green-led-driver
fi
2.3.3.2 配置定时任务
在/etc/crontab文件里增加一条cron的记录,每分钟运行下ctrl.sh的脚本
* * * * * root sh /home/fan/ctrl.sh
文章评论