Bug 830446

Summary: Kernel does not compile without EFI framebuffer device
Product: [Fedora] Fedora Reporter: Juan <jfarre>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 17CC: gansalmon, gryt2, itamar, jonathan, kernel-maint, madhu.chinakonda
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-20 15:52:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Juan 2012-06-09 18:38:57 UTC
Description of problem:
kernel rpm fails to build if you don't select EFI framebuffer device.
Early when starting build, gcc generates an error caused by implicit definition of some vga-related function (right after messages regarding building kernel/irq/spurious.c (I don't know whether something else is succesfully compiled in the middle, but no message is shown about it). I'll post the exact error as soon as I generate it again (I just isolated the exact option that triggered the error and right now the kernel is being normally built).
This never happened before Fedora 17 since EFI framebuffer device support exists in the kernel. I always uncheck this option as it can't be compiled as a module and I use the framebuffer driver generated together with my DRM drivers. The problem obviously happens both in EFI and nonEFI platforms.

Version-Release number of selected component (if applicable):
kernel-3.4.0-1.fc17.x86_64 -> Version for which I isolated the option that triggered the error. The problem existed in previous Fedora 17 kernel versions (except the default one, 3.3.4, included with the distribution, which I didn't try to compile, as the following one (3.3.7) was already available).

How reproducible:
Follow the exact instruction in fedora wiki to build a custom kernel.
When configuring it, uncheck EFI framebuffer device option.
Try building kernel rpm's with this custom config.

Steps to Reproduce:
1. Follow instructions in http://fedoraproject.org/wiki/Building_a_custom_kernel, from 1.1 to 1.3
2. In point 1.4 Configure Kernel Options, in the framebuffer-devices subsecion of graphics section, uncheck EFI framebuffer device option (select 'N').
3. Follow the next instructions in the wiki until 1.6 Build the New Kernel (included)
  
Actual results:
Compilation of the kernel fails early with an error, far before starting module compilation. Concretely, the error appears right after messages regarding compilation of kernel/irq/spurious.c

Expected results:
The whole kernel and its modules build fine, without support for EFI framebuffer device.

Additional info:
I use .local added to version info, by editing kernel.spec (nothing else is touched).
I compile with
rpmbuild -bb --without debug --without debuginfo --target=x86_64 kernel.spec
(this is what I do in an Atom netbook that looks to support EFI, at least in part).
I use the same instruction, but adding --with firmware, in an i7 nonEFI machine.
Both fail as explained.

Comment 1 Juan 2012-06-09 19:07:06 UTC
The exact option (in xconfig is)
Device Drivers -> Graphics support -> Support for frame buffer devices -> EFI-based Framebuffer Support

The config symbol (or lack of it) that triggers the error is:
# CONFIG_FB_EFI is not set

The error is:

arch/x86/pci/fixup.c: In function 'pci_fixup_video':
arch/x86/pci/fixup.c:352:3: error: implicit declaration of function 'vga_default_device' [-Werror=implicit-function-declaration]
arch/x86/pci/fixup.c:352:28: warning: comparison between pointer and integer [enabled by default]
arch/x86/pci/fixup.c:353:4: error: implicit declaration of function 'vga_set_default_device' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[1]: *** [arch/x86/pci/fixup.o] Error 1
make: *** [arch/x86/pci] Error 2
make: *** Waiting for unfinished jobs....

It was my mistake to say that it always happens after spurious.c. As it compiles in parallel that was consistently happenning in the i7 machine, where it was built by 8 concurrent threads. Now, in the Atom, with 4 threads, it didn't happen in the same point (but very close).

Comment 2 Josh Boyer 2012-06-09 19:26:16 UTC
This is known.  It is because there are some follow-on patches missing in the vgaarb-vga_default_device.patch patchset that fix this.  We'll get to this later.

Comment 3 Josh Boyer 2012-06-19 18:48:50 UTC
*** Bug 833554 has been marked as a duplicate of this bug. ***

Comment 4 Josh Boyer 2012-07-20 17:56:44 UTC
I updated the patch with the upstream commits, including the ones missing for the build errors.  Should be fixed in the next update.

Comment 5 stan 2012-08-09 17:06:50 UTC
This too works fine in my custom compile of 3.5.0-2.  Thanks.

Comment 6 Juan 2012-08-09 17:12:20 UTC
Works in last version of kernel :)

Comment 7 Fedora Update System 2012-10-22 18:39:09 UTC
kernel-3.6.3-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/kernel-3.6.3-1.fc17

Comment 8 Fedora Update System 2012-10-23 01:54:24 UTC
Package kernel-3.6.3-1.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing kernel-3.6.3-1.fc17'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-16669/kernel-3.6.3-1.fc17
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2012-12-20 15:52:54 UTC
kernel-3.6.3-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.