22.12 code-server 和 clangd
服务器启用 Linux 二进制兼容,并部署 archlinux-bootstrap 镜像
# service linux enable # 设置 Linux 兼容层服务开机自启
# service linux start # 启动 Linux 兼容层服务
# fetch -o /tmp https://mirrors.bfsu.edu.cn/archlinux/iso/latest/archlinux-bootstrap-x86_64.tar.zst # 下载 Arch Linux bootstrap 镜像到 /tmp
# tar --use-compress-program=unzstd -xpvf archlinux-bootstrap-x86_64.tar.zst -C /tmp --numeric-owner # 解压 Arch Linux bootstrap 镜像到 /tmp
# rm archlinux-bootstrap-x86_64.tar.zst # 删除下载的压缩包
# cp -Rf /tmp/root.x86_64/* /compat/linux # 复制解压后的文件到 FreeBSD Linux 兼容目录服务器配置 pacman 源,并添加 archlinuxcn 仓库
[options]
Architecture = auto
ParallelDownloads = 5
[core]
Server = https://mirrors.cernet.edu.cn/archlinux/\$repo/os/\$arch
SigLevel = Required DatabaseOptional
[extra]
Server = https://mirrors.cernet.edu.cn/archlinux/\$repo/os/\$arch
SigLevel = Required DatabaseOptional
[archlinuxcn]
Server = https://mirrors.cernet.edu.cn/archlinuxcn/\$arch
SigLevel = Required DatabaseOptional服务器初始化 Arch Linux 运行时环境
服务器更新 Arch Linux 运行时环境,并安装 code-server
服务器删除 Arch Linux 运行时环境中的无用目录
服务器安装 LLVM 与 clangd 插件
服务器通过 daemon 命令启动 code-server
客户端通过 SSH 建立隧道并通过浏览器连接到 code-server 服务器
(示例)浏览器中用 code-server 打开 FreeBSD 的源码树
(示例)在浏览器中编译最小化内核并生成 compile_commands.json 文件
compile_commands.json 文件自动化安装脚本
FAQ 常见问题
为什么要有这篇教程?
为什么要用 Arch Linux 兼容层?
兼容层?那还能用来搞 FreeBSD 的开发吗?
为什么 clangd 以及其他开发工具全部由 FreeBSD 提供?
还有什么需要补充的内容?
你这是在鼓励用户当 root 敢死队?
最后更新于