OSMC images expect the filesystem to be on SD card (mmcblk). It ought to be easy to patch the installer to change that for USB drives (sda), but no-one’s got around to that yet.
It could be that a similar patch would work for PCIe (substitute nvme0n1 etc for sda1??) but I don’t know how different CMs are from standard RPis. Further tweaks may be necessary. You could compare a PiOS install with an OSMC RPi install to find out.
The NVME drive is not initialized at the bootloader stage. I had already tried the above recommendation, but the NVME does not show up at all using the df command in shell. Here is a link to a github comment from Phil Elwell from RPi Foundation on the same topic:
I looked at config.gz last night and confirmed that CONFIG_BLK_DEV_NVME=m (rather than y)
The second config is to allocate memory on the NVME drive for the firmware files and was also recommended by Elwell in another post and is used in RPOS. Note that since the linked post, the newest firmware can now boot natively (previously the boot folder still had to be on either SD card or eMMC) as long as the above changes are in effect.
On a side note, one easy thing to do for CM4 users that would be very helpful to enable USB (not enabled by default on CM4), would be to add the line:
to the /etc/modules file
and the lines:
to config.txt in the boot folder
Since it has the CM4 parameter, it should not have any negative effect (or any effect) for users of other Pi devices. I was able to mount the device on Ubuntu to add this, but other users may not know to.
The “otg_mode=1” enables the XHCI port so that USB is accessible, it’s just enabling USB in host mode only. Since the CM4 doesn’t offer any USB without explicit activation in config.txt, either DWC2 “dtoverlay=dwc2,dr_mode=host” or XHCI “otg_mode=1” must be present and have a module in the OS. The i2c-dev module is present in most new RPi4B OS’s and in Raspberry Pi OS itself. I’m not familiar with the normal installation process because I use PINN (NOOBS), so if there is no separate 4B installer than I see your point.
I compiled the kernel with the two patches I mentioned above and was able to boot up straight into NVME with no problem. I will try to figure out how to make a pull request, thanks!