树莓派的镜像文件为.img,下载的操作系统镜像为.img文件或raw.xz文件
本文使用CentOS for AArch64作为树莓派的操作系统,由于Centos官方未提供64位的img镜像下载,所以本文采用移植版的CentOS for AArch64
镜像下载地址:https://github.com/chainsx/centos64-rpi
[root@localhost ~]# fdisk /dev/mmcblk0
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
磁盘分区
#删除分区(命令:d)
Command (m for help): d
#选择分区(删除默认分区)
Partition number (1,2, default 2): 输入2或直接回车
#列出分区表(命令:p)
Command (m for help): p
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 131072 64512+ e W95 FAT16 (LBA)
#新建分区(命令:n)
Command (m for help): n
#选择分区类型(选择默认类型,输入p)
Select (default p): p
#选择分区(选择默认分区)
Partition number (2-4, default 2): 输入2或回车
#选择第二分区起始位置(使用默认)
First sector (131073-124735487, default 133120): 回车
#选择第二分区结束位置(使用默认)
Last sector, +sectors or +size{K,M,G} (133120-124735487, default 124735487): 回车
#列出分区表(命令:p)
Command (m for help): p
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 131072 64512+ e W95 FAT16 (LBA)
/dev/mmcblk0p2 133120 124735487 62301184 83 Linux
#把分区写进分区表,保存并退出(命令:w)
Command (m for help): w
重启系统
[root@localhost ~]# cd install && sh install.sh
Install Image,dtbs
cp: cannot overwrite directory ‘/boot/overlays’ with non-directory
cp: error writing ‘/boot/vmlinuz-4.16.0-chainsx-edition-chainsx+v7’: No space left on device
Remove old modules
OK
Install modules
OK
Install firmware
OK
Install kernel_headers
OK
Configure files
#uncomment to overclock the arm. 700 MHz is the default.
arm_freq=700# NOOBS Auto-generated Settings:
hdmi_force_hotplug=1
config_hdmi_boost=4
overscan_left=24
overscan_right=24
overscan_top=16
overscan_bottom=16
disable_overscan=0
core_freq=250
sdram_freq=400
over_voltage=0
OK
You can reboot to use this new kernel.
重启系统
[root@localhost ~]# reboot
查看内核版本
[root@localhost ~]# cat /proc/version
Linux version 4.16.0-chainsx-edition-chainsx+v7 (root@ubuntu) (gcc version 5.4.0 20160609
(Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.6)) #3 SMP PREEMPT Thu Mar 22 02:32:13 CST 2018
4.3 更改系统语言
[root@localhost ~]# timedatectl
Local time: Sat 2018-07-07 13:51:00 UTC
Universal time: Sat 2018-07-07 13:51:00 UTC
RTC time: n/a
Time zone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
设置时区
[root@localhost ~]# timedatectl
Local time: 日 2018-06-24 21:29:14 CST
Universal time: 日 2018-06-24 13:29:14 UTC
RTC time: n/a
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
4.8 修改系统密码
修改root密码(密码输入无任何回显,摸黑输入)
#若提示 无效的密码: 密码包含用户名在某些地方 请忽略该提示,再次输入密码即可更改成功
#英文版
[root@localhost ~]# passwd root
Changing password for user root.
New password:
BAD PASSWORD: The password contains the user name in some form
Retype new password:
passwd: all authentication tokens updated successfully.