你如何安装 FreeBSD10 内核源代码?

nix*_*nix 18 freebsd kernel

我正在尝试运行 freebsd10 的更新,但我被要求提供内核源代码

===>>> Launching child to update lsof-4.89.b,8 to lsof-4.89.d,8

===>>> All >> lsof-4.89.b,8 (9/9)

===>>> Currently installed version: lsof-4.89.b,8
===>>> Port directory: /usr/ports/sysutils/lsof

        ===>>> This port is marked IGNORE
        ===>>> requires kernel sources


        ===>>> If you are sure you can build it, remove the
               IGNORE line in the Makefile and try again.

===>>> Update for lsof-4.89.b,8 failed
===>>> Aborting update
Run Code Online (Sandbox Code Playgroud)

但 sysinstall 不再存在

sysinstall: not found
Run Code Online (Sandbox Code Playgroud)

在 FreeBSD10 中安装内核源代码的新方法是什么?

我想 bsdinstall,但它只是试图切碎我不想要的磁盘 在此处输入图片说明

小智 39

您可以从ftp://ftp.freebsd.org/pub/FreeBSD/releases/手动下载并提取特定版本的完整源代码树的 tarball

例如

获取ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/10.2-RELEASE /src.txz

tar -C / -xzvf src.txz

10.2-RELEASE 必须用正确版本的操作系统替换。

可以使用命令查找版本: freebsd-version -k

要从上述 URL 获取,应忽略次要版本。例如:如果是10.2-RELEASE-p1,只需使用:10.2-RELEASE

  • 适用于 FreeBSD 11.2。 (2认同)

Cra*_*ump 12

更通用的解决方案:

fetch -o /tmp ftp://ftp.freebsd.org/pub/`uname -s`/releases/`uname -m`/`uname -r | cut -d'-' -f1,2`/src.txz

tar -C / -xvf /tmp/src.txz
Run Code Online (Sandbox Code Playgroud)

你可以/tmp用你最喜欢的目录替换来下载东西。

或者:

svn checkout https://svn.freebsd.org/base/releng/`uname -r | cut -d'-' -f1,1` /usr/src
Run Code Online (Sandbox Code Playgroud)


Per*_*ulf 6

你能行的:

git clone https://github.com/freebsd/freebsd.git /usr/src
cd /usr/src; make clean
Run Code Online (Sandbox Code Playgroud)

  • 对于未来的搜索者,这将减少从源代码实际构建不需要的*大量*数量的额外数据(git 内容)。J. Delgado 的答案是规范且最有效的方法。 (2认同)