AdityaGarg8 / pve-edge-kernel-t2

Newer Linux kernels for Proxmox VE 8 - For T2 Macs
37 stars 2 forks source link

6.2 kernel #1

Closed wudzi closed 10 months ago

wudzi commented 1 year ago

Any update for the 6.2 kernel?

SerialVelocity commented 1 year ago

@AdityaGarg8 Now that 6.2 seems to be the default for Proxmox 8.0, would be great to see a release for that.

Is it as simple as just retriggering a build? Or do lots of patches need to be rewritten/deconflicted?

AdityaGarg8 commented 1 year ago

I cannot modify the proxmox specific patches since that's out of my area of expertise, so wait for fabian's repo to release 6.2 first.

SerialVelocity commented 1 year ago

Ah, thanks for the info. The plain pve kernel is also located here btw: https://github.com/proxmox/pve-kernel

AdityaGarg8 commented 1 year ago

It's different from fabian's repo, and I don't find any building instructions as well.

floco commented 1 year ago

Would it work with that one: https://github.com/jiangcuo/pve-port-kernel/tree/v6.2 as seems to be a fork from fabian's repo ?

AdityaGarg8 commented 1 year ago

Hi @floco

Thanks for pointing me to this fork. I’ve ran a workflow to compile kernel 6.2 from that fork here : https://github.com/AdityaGarg8/pve-edge-kernel-t2/actions/runs/6130342116/job/16639348536

floco commented 1 year ago

Awesome ! Thanks :-)

barzag commented 1 year ago

Thanks 👍🏻

AdityaGarg8 commented 1 year ago

The build is failing for 6.2. The upstream maintainer has to fix it on his/her end.

floco commented 1 year ago

Problem is not the runner ran out of space ?

cp: error copying 'drivers/usb/serial/keyspan.ko' to '/repo/pve-port-kernel/debian/pve-kernel-6.2.16-generic//lib/modules/6.2.16-generic/kernel/drivers/usb/serial/keyspan.ko': No space left on device
Error: No space left on device : '/home/runner/runners/2.308.0/_diag/blocks/c6b4c8ab-97f5-41d8-bde5-5de8d593ff61_ca395085-040a-526b-2ce8-bdc85f692774.2'
AdityaGarg8 commented 1 year ago

This is the latest workflow:

https://github.com/AdityaGarg8/pve-edge-kernel-t2/actions/runs/6130779439/job/16640200393

AdityaGarg8 commented 1 year ago

I’ll see to the source code and if possible go for another attempt.

AdityaGarg8 commented 1 year ago

The repo is for arm machines and T2 Macs are x86-64 machines. @jiangcuo seems to have removed many x86 specific patches so I doubt whether it’s wise to use this repo or not. Anyways, I’ve pinged him here.

jiangcuo commented 1 year ago

The repo is for arm machines and T2 Macs are x86-64 machines. @jiangcuo seems to have removed many x86 specific patches so I doubt whether it’s wise to use this repo or not. Anyways, I’ve pinged him here.

@AdityaGarg8 Hello, https://github.com/jiangcuo/pve-port-kernel not compatible with x86-64.

AdityaGarg8 commented 1 year ago

Thanks for the clarification

floco commented 1 year ago

ah too bad, sorry for not checking the architecture. And thanks a lot for trying. Hope Fabian will consider releasing a 6.2 / supporting Proxmox 8.

My mistake also for upgrading a mac mini 2018 to proxmox 8 without checking if a patched T2 kernel existed ;-). In the past I compiled applesmc_t2_kmod.ko for proxmox 7 to control the fans but that does not work anymore. I will try to look further in Fabian's repo to understand what can be done...

patdohere commented 1 year ago

First time working with building linux kernel. Managed to build a pve-kernel yesterday without patches. But to get my environment working

  1. Setup repositories per pve documentation

    echo "deb http://download.proxmox.com/debian bookworm pvetest" > /etc/apt/sources.list.d/pve-development.list
    wget -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg "https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg"
  2. Update repositories & download build dependences

    
    sudo apt update
    sudo apt-get install build-essential git git-email debhelper pve-doc-generator
3. Download pve-kernel source code
```sh
git clone git://git.proxmox.com/git/pve-kernel.git
  1. Download build dependencies
    sudo mk-build-deps --install debian/control.in
  2. Compile kernel should also initialize submodules
    make

However running into issues trying to apply patches would love to learn how to fix some of the conflicts.

test -f "submodules/ubuntu-kernel/README" || git submodule update --init submodules/ubuntu-kernel
test -f "submodules/zfsonlinux/Makefile" || git submodule update --init --recursive submodules/zfsonlinux
rm -rf proxmox-kernel-6.2.16/ubuntu-kernel ubuntu-kernel.prepared
mkdir -p proxmox-kernel-6.2.16
cp -a submodules/ubuntu-kernel proxmox-kernel-6.2.16/ubuntu-kernel
cd proxmox-kernel-6.2.16/ubuntu-kernel; python3 debian/scripts/misc/annotations --arch amd64 --export >../../config-6.2.16.org
cp config-6.2.16.org proxmox-kernel-6.2.16/ubuntu-kernel/.config
sed -i proxmox-kernel-6.2.16/ubuntu-kernel/Makefile -e 's/^EXTRAVERSION.*$/EXTRAVERSION=-14-pve/'
rm -rf proxmox-kernel-6.2.16/ubuntu-kernel/debian proxmox-kernel-6.2.16/ubuntu-kernel/debian.master
set -e; cd proxmox-kernel-6.2.16/ubuntu-kernel; \
  for patch in ../../patches/kernel/*.patch; do \
    echo "applying patch '$patch'"; \
    patch --batch -p1 < "${patch}"; \
  done
applying patch '../../patches/kernel/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch'
patching file init/Makefile
applying patch '../../patches/kernel/0001-bpfilter-Add-option-to-disable-logs.patch'
patching file net/bpfilter/bpfilter_kern.c
applying patch '../../patches/kernel/0002-wireless-Add-Debian-wireless-regdb-certificates.patch'
patching file net/wireless/certs/debian.hex
applying patch '../../patches/kernel/0003-bridge-keep-MAC-of-first-assigned-port.patch'
patching file net/bridge/br_stp_if.c
applying patch '../../patches/kernel/0004-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch'
patching file Documentation/admin-guide/kernel-parameters.txt
patching file drivers/pci/quirks.c
applying patch '../../patches/kernel/0005-kvm-disable-default-dynamic-halt-polling-growth.patch'
patching file virt/kvm/kvm_main.c
applying patch '../../patches/kernel/0006-net-core-downgrade-unregister_netdevice-refcount-lea.patch'
patching file net/core/dev.c
applying patch '../../patches/kernel/0007-Revert-fortify-Do-not-cast-to-unsigned-char.patch'
patching file include/linux/fortify-string.h
applying patch '../../patches/kernel/0008-kvm-xsave-set-mask-out-PKRU-bit-in-xfeatures-if-vCPU.patch'
patching file arch/x86/kvm/cpuid.c
patching file arch/x86/kvm/cpuid.h
patching file arch/x86/kvm/x86.c
applying patch '../../patches/kernel/0009-nvme-don-t-reject-probe-due-to-duplicate-IDs-for-sin.patch'
patching file drivers/nvme/host/core.c
applying patch '../../patches/kernel/0010-igc-Fix-Kernel-Panic-during-ndo_tx_timeout-callback.patch'
patching file drivers/net/ethernet/intel/igc/igc_main.c
applying patch '../../patches/kernel/0011-mm-suppress-mm-fault-logging-if-fatal-signal-already.patch'
patching file kernel/signal.c
applying patch '../../patches/kernel/0012-KVM-x86-mmu-Fix-an-sign-extension-bug-with-mmu_seq-t.patch'
patching file arch/x86/kvm/mmu/mmu.c
applying patch '../../patches/kernel/0013-allow-opt-in-to-allow-pass-through-on-broken-hardwar.patch'
patching file drivers/iommu/intel/iommu.c
applying patch '../../patches/kernel/0014-net-thunderbolt-Fix-TCPv6-GSO-checksum-calculation.patch'
patching file drivers/net/thunderbolt.c
applying patch '../../patches/kernel/0015-thunderbolt-Restart-XDomain-discovery-handshake-afte.patch'
patching file drivers/thunderbolt/xdomain.c
applying patch '../../patches/kernel/0016-x86-fpu-Set-X86_FEATURE_OSXSAVE-feature-after-enabli.patch'
patching file arch/x86/kernel/fpu/xstate.c
applying patch '../../patches/kernel/0017-thunderbolt-Mask-ring-interrupt-on-Intel-hardware-as.patch'
patching file drivers/thunderbolt/nhi.c
applying patch '../../patches/kernel/1001-Add-apple-bce-driver.patch'
patching file drivers/staging/apple-bce/Makefile
patching file drivers/staging/apple-bce/apple_bce.c
patching file drivers/staging/apple-bce/apple_bce.h
patching file drivers/staging/apple-bce/audio/audio.c
patching file drivers/staging/apple-bce/audio/audio.h
patching file drivers/staging/apple-bce/audio/description.h
patching file drivers/staging/apple-bce/audio/pcm.c
patching file drivers/staging/apple-bce/audio/pcm.h
patching file drivers/staging/apple-bce/audio/protocol.c
patching file drivers/staging/apple-bce/audio/protocol.h
patching file drivers/staging/apple-bce/audio/protocol_bce.c
patching file drivers/staging/apple-bce/audio/protocol_bce.h
patching file drivers/staging/apple-bce/mailbox.c
patching file drivers/staging/apple-bce/mailbox.h
patching file drivers/staging/apple-bce/queue.c
patching file drivers/staging/apple-bce/queue.h
patching file drivers/staging/apple-bce/queue_dma.c
patching file drivers/staging/apple-bce/queue_dma.h
patching file drivers/staging/apple-bce/vhci/command.h
patching file drivers/staging/apple-bce/vhci/queue.c
patching file drivers/staging/apple-bce/vhci/queue.h
patching file drivers/staging/apple-bce/vhci/transfer.c
patching file drivers/staging/apple-bce/vhci/transfer.h
patching file drivers/staging/apple-bce/vhci/vhci.c
patching file drivers/staging/apple-bce/vhci/vhci.h
applying patch '../../patches/kernel/1002-Put-apple-bce-in-drivers-staging.patch'
patching file drivers/staging/Kconfig
patching file drivers/staging/Makefile
patching file drivers/staging/apple-bce/Kconfig
patching file drivers/staging/apple-bce/Makefile
applying patch '../../patches/kernel/1003-add-modalias-to-apple-bce.patch'
patching file drivers/staging/apple-bce/apple_bce.c
applying patch '../../patches/kernel/1004-HID-Recognize-sensors-with-application-collections-t.patch'
patching file drivers/hid/hid-core.c
Hunk #1 succeeded at 808 (offset 4 lines).
patching file drivers/hid/hid-sensor-hub.c
applying patch '../../patches/kernel/1005-Documentation-leds-standardise-keyboard-backlight-le.patch'
patching file Documentation/leds/well-known-leds.txt
applying patch '../../patches/kernel/1006-HID-hid-apple-magic-backlight-Add-driver-for-keyboar.patch'
patching file MAINTAINERS
Hunk #1 succeeded at 9213 (offset 12 lines).
patching file drivers/hid/Kconfig
patching file drivers/hid/Makefile
patching file drivers/hid/hid-apple-magic-backlight.c
applying patch '../../patches/kernel/1007-HID-apple-ibridge-Add-Apple-iBridge-HID-driver-for-T.patch'
patching file drivers/hid/Kconfig
patching file drivers/hid/Makefile
patching file drivers/hid/apple-ibridge.c
patching file drivers/hid/apple-ibridge.h
patching file drivers/hid/hid-ids.h
patching file drivers/hid/hid-quirks.c
applying patch '../../patches/kernel/1008-HID-apple-touchbar-Add-driver-for-the-Touch-Bar-on-M.patch'
patching file drivers/hid/Kconfig
patching file drivers/hid/Makefile
patching file drivers/hid/apple-touchbar.c
patching file drivers/hid/hid-quirks.c
applying patch '../../patches/kernel/2001-drm-amdgpu-register-a-vga_switcheroo-client-for-MacB.patch'
patching file drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
Reversed (or previously applied) patch detected!  Assuming -R.
Hunk #2 succeeded at 3972 (offset 53 lines).
Hunk #3 succeeded at 4097 (offset 68 lines).
Hunk #4 succeeded at 4116 (offset 68 lines).
applying patch '../../patches/kernel/2002-hda-hdmi-Register-with-vga_switcheroo-on-Dual-GPU-Ma.patch'
patching file sound/pci/hda/hda_intel.c
Reversed (or previously applied) patch detected!  Assuming -R.
Hunk #2 succeeded at 1469 (offset 6 lines).
applying patch '../../patches/kernel/2003-apple-gmux-use-first-bit-to-check-switch-state.patch'
patching file drivers/platform/x86/apple-gmux.c
applying patch '../../patches/kernel/2004-apple-gmux-refactor-gmux-types.patch'
patching file drivers/platform/x86/apple-gmux.c
patching file include/linux/apple-gmux.h
applying patch '../../patches/kernel/2005-apple-gmux-Use-GMSP-acpi-method-for-interrupt-clear.patch'
patching file drivers/platform/x86/apple-gmux.c
applying patch '../../patches/kernel/2006-apple-gmux-support-MMIO-gmux-on-T2-Macs.patch'
patching file drivers/platform/x86/apple-gmux.c
patching file include/linux/apple-gmux.h
applying patch '../../patches/kernel/2007-apple-gmux-add-debugfs-interface.patch'
patching file drivers/platform/x86/apple-gmux.c
applying patch '../../patches/kernel/2008-i915-4-lane-quirk-for-mbp15-1.patch'
patching file drivers/gpu/drm/i915/display/intel_ddi.c
Hunk #1 succeeded at 4131 (offset 34 lines).
patching file drivers/gpu/drm/i915/display/intel_quirks.c
Hunk #2 FAILED at 211.
1 out of 2 hunks FAILED -- saving rejects to file drivers/gpu/drm/i915/display/intel_quirks.c.rej
patching file drivers/gpu/drm/i915/display/intel_quirks.h
make: *** [Makefile:108: ubuntu-kernel.prepared] Error 1
patdohere commented 1 year ago

Need to reinstall to try to reproduce but resolve alot of dependency issues by adding some proxmox repositories. Still believe the one in the above is all you need.

/etc/apt/source.list

#deb cdrom:[Debian GNU/Linux 12.1.0 _Bookworm_ - Official amd64 NETINST with firmware 20230722-10:48]/ bookworm main non-free-firmware

deb http://deb.debian.org/debian/ bookworm main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware

deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware

# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://deb.debian.org/debian/ bookworm-updates main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
deb http://download.proxmox.com/debian bookworm pvetest
deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription pvetest
deb http://download.proxmox.com/debian/devel/ bookworm main
AdityaGarg8 commented 1 year ago
git clone https://github.com/t2linux/linux-t2-patches.git
cd linux-t2-patches
git checkout 3a43f2f
wget https://github.com/AdityaGarg8/T2-Ubuntu/raw/ssd/0001-bpfilter-Add-option-to-disable-logs.patch
rm 2001*

This should get the desired patches

barzag commented 12 months ago

Has anyone made progress on creating the patched kernel? Thanks for sharing.

AdityaGarg8 commented 12 months ago

What is the version of the official kernel used by proxmox?

barzag commented 12 months ago

6.5.11-3 https://github.com/proxmox/pve-kernel/blob/master/debian/changelog

AdityaGarg8 commented 12 months ago
curl -s --compressed "https://adityagarg8.github.io/t2-ubuntu-repo/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/t2-ubuntu-repo.gpg >/dev/null
sudo curl -s --compressed -o /etc/apt/sources.list.d/t2.list "https://adityagarg8.github.io/t2-ubuntu-repo/t2.list"
sudo apt update
sudo apt install apple-bce applesmc-t2 apple-touchbar apple-t2-audio-config bcm5974-t2

if this works on 6.5, you can use the official kernel!

AdityaGarg8 commented 11 months ago

For all the proxmox users in this thread, kernel 6.5 with t2 support may get released soon!

I cannot guarantee now, but wish me luck!

barzag commented 11 months ago

forza :)

AdityaGarg8 commented 11 months ago

Kernel 6.5.11 released with t2 support!

https://github.com/AdityaGarg8/pve-edge-kernel-t2/releases/tag/6.5.11-7

I request all to test it and report if there is any bug. Also inform me if the kernel works well!

AdityaGarg8 commented 11 months ago

Also, I have started accepting donations using GitHub sponsors and PayPal!

https://github.com/sponsors/AdityaGarg8 https://www.paypal.com/paypalme/AdityaGarg8

I would really appreciate if you would support me. It shall motivate me to work for the community and help in my education.

barzag commented 11 months ago

You cannot receive payment at the moment.

AdityaGarg8 commented 11 months ago

You cannot receive payment at the moment.

What do you mean?

barzag commented 11 months ago

Capture d'écran 2023-12-15 112124 PayPal tells me that you cannot receive payment at the moment.

AdityaGarg8 commented 11 months ago

Oh first of all thanks for the donation

You can try GitHub sponsors. My PayPal is still under process of approval. GitHub sponsors is better as it doesn't charge me any conversion rate.

barzag commented 11 months ago

The credit card was declined by the payment processor, please verify the card's information. If the problem persists, please contact the card's issuer.

I will wait until your PayPal account is validated. Thank you for your work :)

AdityaGarg8 commented 11 months ago

Your welcome:)

AdityaGarg8 commented 11 months ago

@barzag , can you DM me on discord regarding the payment issue please.

AdityaGarg8 commented 11 months ago

I also haven't received any feedback on the kernels. I cannot fix bugs and find errors without any feedback. So I request all to test and give feedback.

AdityaGarg8 commented 11 months ago

The credit card was declined by the payment processor, please verify the card's information. If the problem persists, please contact the card's issuer.

I will wait until your PayPal account is validated. Thank you for your work :)

It's approved now

barzag commented 10 months ago

Hi, I installed the kernel on Proxmox 8, and everything seems to be working except I think the applesmc module is missing in the kernel. When I try to install mbfan, I get the following error message: mbpfan needs applesmc support. Please either load it or build it into the kernel. Exiting.

barzag commented 10 months ago

with T2fand it's perfect :)

AdityaGarg8 commented 10 months ago

T2fand is what you need to use now

Also, closing this issue since we got a successful test. Feel free to open a new issue in case of any problem!

wudzi commented 10 months ago

Apologies for the bad form of reopening an issue when there is no problem. But as you asked for feedback I thought I'd update to say all seems to have gone fine here as well.

The steps I used for reference were as follows

1) Apt upgrade everything to get to the latest version of 7. 2) Update apt sources to Bookwork and run a dist-upgrade (as per standard instructions to upgrade from 7 to 8) 3) Install @AdityaGarg8 6.5 kernal 4) Pin kernel for next boot only to make sure all is ok proxmox-boot-tool kernel pin 6.5.11-7-pve-t2 --next-boot 5) Reboot 6) Pin kernel permanently and install t2fand

Thanks for your work on this.

AdityaGarg8 commented 10 months ago

Thanks for the feedback @wudzi !

Also, please notify in case proxmox releases some new update and I miss it.