diff --git a/pkg/de-p1st-gpu-amdgpu/.install b/pkg/de-p1st-gpu-amdgpu/.install new file mode 100644 index 0000000..a1d7485 --- /dev/null +++ b/pkg/de-p1st-gpu-amdgpu/.install @@ -0,0 +1,27 @@ +## arg 1: the new package version +post_install() { + holo apply + if ! mkinitcpio -P; then + echo "Failed to generate initramfs. Please run 'mkinitcpio -P' manually. (This is normal during initial system installation)."; + return 1; + fi +} + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + holo apply + if ! mkinitcpio -P; then + echo "Failed to generate initramfs." + return 1 + fi +} + +## arg 1: the old package version +post_remove() { + holo apply + if ! mkinitcpio -P; then + echo "Failed to generate initramfs." + return 1 + fi +} diff --git a/pkg/de-p1st-gpu-amdgpu/PKGBUILD b/pkg/de-p1st-gpu-amdgpu/PKGBUILD index 87e63f4..aadc3c8 100644 --- a/pkg/de-p1st-gpu-amdgpu/PKGBUILD +++ b/pkg/de-p1st-gpu-amdgpu/PKGBUILD @@ -2,7 +2,7 @@ _pkgname=gpu-amdgpu _reponame=arch pkgname="de-p1st-$_pkgname" -pkgver=0.0.1 +pkgver=0.0.2 pkgrel=1 pkgdesc="AMDGPU" arch=('any') @@ -19,5 +19,18 @@ depends+=(vulkan-radeon) depends+=(libva-mesa-driver) # "HW-vide-acceleration: VDPAU" depends+=(mesa-vdpau) +# holo +depends+=('holo' 'base') # without base "holo apply" may fail on initial system installation +makedepends=('git') provides=('de-p1st-gpu') # implicitly provides $pkgname +install='.install' +source=("git+${url}.git") +sha256sums=('SKIP') + +package() { + cd "${_reponame}/pkg/${pkgname}" + + # 10$pkgname as this shall be applied before de-p1st-mkinitcpio + install -Dm0544 mkinitcpio.conf.holoscript "$pkgdir"/usr/share/holo/files/10"$pkgname"/etc/mkinitcpio.conf.holoscript +} \ No newline at end of file diff --git a/pkg/de-p1st-gpu-amdgpu/README.md b/pkg/de-p1st-gpu-amdgpu/README.md index 59bd5fa..71e14d8 100644 --- a/pkg/de-p1st-gpu-amdgpu/README.md +++ b/pkg/de-p1st-gpu-amdgpu/README.md @@ -22,10 +22,14 @@ From gentoo wiki one should use AMDGPU e.g. for: * run `vainfo` and `vdpauinfo` as non-root -**TODO**: archwiki -> kernel-mode-setting -> early-kms-start - -For AMDGPU: in /etc/mkinitcpio.conf include "amdgpu" in MODULES=(...). -Otherwise Xorg might not start properly. +* `amdgpu` module + * see also: https://wiki.archlinux.org/title/AMDGPU#Loading + * The amdgpu kernel module is supposed to load automatically + on system boot. + * It is possible it loads, but late, after the X server requires it. + In this case: + * Include "amdgpu" in MODULES=(...) of `/etc/mkinitcpio.conf` + ```shell # "DRI driver for 3D acceleration" diff --git a/pkg/de-p1st-gpu-amdgpu/mkinitcpio.conf.holoscript b/pkg/de-p1st-gpu-amdgpu/mkinitcpio.conf.holoscript new file mode 100644 index 0000000..b77828c --- /dev/null +++ b/pkg/de-p1st-gpu-amdgpu/mkinitcpio.conf.holoscript @@ -0,0 +1,6 @@ +#!/bin/sh +# stdin: default config +# stdout: modified config + +# add amdgpu to MODULES array +sed 's|^MODULES=(|MODULES=(amdgpu |' diff --git a/pkg/de-p1st-mkinitcpio/PKGBUILD b/pkg/de-p1st-mkinitcpio/PKGBUILD index 11f9888..2577010 100644 --- a/pkg/de-p1st-mkinitcpio/PKGBUILD +++ b/pkg/de-p1st-mkinitcpio/PKGBUILD @@ -2,7 +2,7 @@ _pkgname=mkinitcpio _reponame=arch pkgname="de-p1st-$_pkgname" -pkgver=0.0.7 +pkgver=0.0.8 pkgrel=1 pkgdesc="mkinitcpio configuration" arch=('any') @@ -17,5 +17,6 @@ sha256sums=('SKIP') package() { cd "${_reponame}/pkg/${pkgname}" - install -Dm0544 mkinitcpio.conf.holoscript "$pkgdir"/usr/share/holo/files/"$pkgname"/etc/mkinitcpio.conf.holoscript + # 11$pkgname as this shall be applied after de-p1st-gpu-amdgpu + install -Dm0544 mkinitcpio.conf.holoscript "$pkgdir"/usr/share/holo/files/11"$pkgname"/etc/mkinitcpio.conf.holoscript }