[RFC] Patch X server 1.19.3 to fix VGA arbitration overflow #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In QubesOS/qubes-issues#7076, I reported a known VGA arbitration bug in xorg-server 1.19.3 causes the QubesOS X server to crash randomly when both an Intel & an extra GPU are installed on the system, regardless of whether the Intel GPU is used.
Because this bug crashes my desktop 30 times a day, I'm now trying to fix the issue by myself. and after spending a day on fighting with and abusing the QubesOS build system, I came up with the following hack.
It basically,
PACKAGES_FROM_FC25_NEED_PATCH
, within this variable is a list of packages which we need to apply for a custom patch. Now onlyxorg-x11-server-1.19.3-1.fc25.src.rpm
is listed.ALL_FILES
and triggers a RPM auto build, without a chance of applying the patch. Thus, I did a hack by renaming all packages inPACKAGES_FROM_FC25_NEED_PATCH
from*.fc25.src.rpm
to.need-patch.fc25.src.rpm
.need-patch
target doesn't exist, I can now triggermake
to build to target using my rules. Thus, I then subsequently wrote a build rule forxorg-x11-server-1.19.3-1.need-patch.fc25.src.rpm
for applying the patch. These build rules need to be written on a case-by-case basis, manually.xorg-x11-server-1.19.3-1.need-patch.fc25.src.rpm
unpacksxorg-x11-server-1.19.3-1.need-patch.fc25.src.rpm
to the directoryxorg-x11-server-1.19.3-1.need-patch.fc25.src.rpm
, then apply a patchxorg-x11-server-1.19.3-1-fix-vga-arbitration-overflow.patch
, which was created manually.RPM_SPEC_FILES
, and with the appropriateRPM_SOURCE_DIR := $(DIST_SRC_ROOT)/$(COMPONENT)/xorg-x11-server-1.19.3-1.need-patch.fc25.src.rpm/
, and let the QubesOS build system to generate a patched RPM package.As you see, I don't know much about Makefile or the QubesOS build system, and this fix uses a lot of hacks, especially, the files and paths in step 5 are hardcoded. Thus I don't think it's upstreamable in its current condition, nevertheless I think it's still a good idea to publish the patch in its half-finished form.
I think what we need is a general solution for applying a custom patch to an arbitrary RPM package, once finished, the maintainer should be able to apply patches just by modifying a variable or two.
I'd like to hear your suggestion on the proper way to extend the build script.