linux-surface / kernel

Linux kernel with modifications for Microsoft Surface devices.
Other
118 stars 33 forks source link

UFS module missing #153

Closed g3blv closed 4 months ago

g3blv commented 4 months ago

I'm trying to run linux-surface on Surface Go 4. I've installed Fedora as per https://github.com/linux-surface/linux-surface/issues/1162#issuecomment-2005363664, but it is still not booting because it can't find the "hard drive". Surface Go 4 uses UFS (Universal Flash Storage) which ideally needs to be enabled in the kernel to be available on boot. I compared:

Fedora "Live" vs. Fedora 40 fresh install vs. Fedora with surface kernel.

Fedora Live

liveuser@localhost-live:~$ cat /boot/config-6.8.5-301.fc40.x86_64 | grep UFS
CONFIG_SCSI_UFSHCD=m
CONFIG_SCSI_UFS_BSG=y
CONFIG_SCSI_UFS_CRYPTO=y
CONFIG_SCSI_UFS_HWMON=y
CONFIG_SCSI_UFSHCD_PCI=m
# CONFIG_SCSI_UFS_DWC_TC_PCI is not set
CONFIG_SCSI_UFSHCD_PLATFORM=m
CONFIG_SCSI_UFS_CDNS_PLATFORM=m
CONFIG_UFS_FS=m
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_UFS_DEBUG is not set
liveuser@localhost-live:~$ lsmod | grep ufs
ufs                   102400  0
liveuser@localhost-live:~$ 

Fedora fresh install

surface@fedora:~$ cat /boot/config-6.8.5-301.fc40.x86_64 | grep UFS
CONFIG_SCSI_UFSHCD=m
CONFIG_SCSI_UFS_BSG=y
CONFIG_SCSI_UFS_CRYPTO=y
CONFIG_SCSI_UFS_HWMON=y
CONFIG_SCSI_UFSHCD_PCI=m
# CONFIG_SCSI_UFS_DWC_TC_PCI is not set
CONFIG_SCSI_UFSHCD_PLATFORM=m
CONFIG_SCSI_UFS_CDNS_PLATFORM=m
CONFIG_UFS_FS=m
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_UFS_DEBUG is not set
surface@fedora:~$ lsmod | grep ufs
surface@fedora:~$

Fedora with surface kernel

surface@fedora:~$ cat /boot/config-6.8.8-1.surface.fc40.x86_64 | grep UFS
CONFIG_SCSI_UFSHCD=m
CONFIG_SCSI_UFS_BSG=y
CONFIG_SCSI_UFS_CRYPTO=y
CONFIG_SCSI_UFS_HWMON=y
CONFIG_SCSI_UFSHCD_PCI=m
# CONFIG_SCSI_UFS_DWC_TC_PCI is not set
CONFIG_SCSI_UFSHCD_PLATFORM=m
CONFIG_SCSI_UFS_CDNS_PLATFORM=m
CONFIG_UFS_FS=m
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_UFS_DEBUG is not set
surface@fedora:~$ lsmod | grep ufs
surface@fedora:~$ 

I then tried loading UFS with modprobe ufs for the surface kernel, but it couldn't find the module. I then had look in modules directory, and it seems like the ufs module is missing from the module directory for the surface kernel.

surface@fedora:~$ ls /lib/modules/6.8.8-1.surface.fc40.x86_64/kernel/fs/ufs/
surface@fedora:~$ ls /lib/modules/6.8.5-301.fc40.x86_64/kernel/fs/ufs/
ufs.ko.xz

Would it be possible to include the ufs module for the surface kernel? Even better, have it enabled in the kernel and not having to load the module when installing the surface kernel?

Please let me know if there is any additional information I can provide.

I raised something similar before here: https://github.com/linux-surface/linux-surface/issues/1371

StollD commented 4 months ago

As you can see, the configuration for the default kernel and the surface kernel are identical. So it is enabled. Fedora just puts it into a different package, and we inherit that.

Try running sudo dnf install kernel-surface-modules-extra.