文章目录
学习记录
给树莓派4重刷了一遍镜像,整理一下过程。
下载镜像
2019-09-26-raspbian-buster.img
下载相关工具
SDFormatter
Win32DiskImager
烧录镜像
使用SDFormatter格式化SD卡,使用Win32DiskImager烧录镜像
开启SSH
在boot路径下新建SSH空文件
开机
插卡上电开机,接入网线,通过路由器查询IP,使用xshell的ssh连接树莓派。
用户名 pi
密码 raspberry
开VNC
sudo raspi-config
打开VNC,设置分辨率,重启
开启图形化时代
开机设置
设置国家,中国,汉语,上海,使用英语作为默认语言,使用US键盘
设置mima
填充屏幕
选择wifi
更新(建议跳过,换源后更新)
改语言
sudo raspi-config
Internationalisation Options->change_locale
利用键盘上下键(也可以用 page down / PgDn 翻页),
空格键可以去掉或者选择
取消勾选”en_GB.UTF-8 UTF-8“
勾选”en_US.UTF-8 UTF-8“,”zh_CN.UTF-8 UTF-8“,”zh_CN.GBK GBK这三个选项“
使用 TAB 键,将光标移动到”OK“,然后敲回车
将光标移动到”zh_CN UTF-8“,然后回车
理论上重启生效
实测没用,最终在图形化界面修改后,重启生效
装输入法
换源
装vim
装GCC
默认安装了
gcc -v
查看是否安装GCC
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/8/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 8.3.0-6+rpi1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 8.3.0 (Raspbian 8.3.0-6+rpi1)
装wiringPi库
默认安装wiringPi库。使用命令查看
gpio -v
如下回复表示已经安装wiringPi库
gpio version: 2.50
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
Raspberry Pi Details:
Type: Unknown17, Revision: 01, Memory: 0MB, Maker: Sony
* Device tree is enabled.
*--> Raspberry Pi 4 Model B Rev 1.1
* This Raspberry Pi supports user-level GPIO access.
配置VIM
头部配置
高亮配置
将vimconfig.tar.gz文件传输到树莓派系统的文件中。
tar xvf vimconfig.tar.gz 解压压缩包。
进入vimconfig目录中运行config.sh脚本。
会出现错误,正常。接着操作。
在/root/目录下新建.vim和.vimrc文件,安装apt-get install ctags即可 。
注意关set mouse=a
系统备份
系统备份太重要了,要不然也不会有这篇博客
Win32DiskImager备份
先新建一个空白的.img后缀的文件,然后Win32DiskImager选择直接read就可以备份系统了,到时再重装就可以恢复了。
缺点
占用空间太大,备份是整卡备份,得到的IMG是卡的大小,只能还原到原卡或大于原卡的卡。