Skip to main content

树莓派食用指南

烧录

MacOS

查看当前已挂载的卷:

df -h

使用 diskutil unmount 将这些分区卸载:

diskutil unmount /dev/disk1s1

通过 diskutil list 来确认设备:

diskutil list

使用 dd 命令将系统镜像写入,需要特别特别注意 disk 后的数字,不能搞错! (说明:/dev/disk1s1 是分区,/dev/disk1 是块设备,/dev/rdisk1 是原始字符设备)

dd bs=4m if=wheezy-raspbian.img of=/dev/rdisk1

用 diskutil unmountDisk 卸载设备:

diskutil unmountDisk /dev/disk1

安装

How to install Ubuntu Server on your Raspberry Pi | Ubuntu

用户名/密码

ubuntu
ubuntu

ubuntu
Luan1234
x@madland:/mnt/c/WINDOWS/system32$ ssh [email protected]
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-1021-raspi armv7l)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

System information as of Sat Oct 24 15:49:44 UTC 2020

System load: 0.16 Temperature: 39.5 C
Usage of /: 32.7% of 6.97GB Processes: 126
Memory usage: 26% Users logged in: 0
Swap usage: 0% IPv4 address f or eth0: 192.168.0.104

* Introducing autonomous high availability clustering for MicroK8s
production environments! Super simple clustering, hardened Kubernetes,
with automatic data store operations. A zero-ops HA K8s for anywhere.

https://microk8s.io/high-availability

60 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable

Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings


*** System restart required ***
Last login: Sat Oct 24 15:49:07 2020 from 192.168.0.102
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

配置

镜像源

ubuntu-ports | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

apt_preserve_sources_list: true

设置静态 ip

ssh [email protected]
Luan1234
sudo ifconfig eth0 192.168.1.222 netmask 255.255.255.0

sudo route add default gw 192.168.1.1

sudo ifconfig eth0 up

修改 /etc/network/interfaces

sudo vim /etc/network/interfaces

修改为:

auto lo

iface lo inet loopback

iface eth0 inet static

address 192.168.1.222

netmask 255.255.255.0

gateway 192.168.1.1

allow-hotplug wlan0

iface wlan0 inet manual

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

重启服务

sudo service networking restart

DNS

sudo cat /etc/resolv.conf

改成类似的即可

nameserver 8.8.8.8

nameserver 8.8.4.4

nameserver 208.67.220.220

nameserver 208.67.222.222

nameserver 10.10.10.10

root@raspberrypi:~# sudo service networking restart

自定义分辨率

http://shumeipai.nxez.com/2013/08/31/custom-display-resolution-raspberry-pie.html

修改config.txt文件

  • 修改 overscan 选项
# uncomment this if your display has a black border of unused pixels visible and your display can output without overscan

disable_overscan=1

  • 修改屏幕分辨率
# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=1280
framebuffer_height=1024
  • 修改屏幕属性

hdmi_group=2 选择计算机显示器分辨率。hdmi_mode=35 选择屏幕分辨率和刷新屏幕。 hdmi_ignore_edid=0xa5000080 命令树莓派不检测 HDMI 设备的任何信息,按照指定的分辨率输出。

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=35
hdmi_ignore_edid=0xa5000080

官方镜像 Raspbian

sudo raspi-config

系统层

应用层

MicroK8s | K3s

https://zhuanlan.zhihu.com/p/85375349

实例

docker 运行 openwrt 实现旁路由

https://blog.sillyson.com/archives/7.html

https://github.com/SuLingGG/OpenWrt-Rpi

https://sspai.com/post/58452

Home Assistant

https://www.home-assistant.io/docs/installation/docker/

硬件 | hack | DIY