Xenomai configuration help for Linux 2.4
PATCH 1/1 Xenomai configuration help for Linux 2.4
Hello,
the attached patch adds Xenomai configuration help for Linux 2.4:
2006-11-11 Wolfgang Grandegger <[email protected]>
* scripts/prepare_kernel.sh, scripts/help_from_kconfig.pl:
prepare_kernel.sh will now add help for Xenomai configuration parameters to the Configure.help file of 2.4 kernels. The help is extracted from Xenomai's Kconfig files using a perl script.
Wolfgang.
+ diff -u xenomai/ChangeLog.ORIG xenomai/ChangeLog
ChangeLog renamed from ChangeLog.ORIG +7 -0
@@ -1,3 +1,10 @@ +2006-11-11 Wolfgang Grandegger <[email protected]> + + * scripts/prepare_kernel.sh, scripts/help_from_kconfig.pl: + prepare_kernel.sh will now add help for Xenomai configuration + parameters to the Configure.help file of 2.4 kernels. The help + is extracted from Xenomai's Kconfig files using a perl script. + 2006-11-08 Wolfgang Grandegger <[email protected]> * ksrc/drivers/can/sja1000/rtcan_peak_dng.c: Fix warnings when
+ diff -u xenomai/scripts/help_from_kconfig.pl.ORIG xenomai/scripts/help_from_kconfig.pl
scripts/help_from_kconfig.pl renamed from scripts/help_from_kconfig.pl.ORIG +50 -0
50 lines not on this page · raw message
+ diff -u xenomai/scripts/prepare-kernel.sh.ORIG xenomai/scripts/prepare-kernel.sh
scripts/prepare-kernel.sh renamed from scripts/prepare-kernel.sh.ORIG +20 -0
@@ -129,6 +129,23 @@ } +patch_help() { + if which perl > /dev/null; then + hfile=$linux_tree/Documentation/Configure.help + if ! grep -iq CONFIG_XENO $hfile; then + kfiles=$xenomai_root/scripts/Kconfig.frag + for d in ksrc/nucleus ksrc/skins ksrc/arch/$xenomai_arch \ + ksrc/drivers sim; do + kfiles="$kfiles `find $xenomai_root/$d -name Kconfig`" + done + perl $xenomai_root/scripts/help_from_kconfig.pl $kfiles >> $hfile + if test x$verbose = x1; then + echo 'Configuration help added.' + fi + fi + fi +} + generate_patch() { ( cd "$temp_tree"
@@ -483,7 +500,10 @@ . wq EOF + fi + + patch_help ;; #
Quoted 3 lines · Wolfgang Grandegger
Hello,
the attached patch adds Xenomai configuration help for Linux 2.4:
Cool that you picked this up! Frankly, I didn't expect that this would really work without any pitfalls - but it seems to.
Just one addition feature wish: Could you enhance it so that it can also upgrade an existing Configure.help patch? Maybe put some magic marks (comments) around the xeno stuff and remove the whole block before re-patching the help information?
Thanks,
Jan (who wishes that this would also work for Kconfig->Config.in...)
Quoted 11 lines · Wolfgang Grandegger
Hello,
the attached patch adds Xenomai configuration help for Linux 2.4:
2006-11-11 Wolfgang Grandegger <[email protected]>
*
scripts/prepare_kernel.sh,scripts/help_from_kconfig.pl:
prepare_kernel.shwill now add help for Xenomai configuration parameters to the Configure.help file of 2.4 kernels. The help is extracted from Xenomai'sKconfigfiles using a perl script.
Nice. Applied, thanks.
Quoted 5 lines
Wolfgang.
_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.
Quoted 7 lines · Jan Kiszka
Quoted 3 lines · Wolfgang Grandegger
Hello,
the attached patch adds Xenomai configuration help for Linux 2.4:
Cool that you picked this up! Frankly, I didn't expect that this would really work without any pitfalls - but it seems to.
I immediately liked you idea. Having an easily accessible description of the Xenomai kernel configuration parameters helps users a lot. So far I just realized some problems with "choice" but they seem not related to the conversion. It's more likely a bug in menuconfig.
Quoted 4 lines
Just one addition feature wish: Could you enhance it so that it can also upgrade an existing Configure.help patch? Maybe put some magic marks (comments) around the xeno stuff and remove the whole block before re-patching the help information?
You mean re-running "prepare-kernel" should update the Xenomai block in Configure.help? Doing it in the perl script should not be a big deal.
Quoted 2 lines
Thanks,
Jan (who wishes that this would also work forKconfig->Config.in...)
Yeah, but...
Wolfgang.
Quoted 5 lines · Jan Kiszka
Quoted 3 lines · Wolfgang Grandegger
Hello,
the attached patch adds Xenomai configuration help for Linux 2.4:
Quoted 7 lines
Cool that you picked this up! Frankly, I didn't expect that this would really work without any pitfalls - but it seems to.
Just one addition feature wish: Could you enhance it so that it can also upgrade an existing Configure.help patch? Maybe put some magic marks (comments) around the xeno stuff and remove the whole block before re-patching the help information?
I think the attached patch does what you want (using sed).
Wolfgang
Quoted 4 lines
Thanks,
Jan (who wishes that this would also work forKconfig->Config.in...)
prepare-kernel.sh +20 -10
@@ -132,17 +132,27 @@ patch_help() { if which perl > /dev/null; then hfile=$linux_tree/Documentation/Configure.help - if ! grep -iq CONFIG_XENO $hfile; then - kfiles=$xenomai_root/scripts/Kconfig.frag - for d in ksrc/nucleus ksrc/skins ksrc/arch/$xenomai_arch \ - ksrc/drivers sim; do - kfiles="$kfiles `find $xenomai_root/$d -name Kconfig`" - done - perl $xenomai_root/scripts/help_from_kconfig.pl $kfiles >> $hfile - if test x$verbose = x1; then - echo 'Configuration help added.' - fi + if grep -iq "XENOMAI PARAMETERS" $hfile; then + tmp=$hfile.tmp + sed -n -e \ + '/# BEGIN XENOMAI PARAMETERS/,/# END XENOMAI PARAMETERS/!p' \ + $hfile > $tmp + mv $tmp $hfile + msg="updated" + else + msg="added" fi + kfiles=$xenomai_root/scripts/Kconfig.frag + for d in ksrc/nucleus ksrc/skins ksrc/arch/$xenomai_arch \ + ksrc/drivers sim; do + kfiles="$kfiles `find $xenomai_root/$d -name Kconfig`" + done + echo "# BEGIN XENOMAI PARAMETERS" >> $hfile + perl $xenomai_root/scripts/help_from_kconfig.pl $kfiles >> $hfile + echo "# END XENOMAI PARAMETERS" >> $hfile + if test x$verbose = x1; then + echo "Configuration help $msg." + fi fi }