> kernels aren't numbered in a suitable way. On Debian for example,
packages like linux-image-amd64 are versioned with the full kernel version
- eg: 6.12.73-1, or 7.0.4-1~bpo13+1.

I really don't understand this argument. What's stopping you from simply
incrementing the minor? After all, if ZFS only supports up to 6.19, and you
specify <6.20, then it doesn't matter if 6.20 exists, it's still less than
7.0. You're literally already using it in `Recommends` ("linux-libc-dev (<<
6.20~)"), I don't understand why you couldn't also use it in `Depends`.

> I maintain a local package "zfs-linux-image-amd64" which strictly depends
on specific kernel and zfs-dkms | zfs-modules versions

I don't like this. I specifically chose Debian because I don't want to
touch my server *at all*. So anyway, I wrote a little hook
(`DPkg::Pre-Install-Pkgs`) that does what I want:

```bash
#!/usr/bin/bash

cat | while read p; do
    [[ $p == */zfs-dkms_* ]] || continue
    t=/tmp/$(basename $p .deb)
    dpkg-deb -R $p $t
    sed -i "/^Depends:/{/linux-image-amd64/!s/$/, linux-image-amd64 (<<
$(awk '/^Linux-Maximum:/{split($2,v,".");print v[1]"."v[2]+1}'
$t/usr/src/*/META)~)/};/^Version:/s/$/+/" $t/DEBIAN/control
    dpkg-deb -b $t $p
    rm -r $t
done
```

(I had to also increase the version otherwise it would reinstall the same
version over and over again)

Reply via email to