以 pve-release-6.x ,基于 debian buster 为例:
- Step1: 配置国内 PVE 镜像源
# 配置 pve 软件包国内镜像源
$ echo "deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian buster pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
$ wget https://enterprise.proxmox.com/debian/proxmox-ve-release-6.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-6.x.gpg
- Setp2:安装依赖包
Install build dependencies (i got these from the pve-kernel/debian/control file):
apt install asciidoc-base automake bc bison cpio debhelper dh-python file flex gcc git kmod libdw-dev libelf-dev libiberty-dev libnuma-dev libpve-common-perl libslang2-dev libssl-dev libtool lintian lz4 perl-modules python-minimal rsync sed sphinx-common tar xmlto zlib1g-dev
- Step3:获取 pve-kernel 源码
Clone proxmox-kernel
git clone https://git.proxmox.com/git/pve-kernel.git
- Step4:初始化子项目
initialize the submodules
make submodule
If that fails Fabian told me that you have cd in each submodule and do "git fetch --tags"
- Step5:编译
make
It will build with ALL cores
会自动编译,不需要设置多线程,它会自动调用多线程编译。编译完当前目录的 .deb
包就是内核包,直接使用 dpkg -i
安装即可。
Q&A
- dwarves_1.20 too old
echo 'deb http://ftp.de.debian.org/debian sid main' > /etc/apt/sources.list
sudo apt-get update
sudo install dwarves
- 磁盘空间不足,扩容
# 查看当前磁盘的分区形式,确定新磁盘的盘符
$ fdisk -l
# 开始分区(以 /dev/vda 为例)
$ fdisk /dev/vda
# 键入 n 继续,保持默认即可
# 键入 p 查看分区
# 键入 w 将分区写入分区表
# 将分区表同步到系统
$ partprobe
# 设置新分区的格式(以 /dev/xvda6 为例)
$ mkfs -t ext4 /dev/xvda6
# 将新分区挂载 (以 /opt 为例)
$ mount /dev/xvda6 /opt
# 查看挂载结果
$ df -TH
参考文献
- [[TUTORIAL] Building the PVE kernel on Proxmox VE 6.x](https://forum.proxmox.com/threads/building-the-pve-kernel-on-proxmox-ve-6-x.76137/) by r.jochum
- 用在 AMD64 上 dwarves_1.20-1_amd64.deb 的下载页面
- Linux磁盘扩容后处理(fdisk) by 华为云
- (二)编译PVE内核5.10.6-1-pve及安装内核补丁fullconeNat
- Proxmox 镜像使用帮助 By tuna
- Package Repositories By PVE