You are not logged in.

#1 2012-10-05 10:16:25

ronnylov
Member
Registered: 2010-12-21
Posts: 65

How to properly update external kernel modules at kernel updates?

Hi!

I have a nwwbie question. In the Wiki there is a section of how to install Arch Linux on ZFS root.
https://wiki.archlinux.org/index.php/In … nux_on_ZFS

But I wonder what happens when there is an update of the Linux kernel? I use ZFS only for storage now and every time there is a new kernel update I get conflicts between ZFS and the new kernel so I can not install the new kernel without uninstall zfs first. Is it possible to recompile the ZFS kernel module for the new kernel without first rebooting to the new kernel?

The way I solve it today is to uninstall ZFS and spl packages, upgrade the kernel, reboot and recompile zfs and spl packages after the reboot and install them again.
But if I was using ZFS as a root file system then I do not understand how to do this (I can not boot on ZFS if I have uninstalled the zfs module before the reboot).

Of course I could have asked this question in the comments of the wiki page, but I see this can be a genreal question also. If an external kernel module is required for booting and it depends on the kernel then how is it possible to recompile the module for the new kernel before rebooting? I think there is something called DKMS that can assist but it should be possible to do it manually also?

Offline

#2 2012-10-05 11:17:17

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: How to properly update external kernel modules at kernel updates?

just run makepkg -i again? No need to uninstall.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2012-10-05 11:46:45

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: How to properly update external kernel modules at kernel updates?

According to AUR wiki I use makepkg -s to create a package?
OK I will try it and see ho it works at next kernel update.
Perhaps the problem was because of trying to update both the kernel and the zfs module at the same time.

Edit: I found the makepkg wiki. makepkg -i is just a shorter way of "pacman -U package.tar.gz".
So you mean there is no need to recompile the zfs package to adopt it for the new kernel, just reinstall the package?

It depends on linux >3.5 and linux-headers >3.5.
I tend to get dependency problems at the kernel updates but I will investigate further next time and note exact output to troubleshoot.

Last edited by ronnylov (2012-10-05 12:05:32)

Offline

#4 2012-10-05 12:03:34

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: How to properly update external kernel modules at kernel updates?

makepkg -i won't work as the kernel module will then then be build against the current kernel, NOT the new kernel.


A possible solution would be to have 2 systems around :

A with standard hardware/software , B requires the special module to boot.

put the kernel in the IgnorePkg list in pacman.conf on B .

When a new kernel is released, update A and build the kernel module there.
put the kernel module in a local repo, that must be accessible from B .
update B, reboot if necessary
On B :   

pacman -Syu special_kernel_module linux

reboot B


Note : technically A and B could be on the same machine .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2012-10-05 12:14:17

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: How to properly update external kernel modules at kernel updates?

Well I was thinking of having one grub menu alternative to boot on ext4 root (standard hardware/software for booting) as a rescue option if things fails with ZFS and another choises for ZFS roots. Thanks!

Offline

#6 2012-10-05 17:33:27

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: How to properly update external kernel modules at kernel updates?

Lone_Wolf wrote:

makepkg -i won't work as the kernel module will then then be build against the current kernel, NOT the new kernel.

Will work fine if you have the PKGBUILD build it against the installed kernel instead of the running one.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#7 2012-10-05 22:13:32

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: How to properly update external kernel modules at kernel updates?

Since this will be my server with plenty of RAM (16 GB) maybe I'll just set up a virtual machine as a "building machine" to create the packages I need.

Offline

#8 2012-11-12 00:16:27

blackwhite
Member
Registered: 2012-11-02
Posts: 7

Re: How to properly update external kernel modules at kernel updates?

I have the same question too, I asked the same question at kernel sub-forum 2 weeks ago.
For a minor kernel update, you can just copy

/usr/lib/modules/`uname -r`/addon

to /usr/lib/modules/new_kernel. then do a

pacman -U /var/cache/pacman/pkg/linux-new-version

.
It is really painful on a system using zfs as root fs. I think the gentoo way is much easier to follow, The /usr/src/linux is always a symbol link to a specific version what the user want. Every modules updates is compiled again /usr/src/linux, which is mucher easier to update 3rd party modules without booting into that kernel, obviously the user have to update 3rd party kernel after updating to a new kernel before booting into the new version kernel.

Last edited by blackwhite (2012-11-12 00:26:13)

Offline

#9 2012-11-12 00:24:53

blackwhite
Member
Registered: 2012-11-02
Posts: 7

Re: How to properly update external kernel modules at kernel updates?

Mr.Elendig wrote:

Will work fine if you have the PKGBUILD build it against the installed kernel instead of the running one.

I googled it, but can't find the solution. Would you explain it a bit, for example, the PKGBUILD below, how to change it to let it compile against a specific version kernel? Thanks.

pkgname=('zfs')
# When changing versions, search and replace 0.6.0-rc11, using package
# variables breaks AUR parsing.
pkgver=0.6.0_rc11
pkgrel=2
arch=('i686' 'x86_64')
pkgdesc="Native ZFS for Linux"
url="http://zfsonlinux.org/"
depends=('linux-lts>=3.0' "spl>=${pkgver}" "zfs-utils>=${pkgver}")
makedepends=('linux-lts-headers>=3.0')
source=(http://github.com/downloads/zfsonlinux/zfs/zfs-0.6.0-rc11.tar.gz
        zfs_preempt.patch
        )
md5sums=('85435c100d9c1dadad7b961c3cb965f6'
         '13d63bbc0497ccc03d982817b6319512')
license=('CDDL')
install=zfs.install

build() {
  cd ${srcdir}/zfs-0.6.0-rc11
  patch -p0 -i ${srcdir}/zfs_preempt.patch
  ./autogen.sh
  ./configure --with-config=kernel \
              --prefix=/usr \
              --sysconfdir=/etc \
              --sbindir=/usr/sbin \
              --libdir=/usr/lib \
              --datadir=/usr/share \
              --includedir=/usr/include \
              --with-udevdir=/lib/udev \
              --libexecdir=/usr/lib/zfs-0.6.0-rc11
  make
}

package() {
  cd ${srcdir}/zfs-0.6.0-rc11
  make DESTDIR=${pkgdir} install

  # move module tree /lib -> /usr/lib
  cp -r ${pkgdir}/{lib,usr}
  rm -r ${pkgdir}/lib

Offline

#10 2012-11-12 01:45:33

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: How to properly update external kernel modules at kernel updates?

blackwhite wrote:

Would you explain it a bit, for example, the PKGBUILD below, how to change it to let it compile against a specific version kernel?

Differs based on package, that question is better asked upstream.

Looking at that PKGBUILD, you should look at the contents of autogen.sh or the configure script, and maybe do some sed magic to change calls to uname to a fixed value.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB