Skip to content

Commit

Permalink
Simplify MESA installation in create-targz.sh
Browse files Browse the repository at this point in the history
Removed unnecessary loop and target version handling from MESA installation in create-targz.sh. Now, installation directly uses a specific version from a predetermined list, reducing complexity and potential errors.
  • Loading branch information
crramirez committed Nov 1, 2024
1 parent 07de8ae commit e5e9f03
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions create-targz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,13 @@ chmod -x,+r /etc/profile.d/check-dnf.sh
EOF

echo "##[section] 'Install MESA"
declare -a mesa_version=('23.1.9-wsl' '24.1.2-7_wsl.fc40' '24.2.5-1_wsl_2.fc41')
local i=2
systemd-nspawn -q --resolv-conf="replace-host" -D "${TMPDIR}"/dist --pipe /bin/bash <<EOF
dnf -y install 'dnf-command(versionlock)'
declare -a mesa_version=('23.1.9-wsl' '24.1.2-7_wsl.fc40' '24.2.5-1_wsl_2.fc41')
declare -a target_version=('39' '40' '41')
declare -i length=\${#mesa_version[@]}
for (( i = 0; i < length; i++ )); do
if [[ \${version_id} -eq \${target_version[i]} && \$( sudo dnf info --installed mesa-libGL | grep -c "\${mesa_version[i]}" ) == 0 ]]; then
sudo dnf -y install --allowerasing --nogpgcheck mesa-dri-drivers-"\${mesa_version[i]}" mesa-libGL-"\${mesa_version[i]}" mesa-va-drivers-"\${mesa_version[i]}" mesa-vdpau-drivers-"\${mesa_version[i]}" mesa-libEGL-"\${mesa_version[i]}" mesa-libgbm-"\${mesa_version[i]}" mesa-libxatracker-"\${mesa_version[i]}" mesa-vulkan-drivers-"\${mesa_version[i]}" glx-utils vdpauinfo libva-utils
sudo dnf versionlock add mesa-dri-drivers mesa-libGL mesa-filesystem mesa-libglapi mesa-va-drivers mesa-vdpau-drivers mesa-libEGL mesa-libgbm mesa-libxatracker mesa-vulkan-drivers
fi
done
dnf -y install --allowerasing --nogpgcheck mesa-dri-drivers-"${mesa_version[i]}" mesa-libGL-"${mesa_version[i]}" mesa-va-drivers-"${mesa_version[i]}" mesa-vdpau-drivers-"${mesa_version[i]}" mesa-libEGL-"${mesa_version[i]}" mesa-libgbm-"${mesa_version[i]}" mesa-libxatracker-"${mesa_version[i]}" mesa-vulkan-drivers-"${mesa_version[i]}" glx-utils vdpauinfo libva-utils
/usr/sbin/groupadd -g 44 wsl-video
EOF

echo "##[section] 'Setup WSLU"
Expand Down

0 comments on commit e5e9f03

Please sign in to comment.