You are not logged in.

#1 2021-01-16 13:57:42

fallingcats
Member
Registered: 2021-01-16
Posts: 11

[SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

When trying out linux 5.11 for its support of the amd sfh I seem to have a problem loading my f2fs root partition.

I found this thread for linux 5.6 where adding a bunch of crc32 related modules to the initramfs seemed to help, but it does not in this case.
https://bbs.archlinux.org/viewtopic.php?id=220607

Using a sysv or systemd based initramfs does not seem to make a difference either. I built linux-mainline directly from the AUR pkgbuild without changes.
Any ideas?

Last edited by fallingcats (2021-01-17 17:09:35)

Offline

#2 2021-01-16 14:09:10

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

Can you find the crc32 module files if you search around in /usr/lib/modules? I tried looking at the config file for the linux-mainline AUR package and the crc32 settings in there seem to look the same as in the normal Arch linux package, so I guess the modules should have been built.

Maybe something with the autodetection hook of mkinitcpio went wrong? Try booting using the "fallback" initramfs instead of the normal one (small) one. You can check the file contents of the initramfs file with "lsinitcpio", see here an example:

$ lsinitcpio /boot/initramfs-linux-lts.img |& grep crc
usr/lib/modules/5.4.89-1-lts/kernel/crc32c_generic.ko
usr/lib/modules/5.4.89-1-lts/kernel/crc32c-intel.ko
usr/lib/modules/5.4.89-1-lts/kernel/crc-itu-t.ko
usr/lib/modules/5.4.89-1-lts/kernel/libcrc32c.ko

$ lsinitcpio /boot/initramfs-linux-lts-fallback.img |& grep crc
usr/lib/modules/5.4.89-1-lts/kernel/crc16.ko
usr/lib/modules/5.4.89-1-lts/kernel/crc32c_generic.ko
usr/lib/modules/5.4.89-1-lts/kernel/crc32c-intel.ko
usr/lib/modules/5.4.89-1-lts/kernel/crc32_generic.ko
usr/lib/modules/5.4.89-1-lts/kernel/crc32-pclmul.ko
usr/lib/modules/5.4.89-1-lts/kernel/crc7.ko
usr/lib/modules/5.4.89-1-lts/kernel/crc8.ko
usr/lib/modules/5.4.89-1-lts/kernel/crc-itu-t.ko
usr/lib/modules/5.4.89-1-lts/kernel/libcrc32c.ko

Offline

#3 2021-01-16 14:27:06

fallingcats
Member
Registered: 2021-01-16
Posts: 11

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

Ropid wrote:

Can you find the crc32 module files if you search around in /usr/lib/modules? I tried looking at the config file for the linux-mainline AUR package and the crc32 settings in there seem to look the same as in the normal Arch linux package, so I guess the modules should have been built.


Those commands produced the following output for me:

$ lsinitcpio /boot/initramfs-linux-mainline.img 2>&- | grep crc 
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc32c_generic.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc32c-intel.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc32_generic.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc32-pclmul.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc-itu-t.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/libcrc32c.ko

$ lsinitcpio /boot/initramfs-linux-mainline-fallback.img 2>&- | grep crc
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc16.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc32c_generic.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc32c-intel.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc32_generic.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc32-pclmul.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc7.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc8.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/crc-itu-t.ko
usr/lib/modules/5.11.0-rc3-1-mainline/kernel/libcrc32c.ko

I needed to modify them a bit because lsinitcpio butched the output for me.

EDIT:
Fallback does not boot either for me, so yeah...

Last edited by fallingcats (2021-01-16 14:28:48)

Offline

#4 2021-01-16 14:55:02

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

Please post the actual error messages.

Offline

#5 2021-01-16 15:18:44

fallingcats
Member
Registered: 2021-01-16
Posts: 11

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

In case it helps, these is what I'm currently seeing with linux-mainline.img (non fallback, although it does not make a difference)
https://i.imgur.com/uYTeDdy.jpg

My mkinitcpio.conf:

$ cat /etc/mkinitcpio.conf | grep -e '^[^#]' 
MODULES=(crc32_generic crc32-pclmul libcrc32c crc32c crc32c_generic crc32c-intel)
BINARIES=()
FILES=()
HOOKS=(systemd autodetect modconf block fsck filesystems)
COMPRESSION="zstd"
$ sudo mkinitcpio -p linux-mainline
==> Building image from preset: /etc/mkinitcpio.d/linux-mainline.preset: 'default'
  -> -k /boot/vmlinuz-linux-mainline -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-mainline.img
==> Starting build: 5.11.0-rc3-1-mainline
  -> Running build hook: [systemd]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [fsck]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /boot/initramfs-linux-mainline.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux-mainline.preset: 'fallback'
  -> -k /boot/vmlinuz-linux-mainline -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-mainline-fallback.img -S autodetect
==> Starting build: 5.11.0-rc3-1-mainline
  -> Running build hook: [systemd]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: wd719x
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [fsck]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /boot/initramfs-linux-mainline-fallback.img
==> Image generation successful
sudo mkinitcpio -p linux-mainline  60.49s user 5.19s system 163% cpu 40.270 total

Also I am using systemd-boot with this boot entry:

title   Arch Linux (mainline)
linux   /vmlinuz-linux-mainline
#initrd  /amd-ucode.img
initrd  /initramfs-linux-mainline.img
options root=LABEL=arch-greyfire rw

Edit: Added mkinitcpio output

Last edited by fallingcats (2021-01-16 15:23:50)

Offline

#6 2021-01-16 15:30:13

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

I would suggest switching to the none systemd based hooks to unlock the root account in the initrd or copy /usr/lib/initcpio/install/systemd  to /etc/initcpio/install/systemd and change

         echo 'root:*:::::::' >"$BUILDROOT/etc/shadow"

to

     echo "root::::::::" >"$BUILDROOT/etc/shadow"

then rebuild the initrd.  Then you can check what modules are loaded from the emergency shell and try to manually mount the root filesystem.
Are the BPF:No data messages new?

Offline

#7 2021-01-16 15:55:57

fallingcats
Member
Registered: 2021-01-16
Posts: 11

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

loqs wrote:

I would suggest switching to the none systemd based hooks to unlock the root account in the initrd or copy /usr/lib/initcpio/install/systemd  to /etc/initcpio/install/systemd and change

         echo 'root:*:::::::' >"$BUILDROOT/etc/shadow"

to

     echo "root::::::::" >"$BUILDROOT/etc/shadow"

then rebuild the initrd.  Then you can check what modules are loaded from the emergency shell and try to manually mount the root filesystem.
Are the BPF:No data messages new?

After using the systemd approach and doing lsmod, this is what I got:
https://i.imgur.com/t5bU0EU.jpeg
Should I test anything else?

I don't know whether the BPF messges are new. They don't show up in dmesg when booted and booting is to fast to see them while in the ram disk

Last edited by fallingcats (2021-01-16 15:56:17)

Offline

#8 2021-01-16 16:00:13

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

Try manually mounting the root filesystem,  I do not use f2fs so I do not know what options you might need to supply beyond the normal device and mount point:

mount /dev/path/to/root/device /new_root

Offline

#9 2021-01-16 16:05:42

fallingcats
Member
Registered: 2021-01-16
Posts: 11

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

loqs wrote:

Try manually mounting the root filesystem,  I do not use f2fs so I do not know what options you might need to supply beyond the normal device and mount point:

mount /dev/path/to/root/device /new_root

I generally don't need specific options. When trying to mount I get this:
https://i.imgur.com/ZSO9VPn.jpeg

Offline

#10 2021-01-16 16:18:03

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

cat /proc/crypto

Are there any entries with name crc32c and type shash?

Offline

#11 2021-01-16 16:32:37

fallingcats
Member
Registered: 2021-01-16
Posts: 11

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

loqs wrote:
cat /proc/crypto

Are there any entries with name crc32c and type shash?


Yes, the first one is crc32c

name: crc32c
driver: crc32c-generic
module: crc32c_generic
refcnt: 2
[...]

EDIT:
I don't see 'shash' but a couple of different sha's are in there. Here is all output https://imgur.com/a/JAWe5OY

Last edited by fallingcats (2021-01-16 16:39:02)

Offline

#12 2021-01-16 17:03:31

fallingcats
Member
Registered: 2021-01-16
Posts: 11

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

I guess I misread that. But yeah, the first one is 'crc32c' and has type 'shash'

Offline

#13 2021-01-16 17:06:12

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

name         : crc32c
driver       : crc32c-generic
module       : kernel
priority     : 100
refcnt       : 1
selftest     : passed
internal     : no
type         : shash
blocksize    : 1
digestsize   : 4

This is from a 5.11-rc3 kernel where the crc32c-generic is built in but I do not think that is relevant,  the type line is two up from the bottom and has the value shash.
Edit:
Ah cross post,  well that should match what the f2fs module is trying to load.
Check dmesg for more output?  Try the built linux 5.11-rc3 from Unofficial_user_repositories#miffe.

Last edited by loqs (2021-01-16 17:08:27)

Offline

#14 2021-01-16 17:30:46

fallingcats
Member
Registered: 2021-01-16
Posts: 11

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

Okay, I've installed the precompiled package which did not seem to change much (anything), but dmesg's output seems interesting enough ...
https://i.imgur.com/rZjLDgq.jpg

What happened at 54s in is the result of trying to mount manually

Edit:
This seems kinda related: https://bugs.launchpad.net/ubuntu/+sour … ug/1911359

So yeah this seems to be a bug, maybe. Weird that it slipped through until rc3 though.

Edit2:
This is probably hw-related as I too am using a Renoir based laptop.

Last edited by fallingcats (2021-01-16 17:50:58)

Offline

#15 2021-01-16 17:59:05

fallingcats
Member
Registered: 2021-01-16
Posts: 11

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

fallingcats wrote:

dmesg:

BPF: No data
failed to validate module [crc32_pclmul] BTF: -22
BPF: No data
failed to validate module [crc32_generic] BTF: -22
F2FS-fs: Cannot load crc32 driver

This seems kinda related: https://bugs.launchpad.net/ubuntu/+sour … ug/1911359

So yeah this seems to be a bug [...] probably hw-related as I too am using a Renoir based laptop.


I can't tell if this should be reported somewhere else or if it is already sufficiently taken care of by the ubuntu folks.

Offline

#16 2021-01-16 18:21:48

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

Offline

#17 2021-01-16 18:34:52

fallingcats
Member
Registered: 2021-01-16
Posts: 11

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

loqs wrote:

Thanks, compiling will take a while. I will report back tomorrow

Offline

#18 2021-01-17 04:05:52

fallingcats
Member
Registered: 2021-01-16
Posts: 11

Re: [SOLVED] linux 5.11-rc3: f2fs cannot load crc32 driver

Okay that seems to have done it, it's up and running now (but without amd sfh, seems that isn't built by default - should've thought of that...)

Thanks you loqs for helping uncover this.

Offline

Board footer

Powered by FluxBB