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

zfs-kmods: install to /lib/modules instead of /usr/lib/modules #11381

Merged
merged 1 commit into from
Dec 22, 2020

Conversation

problame
Copy link
Contributor

Before this patch, dracut wouldn't find zfs.ko for inclusion in
initramfs.

Steps To Reproduce:

  • Install Fedora 33
  • Install OpenZFS 2.0 build dependencies
  • Install kernel 5.9.14-200.fc33.x86_64 (any will do)
  • cd openzfs-2.0.0
  • ./autogen
  • ./configure # finds kernel 5.9.14-200.fc33.x86_64
  • make rpm-utils
  • make rpm-kmod
  • sudo dnf install *x86_64.rpm
  • lsinitrd /boot/initramfs-5.9.14-200.fc33.x86_64.img | grep zfs.ko
    => does not find anything, probably some missing script
  • dracut -f --kver 5.9.14-200.fc33.x86_64
      $ dracut -f --kver 5.9.14-200.fc33.x86_64
      dracut-install: Failed to find module 'zfs'
      dracut: FAILED:  /usr/lib/dracut/dracut-install
        -D /var/tmp/dracut.3i2y9q/initramfs
        --kerneldir /lib/modules/5.9.14-200.fc33.x86_64/ -m zfs
    
  • let's rule out problems in zfs-dracut:
    # /etc/dracut.conf
    add_drivers+=" zfs "
    
  • dracut -f --kver 5.9.14-200.fc33.x86_64
    same error as above
    

Solution

Install to /lib/modules instead of /usr/lib/modules
=> dracut does the right thing, even without

# /etc/dracut.conf
add_drivers+=" zfs "

Notably, rpm/redhat/zfs-kmod.spec.in does not contain the definition of
the prefix macro that this commit removes in the generic kmod spec.
And https://rpmfusion.org/Packaging/KernelModules/Kmods2 does not
mention prefix at all.

Signed-off-by: Christian Schwarz [email protected]

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

Before this patch, dracut wouldn't find zfs.ko for inclusion in
initramfs.

**Steps To Reproduce**:

- Install Fedora 33
- Install OpenZFS 2.0 build dependencies
- Install kernel 5.9.14-200.fc33.x86_64 (any will do)
- cd `openzfs-2.0.0`
- ./autogen
- ./configure # finds kernel 5.9.14-200.fc33.x86_64
- make rpm-utils
- make rpm-kmod
- sudo dnf install *x86_64.rpm
- lsinitrd /boot/initramfs-5.9.14-200.fc33.x86_64.img | grep zfs.ko
  => does not find anything, probably some missing script
- dracut -f --kver 5.9.14-200.fc33.x86_64
  ```
    $ dracut -f --kver 5.9.14-200.fc33.x86_64
    dracut-install: Failed to find module 'zfs'
    dracut: FAILED:  /usr/lib/dracut/dracut-install
      -D /var/tmp/dracut.3i2y9q/initramfs
      --kerneldir /lib/modules/5.9.14-200.fc33.x86_64/ -m zfs
  ```
- let's rule out problems in zfs-dracut:
  ```
  # /etc/dracut.conf
  add_drivers+=" zfs "
  ```
- dracut -f --kver 5.9.14-200.fc33.x86_64
  ```
  same error as above
  ```

**Solution**

Install to /lib/modules instead of /usr/lib/modules
=> dracut does the right thing, even without

 ```
 # /etc/dracut.conf
 add_drivers+=" zfs "
 ```

Notably, rpm/redhat/zfs-kmod.spec.in does not contain the definition of
the `prefix` macro that this commit removes in the generic kmod spec.
And https://rpmfusion.org/Packaging/KernelModules/Kmods2 does not
mention `prefix` at all.

Signed-off-by: Christian Schwarz <[email protected]>
@problame problame force-pushed the zfs-kmod-dracut-fix branch from 9ad1484 to 006471c Compare December 21, 2020 11:41
@behlendorf behlendorf added Component: Dracut dracut integration Status: Code Review Needed Ready for review and testing labels Dec 21, 2020
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good. I'm surprising this wasn't noticed until now since /lib/modules/ is definitely the correct install location. Thanks!

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Dec 21, 2020
@behlendorf behlendorf merged commit af95939 into openzfs:master Dec 22, 2020
@problame
Copy link
Contributor Author

Great! Could you include this in the 2.0 branch?

ghost pushed a commit to zfsonfreebsd/ZoF that referenced this pull request Dec 23, 2020
Before this patch, dracut wouldn't find zfs.ko for inclusion in
initramfs. This was caused by the packages installing in to
/lib/modules instead of /usr/lib/modules.  Correcting this allows
dracut to do the right thing, even without

    # /etc/dracut.conf
    add_drivers+=" zfs "

Notably, rpm/redhat/zfs-kmod.spec.in does not contain the definition of
the `prefix` macro that this commit removes in the generic kmod spec.
And https://rpmfusion.org/Packaging/KernelModules/Kmods2 does not
mention `prefix` at all.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christian Schwarz <[email protected]>
Closes openzfs#11381
behlendorf pushed a commit that referenced this pull request Dec 23, 2020
Before this patch, dracut wouldn't find zfs.ko for inclusion in
initramfs. This was caused by the packages installing in to
/lib/modules instead of /usr/lib/modules.  Correcting this allows
dracut to do the right thing, even without

    # /etc/dracut.conf
    add_drivers+=" zfs "

Notably, rpm/redhat/zfs-kmod.spec.in does not contain the definition of
the `prefix` macro that this commit removes in the generic kmod spec.
And https://rpmfusion.org/Packaging/KernelModules/Kmods2 does not
mention `prefix` at all.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christian Schwarz <[email protected]>
Closes #11381
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
Before this patch, dracut wouldn't find zfs.ko for inclusion in
initramfs. This was caused by the packages installing in to
/lib/modules instead of /usr/lib/modules.  Correcting this allows
dracut to do the right thing, even without

    # /etc/dracut.conf
    add_drivers+=" zfs "

Notably, rpm/redhat/zfs-kmod.spec.in does not contain the definition of
the `prefix` macro that this commit removes in the generic kmod spec.
And https://rpmfusion.org/Packaging/KernelModules/Kmods2 does not
mention `prefix` at all.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christian Schwarz <[email protected]>
Closes openzfs#11381
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
Before this patch, dracut wouldn't find zfs.ko for inclusion in
initramfs. This was caused by the packages installing in to
/lib/modules instead of /usr/lib/modules.  Correcting this allows
dracut to do the right thing, even without

    # /etc/dracut.conf
    add_drivers+=" zfs "

Notably, rpm/redhat/zfs-kmod.spec.in does not contain the definition of
the `prefix` macro that this commit removes in the generic kmod spec.
And https://rpmfusion.org/Packaging/KernelModules/Kmods2 does not
mention `prefix` at all.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christian Schwarz <[email protected]>
Closes openzfs#11381
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Dracut dracut integration Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants