home-assistant/operating-system
GitHub: home-assistant/operating-system
一款基于 Buildroot 构建的轻量级 Linux 操作系统,专为在单板计算机和 x86-64 设备上高效托管 Home Assistant 智能家居平台而优化。
Stars: 7211 | Forks: 1252
# Home Assistant Operating System
Home Assistant Operating System(前称 HassOS)是一个基于 Linux 的操作系统,经过优化以托管 [Home Assistant](https://www.home-assistant.io) 及其[应用](https://www.home-assistant.io/apps/)。
Home Assistant Operating System 使用 Docker 作为其容器引擎。默认情况下,它将 Home Assistant Supervisor 作为一个容器进行部署。Home Assistant Supervisor 进而使用 Docker 容器引擎在不同的独立容器中控制 Home Assistant Core 和 Apps。Home Assistant Operating System **并非**基于像 Ubuntu 这样的常规 Linux 发行版。它是使用 [Buildroot](https://buildroot.org/) 构建的,并且经过优化以运行 Home Assistant。它的目标设备是像 Raspberry Pi 或 ODROID 这样的单板计算机 (SBC),但也支持具备 UEFI 的 x86-64 系统。
## 特性
- 轻量级且内存高效
- 最小化 I/O
- OTA (Over The Air) 更新
- 离线更新
- 使用 Docker 容器引擎实现模块化
## 支持的硬件
支持的硬件列表由 [ADR-0015](https://github.com/home-assistant/architecture/blob/master/adr/0015-home-assistant-os.md) 定义。
每项新增硬件都必须至少满足 [ADR-0017](https://github.com/home-assistant/architecture/blob/master/adr/0017-hardware-screening-os.md) 中规定的要求,并通过架构设计提案。
有关各个受支持板卡详细信息的文档,请参阅 Home Assistant 开发者文档中的[板卡支持](https://developers.home-assistant.io/docs/operating-system/boards/overview)章节。
## 快速入门
如果您只是想使用 Home Assistant,官方的[快速入门指南](https://www.home-assistant.io/getting-started/)和[安装说明](https://www.home-assistant.io/hassio/installation/)将引导您如何下载 Home Assistant Operating System 并在您的设备上运行它。
如果您有兴趣进一步了解 Home Assistant Operating System 及其工作原理,请继续阅读...
## 开发
如果您没有嵌入式系统、Buildroot 或 Linux 发行版构建过程的相关经验,建议先阅读这些主题的相关资料(例如 [Bootlin](https://bootlin.com/docs/) 提供了极佳的资源)。
Home Assistant Operating System 的文档可以在 [Home Assistant 开发者文档网站](https://developers.home-assistant.io/docs/operating-system)上找到。
### 组件
- **Bootloader:**
- 支持 UEFI 的设备使用 [GRUB](https://www.gnu.org/software/grub/)
- 不支持 UEFI 的设备使用 [U-Boot](https://www.denx.de/wiki/U-Boot)
- **操作系统:**
- [Buildroot](https://buildroot.org/) LTS Linux
- **文件系统:**
- 只读文件系统使用 [SquashFS](https://www.kernel.org/doc/Documentation/filesystems/squashfs.txt)(使用 LZ4 压缩)
- `/tmp`、`/var` 和 swap 使用 [ZRAM](https://www.kernel.org/doc/Documentation/blockdev/zram.txt)(使用 LZ4 压缩)
- **容器平台:**
- 使用 [Docker Engine](https://docs.docker.com/engine/) 在容器中运行 Home Assistant 组件
- **更新:**
- 使用 [RAUC](https://rauc.io/) 进行 OTA (Over The Air) 和 USB 更新
- **安全:**
- [AppArmor](https://apparmor.net/) Linux 内核安全模块
### 开发构建
开发构建的 GitHub Action 工作流是一个手动触发的工作流,
它会创建 Home Assistant OS 开发构建版本。这些开发构建版本可以在
[https://os-artifacts.home-assistant.io/index.html](https://os-artifacts.home-assistant.io/index.html) 获取。
标签:Docker, 单板计算机, 安全防御评估, 操作系统, 智能家居, 物联网