Will this package be updated to be compatible with other Debian/Ubuntu versions as well? The preinst script just fails silently on Ubuntu 20.04 right now.
I was hoping to use it to identify the configuration for hardware accelerated HDR transcoding on Intel graphics, but I ended up tracking down the 21.49.21786 igc/opencl packages instead.
Preparing to unpack plexmediaserver_1.27.0.5878-8f821a871_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
dpkg: error processing archive plexmediaserver_1.27.0.5878-8f821a871_amd64.deb (--install):
new plexmediaserver package pre-installation script subprocess returned error exit status 1
dpkg: error while cleaning up:
installed plexmediaserver package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
plexmediaserver_1.27.0.5878-8f821a871_amd64.deb
No /tmp/plexinstaller.log was created.
If I run sudo bash -x /var/lib/dpkg/info/plexmediaserver.preinst (from the existing Plex Pass package of 1.27.0.5878-8f821a871 that is installed), that does succeed.
The failing plexmediaserver_1.27.0.5878-8f821a871_amd64.deb is the one from your Google Drive link. I was just stating that the preinst for the Plex Pass package for the same version works fine.
I am running dpkg -i as root. Your preinst is failing. I was just using the other one for comparison, I am aware it doesn’t help with the current package. I used to be a Debian package maintainer.
[trisk@menchi]% sudo dpkg -i plexmediaserver_1.27.0.5878-8f821a871_amd64.deb ~
(Reading database ... 113464 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.27.0.5878-8f821a871_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
dpkg: error processing archive plexmediaserver_1.27.0.5878-8f821a871_amd64.deb (--install):
new plexmediaserver package pre-installation script subprocess returned error exit status 1
dpkg: error while cleaning up:
installed plexmediaserver package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
plexmediaserver_1.27.0.5878-8f821a871_amd64.deb
This is Ubuntu 20.04 on bare metal. I ran your preinst manually with bash -x just now, and this is the end of the output where the script terminates early with exit code 1.
The model name of my CPU is Intel(R) Celeron(R) G5905 CPU @ 3.50GHz so $Processor is G5905. I think the set -e at the top of the script is causing it to exit when the grep in the subshell returns 1.
This fixes my immediate issue, but problem is the "$HaveIntelN" != "" check is never executed if the grep does not match because the script exits immediately.
If I replace it with:
620 # JasperLake and above N-series or G-series
621 if [ $HaveIntelCeleron -gt 0 ]; then
622
623 HaveIntelN="$(echo $Processor | cut -c 1-2 | grep -E 'N5|N6|N7|G5|G6|G7|G8' || true)"
624 [ "$HaveIntelN" != "" ] && NeedBeignet=0 && NeedOpenCL=0 && NeedIntelCompute=1 && NeedIntelOpenCL=1
625 fi
This does also work when $Processor is outside of those prefixes, but I think a better option would be to use a switch statement here.
The problem is the execution would end at line 623 because of the set -e causes the script to exit with failure whenever any command returns a non-zero exit status. When grep does not match, line 624 onwards was never executed because of the non-zero exit status from grep. Now the grep succeeds for my CPU with the new pattern, but the script will still fail in the same way for a processor that does not match the pattern instead of just not assigning HaveIntelN.
So you either need to mask the exit status of grep on line 623 or use grep -c like elsewhere, which will always exit with status 0.
This can also be avoided by not using external commands like grep at all, which is also cleaner:
# JasperLake and above N-series
if [ $HaveIntelCeleron -gt 0 ] || [ $HaveIntelPentium -gt 0 ]; then
case "$Processor" in
N[5-7]*)
HaveIntelN=1
;;
G[5-8]*)
HaveIntelN=1
;;
esac
And for the chunk above around line 573:
if [ "$Model" = "Intel"* ]; then
# Have an Intel CPU
HaveIntel=1
case "$Model" in
*Core*)
HaveIntelCore=1
;;
*Xeon*)
HaveIntelXeon=1
;;
*Celeron*)
HaveIntelCeleron=1
;;
*Pentium*)
HaveIntelPentium=1
;;
esac
# Is there an Intel i915 present (possible QSV capability)
[ "$(echo /sys/module/i915/drivers/pci:i915/*:*:*.*)" != "/sys/module/i915/drivers/pci:i915/*:*:*.*" ] && Havei915=1
fi