Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.1.5 dracut fails to load zfs kernel module #13573

Closed
prometheanfire opened this issue Jun 20, 2022 · 8 comments
Closed

2.1.5 dracut fails to load zfs kernel module #13573

prometheanfire opened this issue Jun 20, 2022 · 8 comments
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@prometheanfire
Copy link
Contributor

System information

Type Version/Name
Distribution Name Gentoo
Distribution Version you know...
Kernel Version 5.18.5-r1
Architecture x86_64
OpenZFS Version zfs-2.1.5-staging

Describe the problem you're observing

dracut is not finding the zfs module for 2.1.5

Describe how to reproduce the problem

/usr/bin/dracut --force --kernel-image /usr/src/linux-5.18.5-gentoo-dist/arch/x86/boot/bzImage /usr/src/linux-5.18.5-gentoo-dist/arch/x86/boot/initrd 5.18.5-gentoo-dist --keep -v --debug

Include any warning/errors/backtraces from the system logs

/usr/bin/dracut --force --kernel-image /usr/src/linux-5.18.5-gentoo-dist/arch/x86/boot/bzImage /usr/src/linux-5.18.5-gentoo-dist/arch/x86/boot/initrd 5.18.5-gentoo-dist --keep -v --debug 2>&1 | tee dracut-zfs.log

posted to https://gist.github.com/3e3afb69f7bec2c528c4f02365df28f7

dracut --list-modules | grep zfs

dracut: Executing: /usr/bin/dracut --list-modules
zfsexpandknowledge
zfs
@prometheanfire prometheanfire added the Type: Defect Incorrect behavior (e.g. crash, hang) label Jun 20, 2022
@prometheanfire
Copy link
Contributor Author

https://github.com/openzfs/zfs/pull/13010/files#diff-22405e99fd7136e3e27a96eac249dc6ed93c6eb9d86498155a1545dac45690bbR92 is also trying to install a file that doesn't exist, next debug step is to revert that full commit...

@prometheanfire
Copy link
Contributor Author

Looking at https://github.com/openzfs/zfs/commits/zfs-2.1.5-staging/contrib/dracut/

0671f72 is the last commit that works

@RarogCmex RarogCmex mentioned this issue Jun 20, 2022
13 tasks
@behlendorf
Copy link
Contributor

Thanks for catching this. I believe that makes sense since commit ebbfc6c should make the install fatal if something is missing. In your case what file was it complaining about, any idea why it's missing?

Would you also mind confirming that reverting these patches from the stack resolves the issue? These aren't must have changes, but they were not expected to be problematic since there were backports from master.

115e059 Multiple dracut module install script cleanups
4252517 Remove absolute paths to udev rules and binaries for dracut
ebbfc6c Make dracut fail if essential files cannot be installed

@prometheanfire
Copy link
Contributor Author

I tried with via checkout only (the 0671f72 commit). I'll try with revert patches individually first.

It looks like the log file gist was too long and got truncated. It was saying it was unable to find the zfs module, but when I run --list-modules with dracut it is listed. Let me regenerate some logs and test some patches.

@prometheanfire
Copy link
Contributor Author

well, first, separate issue is...

Failed to add dependency on unit, unit zfs-load-module.service does not exist. That's a debianism, talked a little about it in the pull-request yesterday. The line should probably be removed.

@prometheanfire
Copy link
Contributor Author

dracut: *** Including module: zfs ***
dracut-install: Failed to find module 'zfs'
dracut: FAILED:  /usr/lib/dracut/dracut-install -D /var/tmp/portage/sys-kernel/gentoo-kernel-bin-5.18.5-r1/temp/dracut.P8KjE1/initramfs --kerneldir /lib/modules/5.18.5-gentoo-dist/ -m zfs
dracut: installkernel failed in module zfs

The error for me seems to be specifically ebbfc6c#diff-22405e99fd7136e3e27a96eac249dc6ed93c6eb9d86498155a1545dac45690bbR22 where it adds the -c option to instmods.

@prometheanfire
Copy link
Contributor Author

prometheanfire commented Jun 20, 2022

setting -c does has the function do the following.

  1. local _optional="-o"
  2. if [[ $1 == '-c' ]]; then unset _optional
  3. which makes -o NOT be passwd to dracut_install ${_optional:+-o}
  4. this means If SOURCE does not exist, do not fail

`/usr/bin/dracut --force --kernel-image /usr/src/linux-5.18.5-gentoo-dist/arch/x86/boot/bzImage /usr/src/linux-5.18.5-gentoo-dist/arch/x86/boot/initrd 5.18.5-gentoo-dist --keep

was run to get a useful debug dir, still got:

dracut: *** Including module: zfs ***
dracut-install: Failed to find module 'zfs'
dracut: FAILED:  /usr/lib/dracut/dracut-install -D /var/tmp/dracut.GOQONy/initramfs --kerneldir /lib/modules/5.18.5-gentoo-dist/ -m zfs
dracut: installkernel failed in module zfs
Not removing /var/tmp/dracut.GOQONy.

/usr/lib/dracut/dracut-install -D /var/tmp/dracut.GOQONy/initramfs --kerneldir /lib/modules/5.18.5-gentoo-dist/ -m zfs --debug got me the following (added --debug)

dracut-install: Program arguments:
dracut-install: /usr/lib/dracut/dracut-install
dracut-install: -D
dracut-install: /var/tmp/dracut.GOQONy/initramfs
dracut-install: --kerneldir
dracut-install: /lib/modules/5.18.5-gentoo-dist/
dracut-install: -m
dracut-install: --debug
dracut-install: zfs
dracut-install: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin
dracut-install: LDD=ldd
dracut-install: Handle module 'zfs'
dracut-install: Failed to find module 'zfs'


reinstalled zfs-kmod

it found the module this time.  so I think we are good, no bug

will update description and make a pull request to not try installing the debianism systemd unit.

`Failed to add dependency on unit, unit zfs-load-module.service does not exist.`

@prometheanfire prometheanfire changed the title 2.1.5 dracut fails to load dracut module 2.1.5 dracut fails to load zfs kernel module Jun 20, 2022
@prometheanfire
Copy link
Contributor Author

#13574 was made for the systemd unit install issue

summary here may be user error, kernel module was not installed, though the actual module was there (maybe it wasn't in an index somewhere).

find /lib/modules/5.18.5-gentoo-dist/ | grep zfs
/lib/modules/5.18.5-gentoo-dist/extra/zfs
/lib/modules/5.18.5-gentoo-dist/extra/zfs/zfs.ko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

2 participants