在 Raspberry Pi,我们正努力将尽可能多的代码开源,以便于您使用并根据自身需求进行调整。Raspberry Pi 专门针对我们的产品开发和提供支持软件,并将精力集中于能提供最佳用户体验的软件。例如,优化多媒体加速的驱动程序,如 3D、HEVC 解码、相机成像流水线、AI 加速、双 HDMI 和音频。

在 Raspberry Pi OS 中查找软件源

在查找随 Raspberry Pi OS 分发的软件时,通常会发现我们对上游软件源进行补丁修改以创建下游软件包(那些标记为+rpt). To view the source for those packages it’s usually easier to fetch through apt. To do this, you first need to edit your apt lists to include the source packages. Edit the following files to change each "Types: deb" line to "Types: deb deb-src":

  • /etc/apt/sources.list.d/debian.sources (on 64-bit images) or

  • /etc/apt/sources.list.d/raspbian.sources (on 32-bit images) and

  • /etc/apt/sources.list.d/raspi.sources

接下来,您必须更新软件包列表:

$ sudo apt update

现在您可以获取软件包源代码,例如:

$ apt source labwc

接下来,您需要安装一个辅助软件包:

$ sudo apt install devscripts

最后,您可以使用标准的 Debian 构建流程来构建该软件包。

$ sudo apt build-dep labwc
$ cd labwc-0.8.4
$ debuild -uc -us

我们的 GitHub 组织

另一个能以更标准的形式找到我们软件的地方是我们的 GitHub 仓库;我们使用三个 GitHub 组织来发布我们的源代码:

我们还在以下组织发布与我们的图书和杂志相关的内容:

分类源代码列表

以下是大多数人感兴趣的精选仓库列表:

主要源代码

https://github.com/raspberrypi/linux

该仓库包含下游 Linux 内核的源代码,该内核受支持并可在 Raspberry Pi 1 到 5 的所有版本上运行。

https://github.com/raspberrypi/firmware

该仓库包含闭源固件,不过以下两个链接很有用:

https://github.com/raspberrypi/rpi-eeprom

Raspberry Pi 4 和 Raspberry Pi 5 引导加载程序 EEPROM 的安装脚本和二进制文件,包括发布和发行说明.

库和应用程序

https://github.com/raspberrypi/utils

一组实用工具集合,如 pinctrl、piolib 和 raspinfo,以及 gpiolib,这是一种受 Raspberry Pi 支持的直接访问 GPIO 引脚的方法。

https://github.com/raspberrypi/libcamera

用于控制 Raspberry Pi 设备的 ISP 和摄像头的 libcamera 库实现。

https://github.com/raspberrypi/rpicam-apps

一套 C++ 库和应用程序套件,用于使用 libcamera 通过 Raspberry Pi 摄像头进行图像/视频处理和编码。

https://github.com/raspberrypi/picamera2

用于使用和控制 Raspberry Pi 摄像头的 Python 库。

https://github.com/raspberrypi/drmu

用于直接控制和访问多媒体接口的库。

桌面

https://github.com/raspberrypi-ui/rpd-metas

用于创建桌面的元包。

https://github.com/raspberrypi-ui/wf-panel-pi

运行基于 Wayland 的桌面时屏幕上显示的任务栏或程序坞。

https://github.com/raspberrypi-ui/lxpanel-pi

运行旧版基于 X 的桌面时屏幕顶部显示的任务栏。

https://github.com/raspberrypi-ui/pplug-batt
https://github.com/raspberrypi-ui/pplug-bluetooth
https://github.com/raspberrypi-ui/pplug-clock
https://github.com/raspberrypi-ui/pplug-cpu
https://github.com/raspberrypi-ui/pplug-cputemp
https://github.com/raspberrypi-ui/pplug-ejecter
https://github.com/raspberrypi-ui/pplug-gpu
https://github.com/raspberrypi-ui/pplug-menu
https://github.com/raspberrypi-ui/pplug-netman
https://github.com/raspberrypi-ui/pplug-power
https://github.com/raspberrypi-ui/pplug-updater
https://github.com/raspberrypi-ui/pplug-volumepulse

显示在任务栏上的小部件。

https://github.com/raspberrypi-ui/pcmanfm
https://github.com/raspberrypi-ui/libfm

桌面使用的文件管理器,同时也用于显示桌面背景。

https://github.com/raspberrypi-ui/rpcc

控制中心应用程序。

https://github.com/raspberrypi-ui/rc_gui

控制中心的 Raspberry Pi 配置插件。

https://github.com/raspberrypi-ui/appset

控制中心的外观设置插件。

https://github.com/raspberrypi-ui/rasputin

控制中心的鼠标和键盘设置插件。

https://github.com/raspberrypi-ui/raindrop

控制中心的屏幕配置插件。

https://github.com/raspberrypi-ui/rpinters

控制中心的打印机设置插件。

应用程序

https://github.com/raspberrypi-ui/agnostices

用于检查 SD 卡的诊断应用程序。

https://github.com/raspberrypi-ui/bookshelf

Bookshelf 应用程序的代码,该应用允许您下载并阅读电子书以及 Raspberry Pi Official Magazine 的往期期刊。

https://github.com/raspberrypi-ui/piclone

SD Card Copier 应用程序,可用于克隆存储卡和驱动器。

https://github.com/raspberrypi-ui/rp-prefapps

Recommended Software 应用程序,可用于安装或卸载选定程序。

调试

https://github.com/raspberrypi/rpi-analyse-boot

一项启动分析服务,可从各种不同的来源收集启动时间指标。

工具

https://github.com/raspberrypi/rpi-imager

Raspberry Pi Imager 应用程序的代码,用于将操作系统烧录到 SD 卡。

https://github.com/raspberrypi/rpi-image-gen

一个构建系统,用于为嵌入式 Raspberry Pi 系统开发操作系统。

https://github.com/raspberrypi/usbboot

一款通过 USB 启动 Raspberry Pi 的工具,用于配置 Compute Module 和 Raspberry Pi 设备。

https://github.com/raspberrypi/rpi-sb-provisioner

一款用于批量配置 Raspberry Pi 设备的工具,支持安全启动和加密文件系统。(支持 Raspberry Pi 5、Compute Module 4 和 Compute Module 5。)

反馈

https://github.com/raspberrypi/trixie-feedback

一个专门用于报告当前 Raspberry Pi OS 版本缺陷的代码库。

树莓派 Pico

https://marketplace.visualstudio.com/items?itemName=raspberry-pi.raspberry-pi-pico

您可以在此处下载并安装适用于 Raspberry Pi Pico SDK 的 Microsoft Visual Studio Code 扩展。

https://github.com/raspberrypi/pico-setup

适用于命令行使用的 Raspberry Pi Pico SDK 快速入门安装工具。

https://github.com/raspberrypi/pico-sdk

Raspberry Pi Pico SDK 源代码。

https://github.com/raspberrypi/debugprobe

Raspberry Pi Debug Probe 的源代码,可轻松提供 SWD 和 UART 支持。

https://github.com/raspberrypi/openocd

Raspberry Pi 下游 OpenOCD 源代码。

https://github.com/raspberrypi/pico-examples

Raspberry Pi Pico 示例。

https://github.com/raspberrypi/picotool

用于在 BOOTSEL 模式下与 RP 系列设备进行交互的工具。