device-generic-x86_64: split off oem-specific packages (MR 4673)

This uses oem-specific packages for configuring Intel and AMD systems,
and installs them all by default for new images using pmbootstrap's
pmb_recommends feature.

The intention is to provide pre-built images with support for Intel and
AMD already enabled/configured, and users can remove an unwanted set of
packages (e.g., `apk del device-generic-x86_64-intel` when on an AMD
system) if they want to.

Upgrading existing systems should work, in that I haven't observed any
apk conflicts with it. But you do need to manually install the new
oem-specific package if you need it (e.g. `oem-intel`)

fixes https://gitlab.com/postmarketOS/pmaports/-/issues/2484
This commit is contained in:
Clayton Craft 2023-12-30 23:48:29 -08:00 committed by Luca Weiss
parent 304b4043b8
commit d7dbabe46f
No known key found for this signature in database
GPG key ID: 72D843B89D4DD756
3 changed files with 18 additions and 23 deletions

View file

@ -1,8 +1,7 @@
# Reference: <https://postmarketos.org/devicepkg> # Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=device-generic-x86_64 pkgname=device-generic-x86_64
# note: this could also support legacy boot in the future, e.g. with syslinux!
pkgdesc="Generic x86_64 system, with EFI" pkgdesc="Generic x86_64 system, with EFI"
pkgver=8 pkgver=9
pkgrel=0 pkgrel=0
url="https://postmarketos.org" url="https://postmarketos.org"
license="MIT" license="MIT"
@ -11,7 +10,6 @@ options="!check !archcheck"
depends=" depends="
alsa-ucm-conf alsa-ucm-conf
postmarketos-base postmarketos-base
sof-firmware
systemd-boot systemd-boot
" "
makedepends="devicepkg-dev" makedepends="devicepkg-dev"
@ -19,13 +17,16 @@ source="
deviceinfo deviceinfo
modules-initfs modules-initfs
" "
install="$pkgname.post-install $pkgname.post-upgrade"
subpackages=" subpackages="
$pkgname-kernel-edge:kernel_edge $pkgname-kernel-edge:kernel_edge
$pkgname-kernel-lts:kernel_lts $pkgname-kernel-lts:kernel_lts
$pkgname-libva
$pkgname-mesa $pkgname-mesa
$pkgname-vulkan "
" _pmb_recommends="
oem-intel
oem-amd
"
provides="device-tablet-x64uefi=$pkgver-r$pkgrel device-tablet-x86uefi=$pkgver-r$pkgrel" provides="device-tablet-x64uefi=$pkgver-r$pkgrel device-tablet-x86uefi=$pkgver-r$pkgrel"
replaces="device-tablet-x64uefi device-tablet-x86uefi" replaces="device-tablet-x64uefi device-tablet-x86uefi"
@ -37,14 +38,6 @@ package() {
devicepkg_package $startdir $pkgname devicepkg_package $startdir $pkgname
} }
libva() {
install_if="$pkgname=$pkgver-r$pkgrel libva"
provides="device-tablet-x64uefi-libva=$pkgver-r$pkgrel device-tablet-x86uefi-libva=$pkgver-r$pkgrel"
replaces="device-tablet-x64uefi-libva device-tablet-x86uefi-libva"
depends="intel-media-driver libva-intel-driver mesa-va-gallium"
mkdir "$subpkgdir"
}
mesa() { mesa() {
install_if="$pkgname=$pkgver-r$pkgrel mesa-gl" install_if="$pkgname=$pkgver-r$pkgrel mesa-gl"
provides="device-tablet-x64uefi-mesa=$pkgver-r$pkgrel device-tablet-x86uefi-mesa=$pkgver-r$pkgrel" provides="device-tablet-x64uefi-mesa=$pkgver-r$pkgrel device-tablet-x86uefi-mesa=$pkgver-r$pkgrel"
@ -69,14 +62,6 @@ kernel_lts() {
devicepkg_subpackage_kernel $startdir $pkgname $subpkgname devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
} }
vulkan() {
install_if="$pkgname=$pkgver-r$pkgrel vulkan-loader"
provides="device-tablet-x64uefi-vulkan=$pkgver-r$pkgrel device-tablet-x86uefi-vulkan=$pkgver-r$pkgrel"
replaces="device-tablet-x64uefi-vulkan device-tablet-x86uefi-vulkan"
depends="mesa-vulkan-ati mesa-vulkan-intel mesa-vulkan-swrast"
mkdir "$subpkgdir"
}
sha512sums=" sha512sums="
33f0450413c7b364390fdc715578b41389bced5ff69f04a2128155f5ad828ed0e1cc17a20b610eccf4bd99560e21be91e362faaa72e9decad4623f8669e8ab7a deviceinfo 33f0450413c7b364390fdc715578b41389bced5ff69f04a2128155f5ad828ed0e1cc17a20b610eccf4bd99560e21be91e362faaa72e9decad4623f8669e8ab7a deviceinfo
d65ca12564ef032507c19359643794a14579fd1d065777f9042d40d38aad4d40d99c10aae9a3acd7799f4ad95651b6ca9d83335501d08869dc391f3050df4d1f modules-initfs d65ca12564ef032507c19359643794a14579fd1d065777f9042d40d38aad4d40d99c10aae9a3acd7799f4ad95651b6ca9d83335501d08869dc391f3050df4d1f modules-initfs

View file

@ -0,0 +1,9 @@
#!/bin/sh
# Only display this message if none of the `oem-*` packages are installed
if ! grep -Ex "oem-\b(\?|amd|intel)" /etc/apk/world 2>/dev/null; then
echo "* NOTE: This package no longer automatically installs OEM-specific drivers and firmware."
echo "* You will likely need to install one or both of these manually, depending on your hardware."
echo "* For AMD: apk add oem-amd"
echo "* For Intel: apk add oem-intel"
fi

View file

@ -0,0 +1 @@
device-generic-x86_64.post-install