Raspberry Pi 3 Model B 入坑
(开机之前加散热片: 正面的 CPU 用铜的, 小一点的 USB/网卡控制器用铝散热片. 反面内存没有贴. 希望这是对的)
手里的是 v1.2 RS (英版). element14 应该是天朝版?
初级:
用 win32diskimager 向 SD 卡(推荐 4G 以上)中写入 Raspbian Jessie Lite https://www.raspberrypi.org/downloads/raspbian/ 写入后往 fat32 分区下建立 ssh 文件以启动 ssh 支持. 可以同时加入 wpa_supplicant.conf 写入 wpa psk (用 wpa_passphrase SSID [PASS] 生成), 会自动复制到位. user: pi / raspberry
在有显示器的环境下运行 raspi-config 可以调整一些事情. 大致应该是 console-setup(keymap), locales, timezone, wireless CRDA 一套, 默认的镜像都是 UK 的.
---
中级:
/boot/config.txt 保存了一些参数. 目前有动的大概是这些(GPU Mem 调大是为了以后测试 h264_omx 和 h264_mmal):
gpu_mem=128 force_turbo=0 #program_usb_boot_mode=1
更换 f2fs 和 USB Boot
虽然这里给出的是 USB Boot 的文档, 装上 f2fs-tools 之后再迁移. 替换 mkfs.ext4 为 mkfs.f2fs, 并修改 /etc/fstab 和 /boot/cmdline.txt 的 root 和 rootfstype. https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md
升级内核 (bootloader, kernel, sdk 等好像统称 firmware) https://github.com/Hexxeh/rpi-update 可能需要 env RPI_UPDATE_UNSUPPORTED=0 UPDATE_SELF=0 略. 更新后内核会变为 https://github.com/Hexxeh/rpi-firmware 所示版本(4.9.xx).
sysctl.conf 修改
vm.swappiness = 1 vm.min_free_kbytes = 8192
---
高级: 64bit kernel 是有的但不要用! 这种弱机器上 64bit 性能在原则上没有帮助.
更换系统 (检讨中, 未实施) raspbian 系统添加的包大概是这些: ii libraspberrypi-bin 1.20170405-1 armhf Miscellaneous Raspberry Pi utilities ii libraspberrypi-dev 1.20170405-1 armhf EGL/GLES/OpenVG/etc. libraries for the Raspberry Pi's VideoCore IV (headers) ii libraspberrypi-doc 1.20170405-1 armhf EGL/GLES/OpenVG/etc. libraries for the Raspberry Pi's VideoCore IV (headers) ii libraspberrypi0 1.20170405-1 armhf EGL/GLES/OpenVG/etc. libraries for the Raspberry Pi's VideoCore IV ii raspberrypi-bootloader 1.20170405-1 armhf Raspberry Pi bootloader ii raspberrypi-kernel 1.20170405-1 armhf Raspberry Pi bootloader ii raspberrypi-sys-mods 20170313 all System tweaks for the Raspberry Pi ii raspi-config 20170307 all Raspberry Pi configuration tool
如果没有想错的话, 只需要保留 raspberrypi-sys-mods 和 raspi-config 即可. 标明版本 20170405 的那些都可以通过 rpi-update 更新.
其它有用的包应该包括: fake-hwclock (ntp/ntpdate 也不能缺少, 没有硬件时钟只能这样) triggerhappy (默认启动) python-rpi.gpio dphys-swapfile (100MB 的 swap, 放在 /var/swap 里) raspi-copies-and-fills (一组 memset 和 memcpy 的实现, 好像用了可能会引起兼容性问题, 可以不装?) pi-bluetooth (systemd 的服务, 最终启动 hciattach 启动蓝牙) bluez-firmware (有可能和 bluez 一起必须使用 raspbian 版本, 参考 https://github.com/raspberrypi/linux/issues/1314 , 主要区别就是 /lib/firmware/BCM43430A1.hcd 及 firmware loader)
这里可能漏掉了声音的问题. asound? / alsa 可能也需要定制版.
echo "PACKAGE hold" | sudo dpkg --set-selections (hold 换成 install 可以解除, 或者用 apt-mark hold/unhold)
wpa_supplicant, openssh-server, dhcpcd/isc-dhcp-client, sudo 啥的就不提了吧... ---
Ubuntu 的装法:
add-apt-repository ppa:ubuntu-pi-flavour-makers/ppa # 注意: source.list 需要改为 xenial, apt-get update 略 # 可以添加 rpi-update. 直接挪用以前的 /lib/modules 和 /boot 的情况无需再装. apt-get install bluez=5.41-0ubuntu3~xenial1.1 bluez-firmware=1.2-3+rpi1~xenial1.0 pi-bluetooth raspi-config raspberrypi-sys-mods # 无线 firmware wget --directory-prefix=/lib/firmware/brcm/ \ https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm80211/brcm/brcmfmac43430-sdio.bin https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm80211/brcm/brcmfmac43430-sdio.txt
systemd 有坑, 在 /boot/cmdline.txt 加入 net.ifnames=0
---
基本感想是性能弱归弱, 但比当年的 (2010 前后) Atom N270/280/450 之流要强了. crypto 支持如同没有, 这样在 geekbench4 会掉 1/4 的分数, 加回来的话单核也许就是 Intel Haswell 0.6GHz 的水平. 既然还能做 1080p 显示器的亮机卡, 就对得起价钱不是? Android 支持没有就没有吧, 又不会特别在意这个事.