技术信息
本页面提供了 Fedora Silverblue 相关的背景技术信息,包括采用的核心技术和文件系统组织结构。
一般用户无需了解这些信息,本页面仅为那些对 Fedora Silverblue 实现细节感兴趣的开发者准备。
ostree 和 rpm-ostree
ostree 是构建、部署和更新 Fedora Silverblue 所采用的关键技术。ostree 的工作原理和常见的版本控制系统差不多,但是 ostree 掌管的是整个文件系统目录树。我们也常常称之为『一个管理系统二进制文件的 Git 系统』。
对于 Fedora Silverblue 而言,ostree 会被用于部署和更新系统映像(也就是 /
下没有被链接到 /var
的所有目录)。ostree 也被用于更新 grub.cfg
以使新系统出现在引导选单。
rpm-ostree 基于 ostree 而来,它使得在 ostree 映像上层叠 RPM 成为可能。在 Fedora Silverblue 安装 RPM 也是通过 rpm-ostree 实现的。
当你通过 rpm-ostree
安装软件,层叠了有关 RPM 包的新系统映像也会随之构建。要使 RPM 安装生效,你需要重启系统以实用新的系统映像。在更新系统映像时,rpm-ostree 也会妥善处理层叠的软件包。
Fedora Silverblue 文件系统组织结构
On Fedora Silverblue, the root filesystem (/
) is immutable. The /usr
directory and everything below it is read-only.
The /etc
and /var
directories are respectively used to store configuration files and runtime state and are thus writable. Symlinks are used to make traditional state-carrying directories available in their expected locations. This includes:
-
/home
→/var/home
-
/opt
→/var/opt
-
/srv
→/var/srv
-
/root
→/var/roothome
-
/usr/local
→/var/usrlocal
-
/mnt
→/var/mnt
-
/tmp
→/sysroot/tmp
这意味着用户目录分区应该被挂载到 /var/home
。
Since Fedora Linux 37, the /sysroot
directory is also mounted read-only.
The /boot
and /boot/efi
directories are currently also mounted as writable but there are plans to mount them read-only in the future or even not mount them at all. See Mount /boot as Read Only by default and Do not mount /boot/efi by default.
For a more detailed explanation of Fedora Silverblue’s filesystem layout, refer to the libostree documentation.
Want to help? Learn how to contribute to Fedora Docs ›