All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [PATCH] Xenomai configuration help for Linux 2.4
@ 2006-11-11 12:43 Wolfgang Grandegger
  2006-11-11 14:35 ` Jan Kiszka
  2006-11-11 16:34 ` Philippe Gerum
  0 siblings, 2 replies; 5+ messages in thread
From: Wolfgang Grandegger @ 2006-11-11 12:43 UTC (permalink / raw)
  To: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

Hello,

the attached patch adds Xenomai configuration help for Linux 2.4:

2006-11-11  Wolfgang Grandegger  <wg@domain.hid>

	* 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.

[-- Attachment #2: xenomai-help-from-kconfig.patch --]
[-- Type: text/x-patch, Size: 2699 bytes --]

+ diff -u xenomai/ChangeLog.ORIG xenomai/ChangeLog
--- xenomai/ChangeLog.ORIG	2006-11-09 22:16:54.000000000 +0100
+++ xenomai/ChangeLog	2006-11-11 13:10:06.000000000 +0100
@@ -1,3 +1,10 @@
+2006-11-11  Wolfgang Grandegger  <wg@domain.hid>
+
+	* 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  <wg@domain.hid>
 
 	* 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
--- xenomai/scripts/help_from_kconfig.pl.ORIG	2006-11-11 12:56:06.000000000 +0100
+++ xenomai/scripts/help_from_kconfig.pl	2006-11-11 12:37:21.000000000 +0100
@@ -0,0 +1,50 @@
+#!/usr/bin/perl
+
+my $config=0;
+my $help=0;
+
+foreach $file (@ARGV)
+{
+    open (FILE, $file) || die "Can't open $file: $!\n";
+    while (<FILE>) {
+        if (/^[a-z]/) {
+	    if ($help>0) {
+		printf "\n";
+	    }
+	    $help=0;
+	    $config=0;
+	    if (/^config\s+(\w*)/) {
+		$config=1;
+		$config_name="CONFIG_$1";
+	    }
+	} else {
+	    if ($config==1) {
+		if (/^\s+(bool|tristate||string|int|hex)\s"+(.*)"+\s*$/) {
+		    $type=$2;
+		}
+		if (/^\s+([-]*help[-]*)\s*$/) {
+		    $help=rindex($_, $1);
+		    $help_start=0;
+		    printf "$type\n";
+		    printf "$config_name\n";
+		} else {
+		    if ($help>0) {
+			$line=substr($_, $help);
+			if ($help_start==0) {
+			    if ($line =~ /\S+/) {
+				$help_start=1;
+			    }
+			}
+			if ($help_start==1) {
+			    printf "  $line";
+			}
+		    }
+		}
+	    }
+	}
+    }
+    if ($help>0) {
+	printf "\n";
+    }
+    close (FILE);
+}
+ diff -u xenomai/scripts/prepare-kernel.sh.ORIG xenomai/scripts/prepare-kernel.sh
--- xenomai/scripts/prepare-kernel.sh.ORIG	2006-11-09 22:15:41.000000000 +0100
+++ xenomai/scripts/prepare-kernel.sh	2006-11-11 13:32:25.000000000 +0100
@@ -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
     ;;
 
     #

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai-core] [PATCH] Xenomai configuration help for Linux 2.4
  2006-11-11 12:43 [Xenomai-core] [PATCH] Xenomai configuration help for Linux 2.4 Wolfgang Grandegger
@ 2006-11-11 14:35 ` Jan Kiszka
  2006-11-11 19:11   ` Wolfgang Grandegger
  2006-11-14 19:42   ` Wolfgang Grandegger
  2006-11-11 16:34 ` Philippe Gerum
  1 sibling, 2 replies; 5+ messages in thread
From: Jan Kiszka @ 2006-11-11 14:35 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

Wolfgang Grandegger wrote:
> 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...)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai-core] [PATCH] Xenomai configuration help for Linux 2.4
  2006-11-11 12:43 [Xenomai-core] [PATCH] Xenomai configuration help for Linux 2.4 Wolfgang Grandegger
  2006-11-11 14:35 ` Jan Kiszka
@ 2006-11-11 16:34 ` Philippe Gerum
  1 sibling, 0 replies; 5+ messages in thread
From: Philippe Gerum @ 2006-11-11 16:34 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: xenomai-core

On Sat, 2006-11-11 at 13:43 +0100, Wolfgang Grandegger wrote:
> Hello,
> 
> the attached patch adds Xenomai configuration help for Linux 2.4:
> 
> 2006-11-11  Wolfgang Grandegger  <wg@domain.hid>
> 
> 	* 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.
> 

Nice. Applied, thanks.

> Wolfgang.
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
-- 
Philippe.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai-core] [PATCH] Xenomai configuration help for Linux 2.4
  2006-11-11 14:35 ` Jan Kiszka
@ 2006-11-11 19:11   ` Wolfgang Grandegger
  2006-11-14 19:42   ` Wolfgang Grandegger
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Grandegger @ 2006-11-11 19:11 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai-core

Jan Kiszka wrote:
> Wolfgang Grandegger wrote:
>> 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.

> 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.

> Thanks,
> Jan (who wishes that this would also work for Kconfig->Config.in...)

Yeah, but...

Wolfgang.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai-core] [PATCH] Xenomai configuration help for Linux 2.4
  2006-11-11 14:35 ` Jan Kiszka
  2006-11-11 19:11   ` Wolfgang Grandegger
@ 2006-11-14 19:42   ` Wolfgang Grandegger
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Grandegger @ 2006-11-14 19:42 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

Jan Kiszka wrote:
> Wolfgang Grandegger wrote:
>> 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?

I think the attached patch does what you want (using sed).

Wolfgang

> 
> Thanks,
> Jan (who wishes that this would also work for Kconfig->Config.in...)
> 


[-- Attachment #2: xenomai-help-from-kconfig2.patch --]
[-- Type: text/x-patch, Size: 1398 bytes --]

Index: scripts/prepare-kernel.sh
===================================================================
--- scripts/prepare-kernel.sh	(revision 1835)
+++ scripts/prepare-kernel.sh	(working copy)
@@ -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
 }
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-11-14 19:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-11 12:43 [Xenomai-core] [PATCH] Xenomai configuration help for Linux 2.4 Wolfgang Grandegger
2006-11-11 14:35 ` Jan Kiszka
2006-11-11 19:11   ` Wolfgang Grandegger
2006-11-14 19:42   ` Wolfgang Grandegger
2006-11-11 16:34 ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.