Bug 950841 - Unable to build custom kernel using config-local and new kernel options
Summary: Unable to build custom kernel using config-local and new kernel options
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2013-04-11 05:18 UTC by Jonathon Padfield
Modified: 2013-05-24 20:46 UTC (History)
5 users (show)

Fixed In Version: kernel-3.9.3-301.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-05-16 14:43:11 UTC

Attachments (Terms of Use)

Description Jonathon Padfield 2013-04-11 05:18:18 UTC
Description of problem:

I'm trying to build a custom kernel with new configuration options, following the guidelines at http://fedoraproject.org/wiki/Building_a_custom_kernel

They recommend adding new configuration options to 'config-local', but when I do that, and build with rpmbuild, it fails, because the new options are merged in to just the specific architectures requested, but every architecture is checked for new options.

So, in kernel.spec,
1271 # Merge in any user-provided local config option changes
1272 %if %{?all_arch_configs:1}%{!?all_arch_configs:0}
1273 for i in %{all_arch_configs}
1274 do
1275   mv $i $i.tmp
1276   ./merge.pl %{SOURCE1000} $i.tmp > $i
1277   rm $i.tmp
1278 done
1279 %endif

merges the new config options in to the specific architectures in 

Then it checks for unset new options over all the config files.

1469 # now run oldconfig over all the config files
1470 for i in *.config
1471 do
1472   mv $i .config
1473   Arch=`head -1 .config | cut -b 3-`
1474   make ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true
1475 %if %{listnewconfig_fail}
1476   if [ -s .newoptions ]; then
1477     cat .newoptions
1478     exit 1
1479   fi
1480 %endif

I think the commit d0bae3101fb1b763c754bdacaf523f8bb4d86b6e introduced this problem.

Version-Release number of selected component (if applicable): Fedora 18, Rawhide

How reproducible: Every time.

Steps to Reproduce:
1. Install kernel sources
2. Add a new configuration item to a Kconfig file
3. Add the new item to config-local
4. rpmbuild -bb --with baseonly --without debuginfo --target=x86_64 kernel.spec
Actual results:
+ for i in '*.config'
+ mv kernel-3.8.5-armv5tel-kirkwood.config .config
++ cut -b 3-
++ head -1 .config
+ Arch=arm
+ make ARCH=arm listnewconfig
+ grep -E '^CONFIG_'
+ '[' -s .newoptions ']'
+ cat .newoptions
+ exit 1
error: Bad exit status from /var/tmp/rpm-tmp.kqbWD1 (%prep)

Expected results: (maybe)

+ for i in 'kernel-3.8.5-x86_64*.config'
+ mv kernel-3.8.5-x86_64-debug.config .config
++ head -1 .config
++ cut -b 3-
+ Arch=x86_64
+ grep -E '^CONFIG_'
+ make ARCH=x86_64 listnewconfig
+ true
+ '[' -s .newoptions ']'
+ rm -f .newoptions
+ make ARCH=x86_64 oldnoconfig
scripts/kconfig/conf --olddefconfig Kconfig

Additional info:
Changing kernel.spec like this fixes the problem, but explicitly goes against the commit that caused it.

1571 # now run oldconfig over all the config files
1572 for i in %{all_arch_configs}

Comment 1 Josh Boyer 2013-05-16 14:43:11 UTC
Yeah, the kernel maintainers explicitly want it to loop over all architecture configs.  I've fixed it by just always merging config-local changes into all arch configs.  Thanks for the report.

Comment 2 Fedora Update System 2013-05-20 16:21:11 UTC
kernel-3.9.3-301.fc19 has been submitted as an update for Fedora 19.

Comment 3 Fedora Update System 2013-05-24 20:46:54 UTC
kernel-3.9.3-301.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.