Error on prepare() trying to build the zen-kernel

I am trying to install the kernel: " linux-zen-vfio 5.9.13.zen1-1 " from AUR. (http://aur.archlinux.org/packages/linux-zen-vfio)

However it fails me on prepare() with this error:

==> Starting prepare()...
Setting version...
Applying patch add-acs-overrides.patch...
can't find file to patch at input line 53
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 169ce1a1bf376ba90cd0ab51ec19f9e32ead9dcb Mon Sep 17 00:00:00 2001
|From: Mark Weiman <mark.weiman@markzz.com>
|Date: Wed, 6 May 2020 15:40:50 -0400
|Subject: [PATCH] pci: Enable overrides for missing ACS capabilities (5.6.9+)
|
|This an updated version of Alex Williamson's patch from:
|https://lkml.org/lkml/2013/5/30/513
|
|Original commit message follows:
|---
|PCIe ACS (Access Control Services) is the PCIe 2.0+ feature that
|allows us to control whether transactions are allowed to be redirected
|in various subnodes of a PCIe topology.  For instance, if two
|endpoints are below a root port or downsteam switch port, the
|downstream port may optionally redirect transactions between the
|devices, bypassing upstream devices.  The same can happen internally
|on multifunction devices.  The transaction may never be visible to the
|upstream devices.
|
|One upstream device that we particularly care about is the IOMMU.  If
|a redirection occurs in the topology below the IOMMU, then the IOMMU
|cannot provide isolation between devices.  This is why the PCIe spec
|encourages topologies to include ACS support.  Without it, we have to
|assume peer-to-peer DMA within a hierarchy can bypass IOMMU isolation.
|
|Unfortunately, far too many topologies do not support ACS to make this
|a steadfast requirement.  Even the latest chipsets from Intel are only
|sporadically supporting ACS.  We have trouble getting interconnect
|vendors to include the PCIe spec required PCIe capability, let alone
|suggested features.
|
|Therefore, we need to add some flexibility.  The pcie_acs_override=
|boot option lets users opt-in specific devices or sets of devices to
|assume ACS support.  The "downstream" option assumes full ACS support
|on root ports and downstream switch ports.  The "multifunction"
|option assumes the subset of ACS features available on multifunction
|endpoints and upstream switch ports are supported.  The "id:nnnn:nnnn"
|option enables ACS support on devices matching the provided vendor
|and device IDs, allowing more strategic ACS overrides.  These options
|may be combined in any order.  A maximum of 16 id specific overrides
|are available.  It's suggested to use the most limited set of options
|necessary to avoid completely disabling ACS across the topology.
|Note to hardware vendors, we have facilities to permanently quirk
|specific devices which enforce isolation but not provide an ACS
|capability.  Please contact me to have your devices added and save
|your customers the hassle of this boot option.
|---
|
|diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
|index fb95fad81c79..0a1e5281809a 100644
|--- a/Documentation/admin-guide/kernel-parameters.txt
|+++ b/Documentation/admin-guide/kernel-parameters.txt
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 72
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
|index 2ea61abd5830..025974dfc10a 100644
|--- a/drivers/pci/quirks.c
|+++ b/drivers/pci/quirks.c
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
2 out of 2 hunks ignored
==> ERROR: A failure occurred in prepare().
    Aborting...

I would like to fix it but don’t know how. Could somebody please help me :slight_smile:

Building Arch specific kernels on Manjaro is not a good project and you issue is a great example of Manjaro is not Arch.

You need intimate knowledge of the kernel you want to build and makefiles and patch files.

The message is created by using the wrong patchfile - it is not matching the source - but that is all I know.

We cannot help you with this project - if you want to use Arch kernels - install Arch.

aw shoot, the main reason why I wanted to install that kernel was to be able to use anbox (to run android apps on my machine)
I can install anbox, but it won’t start because it needs the modules:

  • binder_linux
  • ashmem-linux

I tried to modprobe these modules:
sudo modprobe binder_linux ashmem-linux

however this failed on me (output):

modprobe: FATAL: Module binder_linux not found in directory /lib/modules/5.9.11-3-MANJARO

the Arch wiki told me to use a special kernel:
https://wiki.archlinux.org/index.php/Anbox

Maybe you are missing the kernel sources for those patches to be applied to.

See this repo how Manjaro builds the current 5.9 kernel.

Seeing Manjaro is at 5.9.14 i would suggest you to also use the same version in the pkgver variable of your PKGBUILD… so it uses correct patches, see their tags.
They even provide the kernel sources they used, see the “Source zip” on the release page of that tag: Release Linux ZEN kernel v5.9.14-zen1 · zen-kernel/zen-kernel · GitHub

So you could try to manually build that kernel with all patches (theirs, manjaro’s and the ones in the AUR).

I won’t be able to assist you further on this journey :wink: