You are not logged in.

#1 2021-11-03 22:25:05

bugandy
Member
Registered: 2020-01-01
Posts: 26

[SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

Hi.

Since my video card is no longer supported by the new nvidia drivers I would like to have the legacy drivers (470xx) compiling the dkms in tmp fakeroot, in other word without having all dkms stuff installed on my system.

Since I've seen that someone has done the same thing for a previous version (390xx) I've tried to edit such pkgbuild, can someone please review my changes so that i can be sure not to mess up my system by using it?

# Maintainer: Jonathon Fernyhough <jonathon at+m2x+dev>
# Contributor: Alonso Rodriguez <alonsorodi20 (at) gmail (dot) com>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
# Contributor: loqs
# Contributor: Dede Dindin Qudsy <xtrymind+gmail+com>
# Contributor: Ike Devolder <ike.devolder+gmail+com>

pkgname=nvidia-470xx
pkgver=470.82.00
pkgrel=2
pkgdesc="NVIDIA drivers for linux, 470xx legacy branch"
arch=('x86_64')
url="https://www.nvidia.com/"
makedepends=("nvidia-470xx-utils=${pkgver}" 'libglvnd' 'linux-headers' "nvidia-470xx-dkms=$pkgver")
provides=('NVIDIA-MODULE')
conflicts=('nvidia')
license=('custom')
options=('!strip')

build() {
    #cd "${_pkg}"/kernel
    #make SYSSRC=/usr/src/linux module

    _kernver=$(</usr/src/linux/version)

    fakeroot dkms build --dkmstree "${srcdir}" -m nvidia/${pkgver} -k ${_kernver}
}

package() {
    depends=('linux' "nvidia-470xx-utils=${pkgver}" 'libglvnd')

    _kernver="$(</usr/src/linux/version)"

    install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/extramodules" -m644 \
        nvidia/${pkgver}/${_kernver}/${CARCH}/module/*

    # compress each module individually
    find "$pkgdir" -name '*.ko' -exec xz -T1 {} +

    echo "blacklist nouveau" |
        install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/${pkgname}.conf"

    install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 \
        /usr/share/licenses/nvidia-470xx-dkms/LICENSE
}

Last edited by bugandy (2021-11-05 11:38:35)

Offline

#2 2021-11-04 11:12:44

jonathon
Member
Registered: 2016-09-19
Posts: 128

Re: [SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

Why not use `makechrootpkg` (or something like `aurutils`)?

Offline

#3 2021-11-04 11:45:20

bugandy
Member
Registered: 2020-01-01
Posts: 26

Re: [SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

AUR helper and makepkg tools needs a pkgbuild to work, one for 390xx is in AUR, one for 470xx not.

Offline

#4 2021-11-04 11:48:49

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,845

Re: [SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

https://aur.archlinux.org/pkgbase/nvidia-470xx-utils/

Or do you want a non-dkms package for a specific kernel ?


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

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2021-11-04 12:01:52

bugandy
Member
Registered: 2020-01-01
Posts: 26

Re: [SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

No, i'd like just nvidia-xx-dkms not to be installed directly on my system because when it compiles the kernel modules it generates a lot of orphan files that are difficult to clean.

The pkgbuild I linked in the first post seems to do exactly what I want but with a different version of the drivers.

Offline

#6 2021-11-04 12:17:39

Maniaxx
Member
Registered: 2014-05-14
Posts: 760

Re: [SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

bugandy wrote:

because when it compiles the kernel modules it generates a lot of orphan files that are difficult to clean.

You mean leftovers of makepkg?


sys2064

Offline

#7 2021-11-04 12:54:36

bugandy
Member
Registered: 2020-01-01
Posts: 26

Re: [SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

No, i mean leftovers of module rebuilding by pacman hook after every kernel or driver update.

Offline

#8 2021-11-04 14:25:55

jonathon
Member
Registered: 2016-09-19
Posts: 128

Re: [SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

bugandy wrote:

it generates a lot of orphan files that are difficult to clean.

This sounds like an older bug in DKMS (which was supposed to have been fixed) - if this is still happening then it likely needs to be reported so it can be fixed (again).

bugandy wrote:

can someone please review my changes so that i can be sure not to mess up my system by using it?

Looks fine to me. You can also compare with the 495.44 version, https://github.com/archlinux/svntogit-p … k/PKGBUILD . Your PKGBUILD includes some makedepends that are possibly not required here.

I didn't upload an `nvidia-470xx` as it seems a bit odd to have a kernel-specific package that needs constant rebuilds in the AUR - is there value to having it present?

Offline

#9 2021-11-04 15:51:51

Maniaxx
Member
Registered: 2014-05-14
Posts: 760

Re: [SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

bugandy wrote:

No, i mean leftovers of module rebuilding by pacman hook after every kernel or driver update.

What files exactly?


sys2064

Offline

#10 2021-11-04 22:21:50

bugandy
Member
Registered: 2020-01-01
Posts: 26

Re: [SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

Your PKGBUILD includes some makedepends that are possibly not required here.

Thank you. Removed those dependencies and try to build trough pikaur, run into some error like "inconsistent trough package" hmm

And yes, I consider that needs constant rebuilds but it sounded like a better system to me, but at this point I don't exclude to give another chance to the dkms-hooks.


What files exactly?

I can't remember the exact names of the files, but the fact is that pacman returned an endless list of orphaned files and I was unable to locate a parent directory for all of them.

Offline

#11 2021-11-04 23:13:29

loqs
Member
Registered: 2014-03-06
Posts: 18,822

Re: [SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

bugandy wrote:

Your PKGBUILD includes some makedepends that are possibly not required here.

Thank you. Removed those dependencies and try to build trough pikaur, run into some error like "inconsistent trough package" hmm

Works without "nvidia-470xx-utils=${pkgver}" 'libglvnd'  in makedepends using `extra-x86_64-build -- -I ../nvidia-470xx-utils/nvidia-470xx-dkms-470.82.00-2-x86_64.pkg.tar.zst -I ../nvidia-470xx-utils/nvidia-470xx-utils-470.82.00-2-x86_64.pkg.tar.zst`
nvidia-470xx-dkms=$pkgver pulls in nvidia-470xx-utils which pulls in libglvnd.  So appears to be a pikaur issue rather than an issue with the PKGBUILD / makepkg.

Offline

#12 2021-11-05 11:37:53

bugandy
Member
Registered: 2020-01-01
Posts: 26

Re: [SOLVED] nvidia-470xx pkgbuild with dkms compiled in fakeroot

This sounds like an older bug in DKMS (which was supposed to have been fixed)

Finally i decided to give a chance to nvidia-470xx-dkms and it appears everything went fine without generating extra files as i remembered, all the stuff goes in /var/lib/dkms, so probably i really ran into an old bug.

Offline

Board footer

Powered by FluxBB