Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Patch X server 1.19.3 to fix VGA arbitration overflow #7

Open
wants to merge 1 commit into
base: release4.0
Choose a base branch
from

Conversation

biergaizi
Copy link

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,

  1. Add a new list called PACKAGES_FROM_FC25_NEED_PATCH, within this variable is a list of packages which we need to apply for a custom patch. Now only xorg-x11-server-1.19.3-1.fc25.src.rpm is listed.
  2. But we can't use the existing file name, otherwise it would be added to ALL_FILES and triggers a RPM auto build, without a chance of applying the patch. Thus, I did a hack by renaming all packages in PACKAGES_FROM_FC25_NEED_PATCH from *.fc25.src.rpm to .need-patch.fc25.src.rpm
  3. Because the .need-patch target doesn't exist, I can now trigger make to build to target using my rules. Thus, I then subsequently wrote a build rule for xorg-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.
  4. The rule for xorg-x11-server-1.19.3-1.need-patch.fc25.src.rpm unpacks xorg-x11-server-1.19.3-1.need-patch.fc25.src.rpm to the directory xorg-x11-server-1.19.3-1.need-patch.fc25.src.rpm, then apply a patch xorg-x11-server-1.19.3-1-fix-vga-arbitration-overflow.patch, which was created manually.
  5. Finally, we add the RPM spec location to RPM_SPEC_FILES, and with the appropriate RPM_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.

@marmarek
Copy link
Member

PipelineRetry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants