[TUTORIAL] Building the PVE kernel on Proxmox VE 6.x

r.jochum

Renowned Member
Mar 26, 2018
290
48
68
38
Austria
rene.jochum.dev
Hi,

i just had the need to build the Proxmox by myself (to patch it) and want to document the steps made here:

1. Install build dependencies (i got these from the pve-kernel/debian/control file):

Code:
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

2. Clone proxmox-kernel

Code:
git clone https://git.proxmox.com/git/pve-kernel.git

3. initialize the submodules

Code:
make submodule

If that fails Fabian told me that you have cd in each submodule and do "git fetch --tags"

4. Make the kernel

Code:
make

It will build with ALL cores
 
  • Like
Reactions: James Crook
1. Install build dependencies (i got these from the pve-kernel/debian/control file):

You could also install the devscripts package, and then do mk-build-deps --install debian/control.in, this uses the maintained information from control directly, avoiding posting soon to be outdated lists ;-)

But, the devscripts package pulls in a lot of stuff, so it may be an overkill for a single build.

3. initialize the submodules

A plain make call should do this already as the kernel source prepare step depends on the submodule target.
If that's not the case we can fix this.

If that fails Fabian told me that you have cd in each submodule and do "git fetch --tags"

Just do:
Bash:
git submodule foreach git fetch --tags
git submodule update --init

To ensure a recent and cleanly checked out submodule.
 
You could also install the devscripts package, and then do mk-build-deps --install debian/control.in, this uses the maintained information from control directly, avoiding posting soon to be outdated lists ;-)

But, the devscripts package pulls in a lot of stuff, so it may be an overkill for a single build.

apt build-dep ./ also works, but directly installs the build dependencies instead of generating a meta package that you can easily uninstall (followed by apt autoremove to remove the pulled-in build-dependencies)
 
Could you replace that in the Makefile so "make" always works?

No, we normally only want to do this for the first build after clone, to initially initialize the submodules.
Else, you make testing other commits in the submodule not easy to do, as the build system always checks out the recorded commit from gitmodules.
We could maybe add an extra makefile target for that, though.
 
Good morning,
I am attempting to build a custom Proxmox kernel following these instructions. I have attempted to utilize many other tutorials from Fabian's Edge kernels and proxmox with all ending up in some sort of build error (not disk full). So I am now asking for help as I have spent much time googling, reading and testing different strategies/variations. To be certain I was following the right directions I have just attempted to build a standard 5.11.x kernel using a brand new ProxMox ve 6.4-9 build installed from the ISO. After installing proxmox I removed the enterprise repository and added the free repository. Updated using 'apt dist-upgrade'. Then to create my build environment:
Code:
apt update
apt install devscripts debhelper equivs git
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dwarves-dfsg/dwarves_1.17-1_amd64.deb
dpkg -i dwarves_1.17-1_amd64.deb
git clone https://git.proxmox.com/git/pve-kernel.git
cd pve-kernel
mk-build-deps --install debian/control.in
make

making as root it wants to error out at:

Bash:
     drivers/media/dvb-frontends/zl10036    : 1
II: Done
make[2]: *** [debian/rules:280: abicheck] Error 1
make[2]: Leaving directory '/home/michael/pve-kernel/build'
make[1]: *** [debian/rules:105: binary] Error 2
make[1]: Leaving directory '/home/michael/pve-kernel/build'
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
make: *** [Makefile:59: pve-kernel-5.11.22-1-pve_5.11.22-1_amd64.deb] Error 2

Making as user it errors out at:
Code:
make[1]: Leaving directory '/home/michael/pve-kernel/build'
 fakeroot debian/rules binary
make[1]: Entering directory '/home/michael/pve-kernel/build'
dh_installdocs -A debian/copyright debian/SOURCE
dh_installdocs: open debian/.debhelper/generated/linux-tools-5.11/installed-by-dh_installdocs: Permission denied
make[1]: *** [debian/rules:97: install] Error 13
make[1]: Leaving directory '/home/michael/pve-kernel/build'
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2
make: *** [Makefile:59: pve-kernel-5.11.22-1-pve_5.11.22-1_amd64.deb] Error 2


Any guidance or recommendations would be greatly appreciated.

Thanks in advance,
Mike
 
are you building a buster compatible branch? there should not be a need to install dwarves from a random ubuntu repo..

make[2]: *** [debian/rules:280: abicheck] Error 1

indicates that the ABI of the built kernel did not match the expected one (maybe the submodule and the main repo state were not in sync?)

the second attempt sounds like you did not clean your build directory when switching from building as root to building as regular user.


without more of the build log it's hard to tell for sure what's going on..
 
  • Like
Reactions: marcosscriven
So installed the proxmox 7 beta and the kernel built without any issues. Now for the newbie question of the day. How the heck do I get the git clonning process to identify and download the correct kernels builds.
 
I am not sure what you mean with "correct" - the built kernel packages provided in our package repositories ship a file called SOURCE in /usr/share/doc/pve-kernel-X.Y.Z-N-pve/ which contains the git commit they were built from, if you are looking for this mapping?
 
I actually thought I deleted this message, as I figured put my problem. It had to due with using git checkout to switch from master to the correct kernel.
 
Hi,

I'm giving this a try, I need to compile support for "USB gadget" for a PC to PC connection using the host's USB 3.1 port to bypass the slow gigabit ethernet networking.

I've download the pve kernel thing and the linux kernel

Code:
cd /usr/src

git clone https://git.proxmox.com/git/pve-kernel.git

wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.19.16.tar.xz

tar -xf linux-5.19.16.tar.xz



I've installed

Code:
apt install -y devscripts

but that wasn't enough

when I tried

Code:
make menuconfig

I got errors

Code:
/bin/sh: 1: flex: not found
make[1]: *** [scripts/Makefile.host:9: scripts/kconfig/lexer.lex.c] Error 127
make: *** [Makefile:629: menuconfig] Error 2

fixed by installing flex

Code:
apt install -y flex

This also wasn't enough

Code:
/bin/sh: 1: bison: not found
make[1]: *** [scripts/Makefile.host:17: scripts/kconfig/parser.tab.h] Error 127
make: *** [Makefile:629: menuconfig] Error 2

Which was then fixed by installing bison

Code:
apt install -y bison

copied over the config from from boot folder
Code:
cp /boot/config-5.15.53-1-pve ./config

ran make submodules and make in the pve folder

Code:
cd /usr/src/pve-kernel/
make submodule
make

and then ran make menuconfig in the sources folder, added my usb gadget drivers and run make in pve-kernel and linux sources folder

Unfortunately things went wrong here

building the kernel failed with this error

Code:
  HOSTCC  scripts/asn1_compiler
  HOSTCC  scripts/sign-file
scripts/sign-file.c:25:10: fatal error: openssl/opensslv.h: No such file or directory
   25 | #include <openssl/opensslv.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.host:95: scripts/sign-file] Error 1
make: *** [Makefile:1188: scripts] Error 2
root@proxmox:/usr/src/linux-5.19.16# apt install opensslv
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package opensslv

and building the pve-kernel failed with this error

Code:
rm -rf zfs-linux_2.1.6 zfs-linux_2.1.6.tmp
cp -a upstream zfs-linux_2.1.6.tmp
cp -a debian zfs-linux_2.1.6.tmp/debian
mv zfs-linux_2.1.6.tmp zfs-linux_2.1.6
tar czf zfs-linux_2.1.6.orig.tar.gz zfs-linux_2.1.6
cd zfs-linux_2.1.6; dpkg-buildpackage -S -uc -us -d
dpkg-buildpackage: info: source package zfs-linux
dpkg-buildpackage: info: source version 2.1.6-pve1
dpkg-buildpackage: info: source distribution bullseye
dpkg-buildpackage: info: source changed by Proxmox Support Team <support@proxmox.com>
 dpkg-source --before-build .
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: applying 0001-Check-for-META-and-DCH-consistency-in-autoconf.patch
dpkg-source: info: applying 0002-always-load-ZFS-module-on-boot.patch
dpkg-source: info: applying 0003-Fix-the-path-to-the-zed-binary-on-the-systemd-unit.patch
dpkg-source: info: applying 0004-import-with-d-dev-disk-by-id-in-scan-service.patch
dpkg-source: info: applying 0005-Enable-zed-emails.patch
dpkg-source: info: applying 0006-dont-symlink-zed-scripts.patch
dpkg-source: info: applying 0007-Use-installed-python3.patch
dpkg-source: info: applying 0008-Add-systemd-unit-for-importing-specific-pools.patch
dpkg-source: info: applying 0009-Patch-move-manpage-arcstat-1-to-arcstat-8.patch
dpkg-source: info: applying 0010-arcstat-Fix-integer-division-with-python3.patch
dpkg-source: info: applying 0011-arc-stat-summary-guard-access-to-l2arc-MFU-MRU-stats.patch
 debian/rules clean
make[2]: Entering directory '/usr/src/pve-kernel/build/modules/tmp/zfs-linux_2.1.6'
dh clean --with autoreconf,python3,sphinxdoc --parallel
dh: error: unable to load addon python3: Can't locate Debian/Debhelper/Sequence/python3.pm in @INC (you may need to install the Debian::Debhelper::Sequence::python3 module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at (eval 13) line 1.
BEGIN failed--compilation aborted at (eval 13) line 1.

make[2]: *** [debian/rules:13: clean] Error 255
make[2]: Leaving directory '/usr/src/pve-kernel/build/modules/tmp/zfs-linux_2.1.6'
dpkg-buildpackage: error: debian/rules clean subprocess returned exit status 2
make[1]: *** [Makefile:63: zfs-linux_2.1.6-pve1.dsc] Error 2
make[1]: Leaving directory '/usr/src/pve-kernel/build/modules/tmp'
make: *** [Makefile:101: pkg-zfs.prepared] Error 2

And unfortunately that is all the time I had today to try this out.

I will try to get further on my next proxmox session, but please don't hesitate to post if you have any clues at what might be wrong here

thanks !
 
Most of your issues stem from missing build dependencies, which are all documented in the debian/conrol file.

To automatically install all the relevant ones use something like apt build-dep . in the pve-kernel repo (alternatively mk-build-deps -ir included in the devscripts package)
 
Good day.
Looks like stap 5 missed in first post, right ?

How to install kernel. Must be "make install" after step 4, no ?
 
How to install kernel. Must be "make install" after step 4, no ?
No, check for the resulting .deb files, e.g.: ls *.deb and then you normally want to install the one with "kernel" in it's name, and possible the "headers" one if you require that (e.g., for DKMS or the like), but it doesn't hurt to add if unsure.

apt install ./FILE.deb

replace FILE.deb with the respective filename (keep the leading ./ though).
 
No, check for the resulting .deb files, e.g.: ls *.deb and then you normally want to install the one with "kernel" in it's name, and possible the "headers" one if you require that (e.g., for DKMS or the like), but it doesn't hurt to add if unsure.

apt install ./FILE.deb

replace FILE.deb with the respective filename (keep the leading ./ though).
Also you only need to install the smaller of the two image files - you don't need to install the dbg version.
 
Hi,

I just upgraded to Proxmox V8
I need to recompile the kernel and I'm looking for the updated build instructions

I don't need to build a patched kernel, I just want to build the exact same kernel, but add 'USB network gadget support' in

This is the functionallity that allows USB host-to-host
Also known as USB tethering when used with mobile devices
Windows calls it "Remote NDIS based internet sharing"

I have two proxmox machine which unfortunately have only gigabit ethernet between them.

However they have USB 3.2, so my purpose is to hook them up using an USB A to USB A USB 3.2 rated cable and use that as a point-to-point 10 gigabit network link.

Searching online I found the following resources, with this thread being a high google result for "how to build kernel on proxmox forum"

https://forum.proxmox.com/threads/building-the-pve-kernel-on-proxmox-ve-6-x.76137/
https://forum.proxmox.com/threads/custom-linux-kernel.97485/
https://forum.proxmox.com/threads/build-custom-kernel-pve-with-patches.119148/
https://forum.proxmox.com/threads/how-to-build-kernel-module-by-manual.96091/
https://forum.proxmox.com/threads/compile-own-kernel-with-patches.50404/


So I'm giving this a try and will be posting the commands so you can follow at home !

First the proxmox kernel lives at https://git.proxmox.com/?p=pve-kernel.git;a=summary

This time I start with a fresh proxmox v8 install

Code:
rm /etc/apt/sources.list.d/pve-enterprise.list
rm /etc/apt/sources.list.d/ceph.list
apt update
apt upgrade
apt install -y devscripts git
git clone https://git.proxmox.com/git/pve-kernel.git


Code:
Cloning into 'pve-kernel'...
remote: Enumerating objects: 7720, done.
remote: Total 7720 (delta 0), reused 0 (delta 0), pack-reused 7720
Receiving objects: 100% (7720/7720), 53.99 MiB | 21.47 MiB/s, done.
Resolving deltas: 100% (5529/5529), done.
root@srv4:/usr/src# cd pve-kernel/
root@srv4:/usr/src/pve-kernel# ls
abi-blacklist  abi-prev-6.2.16-13-pve  debian  fwlist-previous  Makefile  patches  README  submodules
root@srv4:/usr/src/pve-kernel# make menuconfig
make: *** No rule to make target 'menuconfig'.  Stop.


Hmm, no menuconfig, how am I going to config anything... Anyway, let's try to just build a plain kernel

Code:
root@srv4:/usr/src/pve-kernel# mk-build-deps --install debian/control.in
mk-build-deps: warning:    debian/control.in(l1): badly formatted heading line
LINE: Source: proxmox-kernel-@KVMAJMIN@
mk-build-deps: warning:    debian/control.in(l2): badly formatted heading line
LINE: Section: devel
mk-build-deps: warning:    debian/control.in(l3): badly formatted heading line
LINE: Priority: optional
mk-build-deps: warning:    debian/control.in(l4): badly formatted heading line
LINE: Maintainer: Proxmox Support Team <support@proxmox.com>
mk-build-deps: warning:    debian/control.in(l5): badly formatted heading line
LINE: Build-Depends: asciidoc-base,
mk-build-deps: warning:    debian/control.in(l6): found change data where expected first heading
LINE:                automake,
mk-build-deps: warning:    debian/control.in(l34): badly formatted heading line
LINE: Build-Conflicts: proxmox-headers-@KVNAME@,
mk-build-deps: warning:    debian/control.in(l35): badly formatted heading line
LINE: Standards-Version: 4.6.2
mk-build-deps: warning:    debian/control.in(l36): badly formatted heading line
LINE: Vcs-Git: git://git.proxmox.com/git/pve-kernel
mk-build-deps: warning:    debian/control.in(l37): badly formatted heading line
LINE: Vcs-Browser: https://git.proxmox.com/?p=pve-kernel.git
mk-build-deps: warning:    debian/control.in(l39): badly formatted heading line
LINE: Package: linux-tools-@KVMAJMIN@
mk-build-deps: warning:    debian/control.in(l40): badly formatted heading line
LINE: Architecture: any
mk-build-deps: warning:    debian/control.in(l41): badly formatted heading line
LINE: Section: devel
mk-build-deps: warning:    debian/control.in(l42): badly formatted heading line
LINE: Priority: optional
mk-build-deps: warning:    debian/control.in(l43): badly formatted heading line
LINE: Depends: linux-base, ${misc:Depends}, ${shlibs:Depends},
mk-build-deps: warning:    debian/control.in(l44): badly formatted heading line
LINE: Description: Linux kernel version specific tools for version @KVMAJMIN@
mk-build-deps: warning:    debian/control.in(l45): unrecognized line
LINE:  This package provides the architecture dependent parts for kernel
mk-build-deps: warning:    debian/control.in(l46): unrecognized line
LINE:  version locked tools (such as perf and x86_energy_perf_policy)
mk-build-deps: warning:    debian/control.in(l48): badly formatted heading line
LINE: Package: proxmox-headers-@KVNAME@
mk-build-deps: warning:    debian/control.in(l49): badly formatted heading line
LINE: Section: devel
mk-build-deps: warning:    debian/control.in(l50): badly formatted heading line
LINE: Priority: optional
mk-build-deps: warning:    debian/control.in(l51): badly formatted heading line
LINE: Architecture: any
mk-build-deps: warning:    debian/control.in(l52): badly formatted heading line
LINE: Provides: linux-headers-@KVNAME@-amd64, pve-headers-@KVNAME@
mk-build-deps: warning:    debian/control.in(l53): badly formatted heading line
LINE: Depends: ${misc:Depends},
mk-build-deps: warning:    debian/control.in(l54): badly formatted heading line
LINE: Description: Proxmox Kernel Headers
mk-build-deps: warning:    debian/control.in(l55): unrecognized line
LINE:  This package contains the linux kernel headers
mk-build-deps: warning:    debian/control.in(l57): badly formatted heading line
LINE: Package: proxmox-kernel-@KVNAME@
mk-build-deps: warning:    debian/control.in(l58): badly formatted heading line
LINE: Section: admin
mk-build-deps: warning:    debian/control.in(l59): badly formatted heading line
LINE: Priority: optional
mk-build-deps: warning:    debian/control.in(l60): badly formatted heading line
LINE: Architecture: any
mk-build-deps: warning:    debian/control.in(l61): badly formatted heading line
LINE: Provides: linux-image-@KVNAME@-amd64, pve-kernel-@KVNAME@
mk-build-deps: warning:    debian/control.in(l62): badly formatted heading line
LINE: Suggests: pve-firmware,
mk-build-deps: warning:    debian/control.in(l63): badly formatted heading line
LINE: Depends: busybox, initramfs-tools | linux-initramfs-tool, ${misc:Depends},
mk-build-deps: warning:    debian/control.in(l64): badly formatted heading line
LINE: Recommends: grub-pc | grub-efi-amd64 | grub-efi-ia32 | grub-efi-arm64,
mk-build-deps: warning:    debian/control.in(l65): badly formatted heading line
LINE: Description: Proxmox Kernel Image
mk-build-deps: warning:    debian/control.in(l66): unrecognized line
LINE:  This package contains the linux kernel and initial ramdisk used for booting
mk-build-deps: warning:    debian/control.in(l68): badly formatted heading line
LINE: Package: proxmox-kernel-@KVNAME@-dbgsym
mk-build-deps: warning:    debian/control.in(l69): badly formatted heading line
LINE: Architecture: any
mk-build-deps: warning:    debian/control.in(l70): badly formatted heading line
LINE: Provides: linux-debug, pve-kernel-@KVNAME@-dbgsym
mk-build-deps: warning:    debian/control.in(l71): badly formatted heading line
LINE: Section: devel
mk-build-deps: warning:    debian/control.in(l72): badly formatted heading line
LINE: Priority: optional
mk-build-deps: warning:    debian/control.in(l73): badly formatted heading line
LINE: Build-Profiles: <pkg.proxmox-kernel.debug>
mk-build-deps: warning:    debian/control.in(l74): badly formatted heading line
LINE: Depends: ${misc:Depends},
mk-build-deps: warning:    debian/control.in(l75): badly formatted heading line
LINE: Description: Proxmox Kernel debug image
mk-build-deps: warning:    debian/control.in(l76): unrecognized line
LINE:  This package provides the kernel debug image for version @KVNAME@. The debug
mk-build-deps: warning:    debian/control.in(l77): unrecognized line
LINE:  kernel image contained in this package is NOT meant to boot from - it is
mk-build-deps: warning:    debian/control.in(l78): unrecognized line
LINE:  uncompressed, and unstripped, and suitable for use with crash/kdump-tools/..
mk-build-deps: warning:    debian/control.in(l79): unrecognized line
LINE:  to analyze kernel crashes. This package also contains the proxmox-kernel modules
mk-build-deps: warning:    debian/control.in(l80): unrecognized line
LINE:  in their unstripped version.
mk-build-deps: warning:    debian/control.in(l82): badly formatted heading line
LINE: Package: proxmox-kernel-libc-dev
mk-build-deps: warning:    debian/control.in(l83): badly formatted heading line
LINE: Section: devel
mk-build-deps: warning:    debian/control.in(l84): badly formatted heading line
LINE: Priority: optional
mk-build-deps: warning:    debian/control.in(l85): badly formatted heading line
LINE: Architecture: any
mk-build-deps: warning:    debian/control.in(l86): badly formatted heading line
LINE: Provides: linux-libc-dev (=${binary:Version}), pve-kernel-libc-dev
mk-build-deps: warning:    debian/control.in(l87): badly formatted heading line
LINE: Conflicts: linux-libc-dev,
mk-build-deps: warning:    debian/control.in(l88): badly formatted heading line
LINE: Replaces: linux-libc-dev, pve-kernel-libc-dev
mk-build-deps: warning:    debian/control.in(l89): badly formatted heading line
LINE: Breaks: pve-kernel-libc-dev
mk-build-deps: warning:    debian/control.in(l90): badly formatted heading line
LINE: Depends: ${misc:Depends},
mk-build-deps: warning:    debian/control.in(l91): badly formatted heading line
LINE: Description: Linux support headers for userspace development
mk-build-deps: warning:    debian/control.in(l92): unrecognized line
LINE:  This package provides userspaces headers from the Linux kernel.  These headers
mk-build-deps: warning:    debian/control.in(l93): unrecognized line
LINE:  are used by the installed headers for GNU libc and other system libraries.
mk-build-deps: warning:    debian/control.in(l95): badly formatted heading line
LINE: Package: proxmox-headers-@KVMAJMIN@
mk-build-deps: warning:    debian/control.in(l96): badly formatted heading line
LINE: Architecture: all
mk-build-deps: warning:    debian/control.in(l97): badly formatted heading line
LINE: Section: admin
mk-build-deps: warning:    debian/control.in(l98): badly formatted heading line
LINE: Provides: linux-headers-amd64, linux-headers-generic, pve-headers-@KVMAJMIN@
mk-build-deps: warning:    debian/control.in(l99): badly formatted heading line
LINE: Replaces: pve-headers-@KVMAJMIN@
mk-build-deps: warning:    debian/control.in(l100): badly formatted heading line
LINE: Priority: optional
mk-build-deps: warning:    debian/control.in(l101): badly formatted heading line
LINE: Depends: proxmox-headers-@KVNAME@, ${misc:Depends},
mk-build-deps: warning:    debian/control.in(l102): badly formatted heading line
LINE: Description: Latest Proxmox Kernel Headers
mk-build-deps: warning:    debian/control.in(l103): unrecognized line
LINE:  This is a metapackage which will install the kernel headers
mk-build-deps: warning:    debian/control.in(l104): unrecognized line
LINE:  for the latest available proxmox kernel from the @KVMAJMIN@
mk-build-deps: warning:    debian/control.in(l105): unrecognized line
LINE:  series.
mk-build-deps: warning:    debian/control.in(l107): badly formatted heading line
LINE: Package: proxmox-kernel-@KVMAJMIN@
mk-build-deps: warning:    debian/control.in(l108): badly formatted heading line
LINE: Architecture: all
mk-build-deps: warning:    debian/control.in(l109): badly formatted heading line
LINE: Section: admin
mk-build-deps: warning:    debian/control.in(l110): badly formatted heading line
LINE: Provides: linux-image-amd64, linux-image-generic, wireguard-modules (=1.0.0), pve-kernel-@KVMAJMIN@
mk-build-deps: warning:    debian/control.in(l111): badly formatted heading line
LINE: Replaces: pve-kernel-@KVMAJMIN@
mk-build-deps: warning:    debian/control.in(l112): badly formatted heading line
LINE: Priority: optional
mk-build-deps: warning:    debian/control.in(l113): badly formatted heading line
LINE: Depends: pve-firmware, proxmox-kernel-@KVNAME@, ${misc:Depends},
mk-build-deps: warning:    debian/control.in(l114): badly formatted heading line
LINE: Description: Latest Proxmox Kernel Image
mk-build-deps: warning:    debian/control.in(l115): unrecognized line
LINE:  This is a metapackage which will install the latest available
mk-build-deps: warning:    debian/control.in(l116): unrecognized line
LINE:  proxmox kernel from the @KVMAJMIN@ series.
mk-build-deps: warning:    debian/control.in(l116): found end of file where expected more change data or trailer
mk-build-deps: warning: unknown information field '' in input data in parsed version of changelog
mk-build-deps: warning: can't parse dependency proxmox-headers-@KVNAME@
dpkg-buildpackage: warning:     debian/changelog(l1): badly formatted heading line
LINE: proxmox-kernel-@KVMAJMIN@-build-deps (1.0) unstable; urgency=low
dpkg-buildpackage: warning:     debian/changelog(l2): found blank line where expected first heading
dpkg-buildpackage: warning:     debian/changelog(l3): found change data where expected first heading
LINE:   * First version
dpkg-buildpackage: warning: unknown information field '' in input data in parsed version of changelog
dpkg-buildpackage: info: source package unknown
dpkg-buildpackage: info: source version unknown
dpkg-buildpackage: error: version number does not start with digit
Error in the build process: exit status 255
dpkg: error: cannot access archive 'proxmox-kernel-@KVMAJMIN@-build-deps_1.0_all.deb': No such file or directory
mk-build-deps: dpkg --unpack failed

Ok so it wants a file


Code:
root@srv4:/usr/src/pve-kernel# find /usr | grep proxmox-kernel-
/usr/share/proxmox-kernel-helper
/usr/share/proxmox-kernel-helper/scripts
/usr/share/proxmox-kernel-helper/scripts/functions
/usr/share/lintian/overrides/proxmox-kernel-helper
/usr/share/doc/proxmox-kernel-helper
/usr/share/doc/proxmox-kernel-helper/changelog.gz
/usr/share/doc/proxmox-kernel-helper/copyright
/usr/src/pve-kernel/debian/proxmox-kernel-meta.postinst.in
/usr/src/pve-kernel/debian/proxmox-kernel-meta.postrm.in

That file is not on my system

Searching google for "proxmox-kernel-@KVMAJMIN@-build-deps_1.0_all.deb" there is only one link

https://forum.proxmox.com/threads/f...-kernel-current-head-of-master-branch.132669/

They're having the same issue, no fix no response however

Further links

https://pve.proxmox.com/wiki/Developer_Documentation

Which points to official build instructions

https://git.proxmox.com/?p=pve-common.git;a=blob_plain;f=README.dev;hb=HEAD

Apparently you need to add the "pvetest" debian bookworm repository, ok !

Code:
echo "deb http://download.proxmox.com/debian bookworm pvetest" > /etc/apt/sources.list.d/pve-development.list
It will add the following packages
 

Attachments

  • 1695108277201.png
    1695108277201.png
    22.7 KB · Views: 11
Code:
root@srv4:/usr/src/pve-kernel# echo "deb http://download.proxmox.com/debian bookworm pvetest" > /etc/apt/sources.list.d/pve-development.list
root@srv4:/usr/src/pve-kernel# apt update
Get:1 http://download.proxmox.com/debian bookworm InRelease [2,768 B]
Get:2 http://download.proxmox.com/debian bookworm/pvetest amd64 Packages [139 kB]
Hit:3 http://ftp.ca.debian.org/debian bookworm InRelease
Hit:4 http://ftp.ca.debian.org/debian bookworm-updates InRelease
Get:5 http://security.debian.org bookworm-security InRelease [48.0 kB]
Fetched 190 kB in 2s (97.9 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
38 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@srv4:/usr/src/pve-kernel# apt list --upgradable
Listing... Done
ifupdown2/stable 3.2.0-1+pmx5 all [upgradable from: 3.2.0-1+pmx2]
libjs-extjs/stable 7.0.0-4 all [upgradable from: 7.0.0-3]
libnss-systemd/stable 252.12-pmx1 amd64 [upgradable from: 252.12-1~deb12u1]
libpam-systemd/stable 252.12-pmx1 amd64 [upgradable from: 252.12-1~deb12u1]
libproxmox-rs-perl/stable 0.3.1 amd64 [upgradable from: 0.3.0]
libpve-access-control/stable 8.0.5 all [upgradable from: 8.0.3]
libpve-cluster-api-perl/stable 8.0.4 all [upgradable from: 8.0.1]
libpve-cluster-perl/stable 8.0.4 all [upgradable from: 8.0.1]
libpve-common-perl/stable 8.0.9 all [upgradable from: 8.0.5]
libpve-guest-common-perl/stable 5.0.5 all [upgradable from: 5.0.3]
libpve-http-server-perl/stable 5.0.4 all [upgradable from: 5.0.3]
libpve-rs-perl/stable 0.8.6 amd64 [upgradable from: 0.8.3]
libpve-storage-perl/stable 8.0.3 all [upgradable from: 8.0.1]
librados2-perl/stable 1.4.1 amd64 [upgradable from: 1.4.0]
libsystemd-shared/stable 252.12-pmx1 amd64 [upgradable from: 252.12-1~deb12u1]
libsystemd0/stable 252.12-pmx1 amd64 [upgradable from: 252.12-1~deb12u1]
libudev1/stable 252.12-pmx1 amd64 [upgradable from: 252.12-1~deb12u1]
proxmox-backup-client/stable 3.0.2-1 amd64 [upgradable from: 2.99.0-1]
proxmox-backup-file-restore/stable 3.0.2-1 amd64 [upgradable from: 2.99.0-1]
proxmox-kernel-helper/stable 8.0.3 all [upgradable from: 8.0.2]
proxmox-mail-forward/stable 0.2.0 amd64 [upgradable from: 0.1.1-1]
proxmox-ve/stable 8.0.2 all [upgradable from: 8.0.1]
proxmox-widget-toolkit/stable 4.0.8 all [upgradable from: 4.0.5]
pve-cluster/stable 8.0.4 amd64 [upgradable from: 8.0.1]
pve-container/stable 5.0.5 all [upgradable from: 5.0.3]
pve-docs/stable 8.0.5 all [upgradable from: 8.0.3]
pve-firewall/stable 5.0.3 amd64 [upgradable from: 5.0.2]
pve-firmware/stable 3.8-2 all [upgradable from: 3.7-1]
pve-i18n/stable 3.0.7 all [upgradable from: 3.0.4]
pve-kernel-6.2/stable 8.0.5 all [upgradable from: 8.0.2]
pve-manager/stable 8.0.6 amd64 [upgradable from: 8.0.3]
pve-qemu-kvm/stable 8.0.2-6 amd64 [upgradable from: 8.0.2-3]
qemu-server/stable 8.0.7 amd64 [upgradable from: 8.0.6]
systemd-boot-efi/stable 252.12-pmx1 amd64 [upgradable from: 252.12-1~deb12u1]
systemd-boot/stable 252.12-pmx1 amd64 [upgradable from: 252.12-1~deb12u1]
systemd-sysv/stable 252.12-pmx1 amd64 [upgradable from: 252.12-1~deb12u1]
systemd/stable 252.12-pmx1 amd64 [upgradable from: 252.12-1~deb12u1]
udev/stable 252.12-pmx1 amd64 [upgradable from: 252.12-1~deb12u1]


Ok installed,

The build instruction say

Code:
# mk-build-deps --install
in the top-level directory of a git repository.

But that does not seem to work

Code:
root@srv4:/usr/src/pve-kernel# mk-build-deps --install
Usage:
mk-build-deps --help|--version

mk-build-deps [options] control file | package name ...

Maybe they mean inside one of the subdirectory

A quick look at this folder and ...

Code:
root@srv4:/usr/src/pve-kernel# find
.
./patches
./patches/kernel
./patches/kernel/0006-net-core-downgrade-unregister_netdevice-refcount-lea.patch
./patches/kernel/0011-mm-suppress-mm-fault-logging-if-fatal-signal-already.patch
./patches/kernel/0008-kvm-xsave-set-mask-out-PKRU-bit-in-xfeatures-if-vCPU.patch
./patches/kernel/0003-bridge-keep-MAC-of-first-assigned-port.patch
./patches/kernel/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch
./patches/kernel/0015-thunderbolt-Restart-XDomain-discovery-handshake-afte.patch
./patches/kernel/0010-igc-Fix-Kernel-Panic-during-ndo_tx_timeout-callback.patch
./patches/kernel/0004-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch
./patches/kernel/0013-allow-opt-in-to-allow-pass-through-on-broken-hardwar.patch
./patches/kernel/0002-wireless-Add-Debian-wireless-regdb-certificates.patch
./patches/kernel/0005-kvm-disable-default-dynamic-halt-polling-growth.patch
./patches/kernel/0014-net-thunderbolt-Fix-TCPv6-GSO-checksum-calculation.patch
./patches/kernel/0007-Revert-fortify-Do-not-cast-to-unsigned-char.patch
./patches/kernel/0012-KVM-x86-mmu-Fix-an-sign-extension-bug-with-mmu_seq-t.patch
./patches/kernel/0009-nvme-don-t-reject-probe-due-to-duplicate-IDs-for-sin.patch
./fwlist-previous
./.gitmodules
./Makefile
./README
./submodules
./submodules/zfsonlinux
./submodules/ubuntu-kernel
./debian
./debian/rules
./debian/changelog
./debian/scripts
./debian/scripts/import-patchqueue
./debian/scripts/abi-generate
./debian/scripts/export-patchqueue
./debian/scripts/abi-check
./debian/scripts/import-upstream-tag
./debian/scripts/find-firmware.pl
./debian/proxmox-headers.postinst.in
./debian/source
./debian/source/lintian-overrides
./debian/proxmox-kernel-meta.postinst.in
./debian/rules.d
./debian/rules.d/amd64.mk
./debian/proxmox-kernel-meta.postrm.in
./debian/proxmox-kernel.postinst.in
./debian/proxmox-kernel.prerm.in
./debian/proxmox-kernel.postrm.in
./debian/control.in
./debian/copyright
./.git
./.git/config
./.git/objects
./.git/objects/pack
./.git/objects/pack/pack-9e0473e6b0b0c5ec6ba4538823292ff902f7fa7a.pack
./.git/objects/pack/pack-9e0473e6b0b0c5ec6ba4538823292ff902f7fa7a.idx
./.git/objects/info
./.git/info
./.git/info/exclude
./.git/HEAD
./.git/packed-refs
./.git/branches
./.git/description
./.git/logs
./.git/logs/HEAD
./.git/logs/refs
./.git/logs/refs/remotes
./.git/logs/refs/remotes/origin
./.git/logs/refs/remotes/origin/HEAD
./.git/logs/refs/heads
./.git/logs/refs/heads/master
./.git/index
./.git/hooks
./.git/hooks/fsmonitor-watchman.sample
./.git/hooks/applypatch-msg.sample
./.git/hooks/update.sample
./.git/hooks/pre-rebase.sample
./.git/hooks/prepare-commit-msg.sample
./.git/hooks/commit-msg.sample
./.git/hooks/pre-merge-commit.sample
./.git/hooks/pre-applypatch.sample
./.git/hooks/pre-push.sample
./.git/hooks/pre-commit.sample
./.git/hooks/pre-receive.sample
./.git/hooks/push-to-checkout.sample
./.git/hooks/post-update.sample
./.git/refs
./.git/refs/remotes
./.git/refs/remotes/origin
./.git/refs/remotes/origin/HEAD
./.git/refs/tags
./.git/refs/heads
./.git/refs/heads/master
./abi-prev-6.2.16-13-pve
./.gitignore
./abi-blacklist


This is not a kernel ...

Also I'm reading more of https://git.proxmox.com/?p=pve-common.git;a=blob_plain;f=README.dev;hb=HEAD

There aren't kernel build instructions, they're whole proxmox build instruction ?!?

I suspect that what is happenning is, I am missing something so obvious that it never gets mentionned in tutorials and other correspondances.
I do know I at least need a kernel, and that might be "proxmox-kernel-@KVMAJMIN@-build-deps_1.0_all.deb"

Code:
root@srv4:/usr/src/pve-kernel# uname -r
6.2.16-3-pve


According to the other user, this is related to the tag

in https://git.proxmox.com/?p=pve-kernel.git;a=commit;h=6e72c5b2b755fb790e829ebd976be96a92b45d1a

specifically in @KVMAJMIN@

https://git.proxmox.com/?p=pve-kern...;hpb=7a00dc5a16318e23775e7d43d0b913137fe0ed97



So... presumably I would need proxmox-kernel-6.2.16-3-pve-build-deps_1.0_all.deb ? Is that a thing ?

No results on google...

From https://pve.proxmox.com/wiki/Proxmox_VE_Kernel

Code:
Proxmox VE 8.x
The stable 8.x release uses currently the 6.2 kernel since Proxmox VE 8.0. The 6.2 kernel is derived from Ubuntu 23.04.

Proxmox VE 8.1 (2023/Q4) will be based on the 6.5 kernel, derived from Ubuntu 23.10.


What if

Code:
root@srv4:/usr/src/pve-kernel# apt install pve-kernel
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package pve-kernel

From https://forum.proxmox.com/threads/downgrade-download-previous-kernel-versions-proxmox-6-2.73938/



Could it be ...


Code:
root@srv4:/usr/src/pve-kernel# git clone git://git.proxmox.com/git/pve-kernel.git
Cloning into 'pve-kernel'...
remote: Enumerating objects: 7720, done.
remote: Total 7720 (delta 0), reused 0 (delta 0), pack-reused 7720
Receiving objects: 100% (7720/7720), 53.99 MiB | 21.28 MiB/s, done.
Resolving deltas: 100% (5529/5529), done.
root@srv4:/usr/src/pve-kernel# git checkout pve-kernel-6.2
error: pathspec 'pve-kernel-6.2' did not match any file(s) known to git
root@srv4:/usr/src/pve-kernel# git checkout pve-kernel-6.2.16-pve
error: pathspec 'pve-kernel-6.2.16-pve' did not match any file(s) known to git

Found another tutorial https://forum.proxmox.com/threads/kernel-documentation-for-building-modules.97068/

This one says install the headers

Code:
root@srv4:/usr/src/pve-kernel# apt install pve-headers
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
proxmox-default-headers proxmox-headers-6.2 proxmox-headers-6.2.16-13-pve
The following NEW packages will be installed:
proxmox-default-headers proxmox-headers-6.2 proxmox-headers-6.2.16-13-pve pve-headers
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 13.6 MB of archives.
After this operation, 92.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]


This created /usr/src/linux-headers-6.2.16-13-pve

Still no go

Code:
root@srv4:/usr/src/linux-headers-6.2.16-13-pve# mk-build-deps --install debian/control.in
E: You must put some 'deb-src' URIs in your sources.list
mk-build-deps: Unable to find package name in `apt-cache showsrc debian/control.in'

Hmm what does that mean "You must put some 'deb-src' URIs in your sources.list"

Code:
root@srv4:/usr/src/linux-headers-6.2.16-13-pve# cat /etc/apt/sources.list
deb http://ftp.ca.debian.org/debian bookworm main contrib
deb http://ftp.ca.debian.org/debian bookworm-updates main contrib
# security updates
deb http://security.debian.org bookworm-security main contrib


Ok well some earlier text said that "The 6.2 kernel is derived from Ubuntu 23.04."

Maybe that's what I need to add in there

From https://pve.proxmox.com/wiki/Package_Repositories#sysadmin_no_subscription_repo

Ok that might have been it ?

Code:
echo 'deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription' >> /etc/apt/sources.list

Still no


Code:
root@srv4:/usr/src/linux-headers-6.2.16-13-pve# apt install pve-kernel
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package pve-kernel

Back in my day rebuilding kernels was easy-peasy, you'd do it 12 times a day fixing drivers and trying new things, however it is now 3 AM and looks like this is it for me.

Hopefully it is not another year before I try this again !
 

Attachments

  • 1695108320031.png
    1695108320031.png
    28.8 KB · Views: 13

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!