PKGBUILD for ryzen_smu-dkms-git

Hi,

This is not really Manjaro related and I did not find any category that would fit.

I am seeking for some help in making a PKGBUILD for this kernel module (dkms-git I guess?).

Not that I’d not want to do this myself, but I’d probably require hours to do this. The experts can do this is minutes I guess @Yochanan :wink:

thanks,
mo

That Makefile needs some work first.

Wireguard has a mighty fine Makefile which makes the PKGBUILD a breeze.

You could use the zenpower-dkms-git PKGBUILD as a template since the Makefile is about the same as ryzen_smu. It’s a rather hacky method, but apparently it works.

1 Like

Thanks, I’ll have a look at that one.

edit

Got it working :star_struck:

resolving dependencies...
looking for conflicting packages...

Packages (1) ryzen_smu-dkms-git-67.46daaef-1

Total Installed Size:  0,24 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                   [########################################################] 100%
(1/1) checking package integrity                                                                 [########################################################] 100%
(1/1) loading package files                                                                      [########################################################] 100%
(1/1) checking for file conflicts                                                                [########################################################] 100%
(1/1) checking available disk space                                                              [########################################################] 100%
:: Processing package changes...
(1/1) installing ryzen_smu-dkms-git                                                              [########################################################] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Install DKMS modules
==> dkms install --no-depmod -m ryzen_smu -v 67.46daaef -k 5.9.0-1-MANJARO
==> dkms install --no-depmod -m ryzen_smu -v 67.46daaef -k 5.8.13-3-MANJARO
==> dkms install --no-depmod -m ryzen_smu -v 67.46daaef -k 5.7.19-2-MANJARO
==> depmod 5.9.0-1-MANJARO
==> depmod 5.7.19-2-MANJARO
==> depmod 5.8.13-3-MANJARO
PKGBUILD
_pkgbase=ryzen_smu
pkgname=ryzen_smu-dkms-git
pkgver=67.46daaef
pkgrel=1
pkgdesc="A Linux kernel driver that exposes access to the SMU (System Management Unit) for certain AMD Ryzen Processors"
arch=('x86_64')
url="https://gitlab.com/leogx9r/ryzen_smu"
license=('GPL2')
depends=('dkms')
makedepends=('git' 'linux-headers')
provides=('ryzen_smu')

source=("$_pkgbase::git+$url.git"
        "dkms.conf"
        "$_pkgbase.conf")

sha256sums=('SKIP'
            '0ced27963dac8e270221574d0c2b686bbbb012e3af8741188800f9cb6b7d8e63'
            'a48f5c846ca5fd8f185f1317c8001c97f59ac432392d53b581802c7761b9360f')

pkgver() {
  cd "$srcdir/$_pkgbase"
  printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  cd "$srcdir/$_pkgbase"

  install -d "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/
  cp -r ${srcdir}/${_pkgbase}/* "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/

  install -Dm644 ${srcdir}/dkms.conf "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf

  sed -e "s/@_PKGBASE@/${_pkgbase}/" \
    -e "s/@PKGVER@/${pkgver}/" \
    -i "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf

  install -Dm644 ${srcdir}/${_pkgbase}.conf "${pkgdir}"/usr/lib/depmod.d/${_pkgbase}.conf
}
dkms.conf
PACKAGE_NAME="@_PKGBASE@"
PACKAGE_VERSION="@PKGVER@"
MAKE[0]="make -C $kernel_source_dir M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build modules"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="@_PKGBASE@"
DEST_MODULE_LOCATION[0]="/kernel/drivers/@_PKGBASE@"
AUTOINSTALL="yes"
ryzen_smu.conf
#
# /usr/lib/depmod.d/ryzen_smu.conf
#

search updates extramodules built-in

Thanks again for the hint @Yochanan

If anyone is interested: I’ve added it to the AUR…

https://aur.archlinux.org/packages/ryzen_smu-dkms-git/

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.