Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contents(FreeBSD): Add usage information for poudriere build system #188

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion contents/FreeBSD-pkg.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: FreeBSD pkg 镜像使用帮助
cname: 'FreeBSD-pkg'
cname: "FreeBSD-pkg"
---

本镜像收录了自 FreeBSD 10 以后的版本,包括 quarterly 和滚动更新的 latest 仓库。
Expand All @@ -9,6 +9,8 @@ FreeBSD 9 以前的版本不支持新的 pkg 包管理器(pkgng),请升级

## 使用方法

### FreeBSD pkg

FreeBSD pkg 包管理器的官方源配置是 `/etc/pkg/FreeBSD.conf` ,请先检查该文件内容。注意其中的 `url` 参数配置了官方仓库的地址,我们需要把它替换为镜像站的地址。

该配置文件是 FreeBSD 基本系统的一部分,会随着 `freebsd-update` 更新,请不要直接修改,而是创建 `/usr/local/etc/pkg/repos/FreeBSD.conf` 覆盖配置,文件内容如下:
Expand All @@ -27,3 +29,23 @@ FreeBSD: {

注:使用 HTTPS 可以有效避免国内运营商的缓存劫持,但需要事先安装 `security/ca_root_nss` 软件包。

### Ports Collection & Poudriere

如果使用 [poudriere](https://github.com/freebsd/poudriere) 构建 `ports` 软件包,可以更改 `/usr/local/etc/poudriere.conf +374`,使用镜像站来获取二进制软件包。

<CodeBlock>
```
# Set to always attempt to fetch packages or dependencies before building.
# XXX: This is subject to change
# Default: off; requires -b <branch> for bulk or testport.
# PACKAGE_FETCH_BRANCH=latest
# The branch will be appended to the URL:
PACKAGE_FETCH_URL={{http_protocol}}{{mirror}}/\${ABI}
```
</CodeBlock>

同样,使用 HTTPS 需要 `security/ca_root_nss`。

更改后,运行 `poudriere bulk` 时会报错:`No SRV record found for the repo`,此报错无害,不影响使用。

关于 `PACKAGE_FETCH_*` 的更多使用方法和配置可参考 `/usr/local/etc/poudriere.conf.sample`。