For testing purposes I always just grab a bionic or stretch minimal image from ayufan, then look for latest mainline kernel available and install it:
apt-cache search kernel | grep -- '-4\.1'
apt install linux-image-4.18.0-rc5-1048-ayufan-g69e417fe38cf
Mainline kernel was a requirement to use PCIe in the past but according to release notes that might have changed recently (by disabling SDIO). So you might want to test with both 4.4 and mainline...
Edit: Don't forget to always check /proc/interrupts for the PCIe related IRQs and assign them to one of the big cores.
After fighting with this with a few distros.. I am close here:
1. First, go to your linux-headers directory (e.g. /usr/src/linux-headers-4.4.129-rk3328/) and:
If that fails (classmap.h missing for example), there is a problem with the headers package. You may need to manually edit scripts/Makefile and comment out the line with selinux -- there is a problem with the kernel config not matching the header deb in my case.
# subdir-$(CONFIGS_SECURITY_SELINUX) += selinux
2. From the same headers directory, verify that include/generated/utsrelease.h matches the full kernal name from: uname -a
- My headers (from beta repo) had 4.4.129 as utsrelease.h and 4.4.129-rk3328 as the kernel version/release. This causes modules to be built incorrectly and their vermagic to not match--you can use modprobe --force to get around this, but ill-advised to use that for more than a quick test with something like zfs. My utsrelease.h now reads: 4.4.129-rk3328
3. Edit /var/lib/dkms/spl/<yourversion>/source/configure and search for KUID, for lines that look like this:
When configure runs, you should now see:
checking whether kuid_t/kgid_t is available... yes; mandatory
- I ended up switching to beta (sources.d) and doing an update/upgrade/dist-upgrade first because there were no kernel headers for the WIP rock64 image I installed.
- If you use kernel 4.11.x you will need to use SPL/ZFS 0.7.x. I am using the standard zfs-dkms/spl-dkms 0.6.5.9 packages for now.. install SPL and let it fail, then dkms install it after the steps above and then install the ZFS package.
Just started with Armbian today .. in retrospect it looks like it has drawn me in..