You are not logged in.

#1 2021-06-17 21:38:25

noabody
Member
Registered: 2018-02-02
Posts: 4

Would it be acceptable to package a configuration?

AMDGPU

This is one of those tricky articles that help to configure a system to use amdgpu over radeon driver because the former has vulkan support.  In particular, certain configuration changes need to be made for (SI) Southern Islands or (CIK) Sea Islands.  I found the best method could be accomplished by creating a simple package.

Somehow, I doubt this would be approved although it makes a lot of sense to me.  My question is, does arch want to host configuration packages or not?

# Maintainer: Noa Body <noabody@archlinux.org>

pkgbase=si-vulkan
pkgname=("$pkgbase" cik-vulkan)
pkgver=1.0
pkgrel=1
url=https://wiki.archlinux.org/title/AMDGPU
license=(GPL)
arch=(any)

package_si-vulkan() {
  pkgdesc="Southern Islands (SI) GCN 1 Vulkan enabler, forces amdgpu over radeon driver."
  provides=("$pkgbase")
  conflicts=(cik-vulkan)
  install -dm 755 "$pkgdir"/etc/modprobe.d
  echo -e 'options amdgpu si_support=1\noptions amdgpu cik_support=0' > "$pkgdir"/etc/modprobe.d/amdgpu.conf
  echo -e 'options radeon si_support=0\noptions radeon cik_support=0' > "$pkgdir"/etc/modprobe.d/radeon.conf
}

package_cik-vulkan() {
  pkgdesc="Sea Islands (CIK) GCN 2 Vulkan enabler, forces amdgpu over radeon driver."
  provides=(cik-vulkan)
  conflicts=("$pkgbase")
  install -dm 755 "$pkgdir"/etc/modprobe.d
  echo -e 'options amdgpu si_support=0\noptions amdgpu cik_support=1' > "$pkgdir"/etc/modprobe.d/amdgpu.conf
  echo -e 'options radeon si_support=0\noptions radeon cik_support=0' > "$pkgdir"/etc/modprobe.d/radeon.conf
}

In retrospect, I can see the proper approach was to script the change in admin user-space /etc/modprobe.d

Last edited by noabody (2021-06-22 18:43:54)

Offline

#2 2021-06-17 22:16:40

mpan
Member
Registered: 2012-08-01
Posts: 1,206
Website

Re: Would it be acceptable to package a configuration?

Creating a config PKGBUILD and using it for yourself: ok.
Creating a config PKGBUILD and publishing it: ok.
Creating a config PKGBUILD and publishing it in AUR: the submission guidelines do not ban configurations from AUR and there exist PKGBUILDs that offer nothing more than a configuration.
Creating a PKGBUILD, that does nothing except adding one line to two files, and publishing it in AUR: what’s the point, in particular considering that the user is supposed to consciously add those lines into their configuration?

The PKGBUILD, as written, is also claiming ownership over configuration files without marking them as configuration files. Yet marking them as such will make the package useless: uninstalling the package without -c will not remove its changes, with -c may damage existing configuration. It also tries to overwrite files that may already exist in the file system.

If you believe that the description is hard to understand, a much better idea is to improve the article. However, I doubt it really can be simplified into two lines.

Last edited by mpan (2021-06-17 22:18:31)


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2021-06-17 22:45:01

loqs
Member
Registered: 2014-03-06
Posts: 17,323

Re: Would it be acceptable to package a configuration?

Package supplied modprobe.d configuration files should go in /usr/lib/modprobe.d/.  You can have multiple entries per config file so each package would only need to supply one config file.
Why are the files executable?

Offline

#4 2021-06-17 23:01:16

noabody
Member
Registered: 2018-02-02
Posts: 4

Re: Would it be acceptable to package a configuration?

I agree with both posts.  I'm using Manjaro Linux which has a lot of similarities to Arch.  On my system, echoing the config files into $pkgdir always results in 644 but I do use install to create the folder $pkgdir/etc/modprobe.d with 755 permissions.

The user really just needs to read the articles and understand what is happening.  Even with an after installation note (if I wanted to add that), it wouldn't be sufficient.

Thanks

Offline

#5 2021-06-17 23:24:52

loqs
Member
Registered: 2014-03-06
Posts: 17,323

Re: Would it be acceptable to package a configuration?

I thought you were doing something like:

  install -Dm 755  /dev/stdin "$pkgdir"/etc/modprobe.d/si-vulkan.conf << EOF
options amdgpu si_support=1\noptions amdgpu cik_support=0
options radeon si_support=0\noptions radeon cik_support=0
EOF

I missed you were creating the directories then using echo to place the files in them.  My mistake.

Last edited by loqs (2021-06-17 23:32:33)

Offline

#6 2021-06-18 06:11:29

a821
Member
Registered: 2012-10-31
Posts: 381

Re: Would it be acceptable to package a configuration?

noabody wrote:

My question is, does arch want to host configuration packages or not?

Note there has been a purge of "configuration" and "custom" packages in the AUR, so very likely your package will be removed. Better improve the wiki page as already pointed out.

https://lists.archlinux.org/pipermail/a … 36195.html
https://lists.archlinux.org/pipermail/a … 36228.html

Offline

Board footer

Powered by FluxBB