I am trying to compile a Kernel with SATA_AHCI and MARVELL Support for Ubuntu 20.04lts to run on a Raspberry Pi Compute Module 4.
I have succeeded in doing this using RaspiOS. My SATA PCI Card with a 4 disk ZFS RaidZ2 Pool works fine.
**lsblk**
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 1.8T 0 disk
├─sda1 8:1 1 1.8T 0 part
└─sda9 8:9 1 8M 0 part
sdb 8:16 1 1.8T 0 disk
├─sdb1 8:17 1 1.8T 0 part
└─sdb9 8:25 1 8M 0 part
sdc 8:32 1 1.8T 0 disk
├─sdc1 8:33 1 1.8T 0 part
└─sdc9 8:41 1 8M 0 part
sdd 8:48 1 1.8T 0 disk
├─sdd1 8:49 1 1.8T 0 part
└─sdd9 8:57 1 8M 0 part
mmcblk0 179:0 0 29G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 28.7G 0 part /
I have been using Gentoo for a good 20 years, so very familiar with building Kernels.
I followed this excellent plan.
I have enabled CONFIG_ATA_GENERIC, CONFIG_SATA_AHCI, CONFIG_SATA_MV in the config. The build fails with a missing libahci module:
Debug: module-check-raspi
II: Checking modules for raspi...
reading new modules...read 4271 modules.
reading old modules...
MISS: libahci
read 4272 modules : new(0) missing(1)
EE: Missing modules (start begging for mercy)
make: *** [debian/rules.d/4-checks.mk:10: module-check-raspi] Error 1
I cannot find why this has failed. The drivers seem to be there as shown by this:
**find ~/kbuild/ -iname libahci***
/root/kbuild/focal/debian/linux-modules-5.4.0-1041-raspi/lib/modules/5.4.0-1041-raspi/kernel/drivers/ata/libahci_platform.ko
/root/kbuild/focal/debian/build/build-raspi/drivers/ata/libahci_platform.mod
/root/kbuild/focal/debian/build/build-raspi/drivers/ata/libahci_platform.ko
/root/kbuild/focal/debian/build/build-raspi/drivers/ata/libahci_platform.mod.c
/root/kbuild/focal/debian/build/build-raspi/drivers/ata/libahci_platform.o
/root/kbuild/focal/debian/build/build-raspi/drivers/ata/libahci_platform.mod.o
/root/kbuild/focal/debian/build/build-raspi/drivers/ata/libahci.o
/root/kbuild/focal/drivers/ata/libahci_platform.c
/root/kbuild/focal/drivers/ata/libahci.c
Any ideas much appreciated.
----------------------------- EDIT ---------------------------------
By chance I have discovered that the latest 64bit RaspiOS has built in SATA support. This is the 2021-05-07-raspios-buster-arm64-lite image.
Therefore I am able to rescue my ZFS Pool and get going without messing about trying to compile kernels!