Bug#569721: Hard-coded line numbers in generated kernel patches break kernelconfiguration

2010-02-14 Thread Roland Stigge

Hi!

M. Vefa Bicakci wrote:

As you can see, the line number 40 is hard-coded to the patch.
Unfortunately, this ends up putting the Xenomai related options
right in the middle of config X86 options, which causes the
errors shown above.


Thanks for the report and for pointing this out!


I know the following request should be separate wishlist bug, but
can you please use a patch system like quilt or something similar
so it would be easy to see what changes you made to the original
Xenomai source code without having to dig through the diff.gz file?


Good idea. I'll keep this in mind for a later upload. For now, fixing 
the urgent problems.


bye,
  Roland



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4b77ecf3.9010...@antcom.de



Bug#569721: Hard-coded line numbers in generated kernel patches break kernelconfiguration

2010-02-13 Thread M. Vefa Bicakci
Package: linux-patch-xenomai
Version: 2.5.1-2
Severity: grave

Hello,

I have tried compiling Linux 2.6.32.7 with the patches provided by
the new version of the linux-patch-xenomai package. Unfortunately,
I noticed that running make defconfig or make silentoldconfig
print the following errors messages and make exits with an error:

=== 8 ===
*** Default configuration is based on 'i386_defconfig'
arch/x86/Kconfig:74: unexpected option select
arch/x86/Kconfig:75: unexpected option select
arch/x86/Kconfig:76: unexpected option select
arch/x86/Kconfig:77: unexpected option select
arch/x86/Kconfig:78: unexpected option select
arch/x86/Kconfig:79: unexpected option select
arch/x86/Kconfig:80: unexpected option select
arch/x86/Kconfig:81: unexpected option select
arch/x86/Kconfig:82: unexpected option select
arch/x86/Kconfig:83: unexpected option select
arch/x86/Kconfig:84: unexpected option select
arch/x86/Kconfig:85: unexpected option select
make[1]: *** [defconfig] Error 1
make: *** [defconfig] Error 2
=== 8 ===

Please note that no such errors occur with the vanilla Xenomai
2.5.1 source code.

As one can see from the errors, the source of this problem is the
arch/x86/Kconfig file. Here are the relevant lines:

=== 8 ===
### Arch settings
config X86
def_bool y
select HAVE_AOUT if X86_32
select HAVE_READQ
select HAVE_WRITEQ
select HAVE_UNSTABLE_SCHED_CLOCK
select HAVE_IDE
select HAVE_OPROFILE
select HAVE_PERF_EVENTS if (!M386  !M486)
select HAVE_IOREMAP_PROT
select HAVE_KPROBES
select ARCH_WANT_OPTIONAL_GPIOLIB
select ARCH_WANT_FRAME_POINTERS
select HAVE_DMA_ATTRS
select HAVE_KRETPROBES
select HAVE_FTRACE_MCOUNT_RECORD
select HAVE_DYNAMIC_FTRACE
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_GRAPH_TRACER
select HAVE_FUNCTION_GRAPH_FP_TEST
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE

menu Real-time sub-system

comment WARNING! You enabled APM, CPU Frequency scaling or ACPI 'processor'
depends on APM || CPU_FREQ || ACPI_PROCESSOR
comment option. These options are known to cause troubles with Xenomai.
depends on APM || CPU_FREQ || ACPI_PROCESSOR

comment NOTE: Xenomai conflicts with PC speaker support.
depends on !X86_TSC  X86  INPUT_PCSPKR
comment (menu Device Drivers/Input device support/Miscellaneous devices)
depends on !X86_TSC  X86  INPUT_PCSPKR

comment NOTE: Xenomai needs either X86_LOCAL_APIC enabled or HPET_TIMER 
disabled.
depends on (!X86_LOCAL_APIC || !X86_TSC)  X86  HPET_TIMER
comment (menu Processor type and features)
depends on (!X86_LOCAL_APIC || !X86_TSC)  X86  HPET_TIMER

config XENOMAI
depends on ((X86_TSC || !X86 || !INPUT_PCSPKR)  (!HPET_TIMER || !X86 
|| (X86_LOCAL_APIC  X86_TSC)))
bool Xenomai
default y
select IPIPE

help
  Xenomai is a real-time extension to the Linux kernel. Note
  that Xenomai relies on Adeos interrupt pipeline (CONFIG_IPIPE
  option) to be enabled, so enabling this option selects the
  CONFIG_IPIPE option.

source arch/x86/xenomai/Kconfig

endmenu
select HAVE_SYSCALL_TRACEPOINTS
select HAVE_KVM
select HAVE_ARCH_KGDB
select HAVE_ARCH_TRACEHOOK
select HAVE_GENERIC_DMA_COHERENT if X86_32
select HAVE_EFFICIENT_UNALIGNED_ACCESS
select USER_STACKTRACE_SUPPORT
select HAVE_DMA_API_DEBUG
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_LZMA
select HAVE_ARCH_KMEMCHECK
=== 8 ===

As you can see, the options for config X86 are cut off in the middle,
and then the menu for Xenomai related settings is inserted. Then, after
Xenomai settings menu, the options for X86 continue. This suggests a
problem with the generated Xenomai patch.

After having a look at the Debian package, I noticed that the problem
is caused by the following lines in debian/prepare-patch.sh

=== 8 ===
77 diff_addons() {
78 lines=`(echo ; echo ; cat $xenomai_root/scripts/Kconfig.frag) | wc -l`
79
80 echo --- linux/arch/$linux_arch/Kconfig1970-01-01 
01:00:00.0 +0100  $patch_file
81 echo +++ linux-patched/arch/$linux_arch/Kconfig2007-03-06 
17:55:58.0 +  $patch_file
82 echo @@ -40,2 +40,$lines @@  $patch_file
83 echo  source \init/Kconfig\  $patch_file
84 sed -e s,@LINUX_ARCH@,$linux_arch,g $xenomai_root/scripts/Kconfig.frag 
| sed 's/^/+/'  $patch_file
85 echo$patch_file
86 }
=== 8 ===

As you can see, the line number 40 is hard-coded to the patch.
Unfortunately, this ends up putting the Xenomai related options
right in the middle of config X86 options, which causes the
errors shown above.

Then I looked at how Xenomai (upstream) handles this issue. I saw
that it also uses hard-coded line numbers, however in this case