Skip to contentSkip to conversation

runme patch for 2.5

PATCH In review Martin Josefsson 3 participants 6 messages Oct 10, 2002 – Nov 12, 2002 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runme patch for 2.5

Hi there,

Here's a small patch that will make patch-o-matic work with kernel 2.5 There's been some configurationchanges (Documentation/Configure.help doesn't exist anymore)

This patch will make 'runme' incompatible with kernel 2.4 so use it only with 2.5 kernels.

Signature · 4 lines
/Martin

Never argue with an idiot. They drag you down to their level, then beat
you with experience.
runme renamed from runme-2.4 +25 -25
@@ -52,7 +52,7 @@
 	dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -x -w32 -A n | tr -d ' '
 }
 
-# Too many rejects from trying to patch Configure.help and Config.in.
+# Too many rejects from trying to patch Config.help and Config.in.
 # So we use special format: First line specifies entry we want to
 # follow, and rest of file is pasted in under that.
 
@@ -123,10 +123,10 @@
 apply_config_help_change()
 {
     PRIOR="`head -1 $1`"
-    LINE=`fgrep -x -n "$PRIOR" $2/Configure.help | cut -d: -f1 | head -1`
+    LINE=`fgrep -x -n "$PRIOR" $2/Config.help | cut -d: -f1 | head -1`
     if [ -z "$LINE" ] || [ "$LINE" -eq 0 ]
     then
-	echo Could not find place to slot in Configure.help entry >&2
+	echo Could not find place to slot in Config.help entry >&2
 	return 1
     fi
 
@@ -135,13 +135,13 @@
         # Reverse "patch"
 
         NUMLINES1=`sed -n \$= $1`
-        NUMLINES2=`sed -n \$= $2/Configure.help`
+        NUMLINES2=`sed -n \$= $2/Config.help`
         BEGIN=2
 
-        LINES=`fgrep -nx "\`sed -n 2p $1\`" $2/Configure.help | cut -d: -f1`
+        LINES=`fgrep -nx "\`sed -n 2p $1\`" $2/Config.help | cut -d: -f1`
         if [ -z "$LINES" ]
         then
-	    echo Configure.help text not found >&2
+	    echo Config.help text not found >&2
             return 1
         fi
 
@@ -152,7 +152,7 @@
             TESTLINE=$BEGIN
             # Be paranoid and check for match on all lines
             while `let "$TESTLINE <= $NUMLINES1"`; do
-                NOMATCH=`awk "NR==$x + $TESTLINE - $BEGIN" $2/Configure.help|\
+                NOMATCH=`awk "NR==$x + $TESTLINE - $BEGIN" $2/Config.help|\
                         fgrep -xcv "\`sed -n -e ${TESTLINE}p $1\`"`;
 
                 if [ $NOMATCH -ne 0 ]; then continue 2; fi
@@ -165,42 +165,42 @@
         done; # for
 
         if [ ! "$MATCHES" ]; then
-            echo Configure.help text not found >&2
+            echo Config.help text not found >&2
             return 1
         fi;
 
         for x in $MATCHES; do
-#            if (head -`expr $x - 1` $2/Configure.help && \
-#                tail -n +`expr $x + $NUMLINES1` $2/Configure.help) > $2/Configure.help.tmp
-	    if (awk "NR==1,NR==$x - 1" $2/Configure.help && \
-                awk "NR==$x + $NUMLINES1,NR=0" $2/Configure.help) > $2/Configure.help.tmp
+#            if (head -`expr $x - 1` $2/Config.help && \
+#                tail -n +`expr $x + $NUMLINES1` $2/Config.help) > $2/Config.help.tmp
+	    if (awk "NR==1,NR==$x - 1" $2/Config.help && \
+                awk "NR==$x + $NUMLINES1,NR=0" $2/Config.help) > $2/Config.help.tmp
             then
-                mv $2/Configure.help.tmp $2/Configure.help
+                mv $2/Config.help.tmp $2/Config.help
             else
-                echo Could not update Configure.help >&2
-                rm -f $2/Configure.help.tmp
+                echo Could not update Config.help >&2
+                rm -f $2/Config.help.tmp
                 return 1
             fi
         done
-        echo "   Configure.help updated"
+        echo "   Config.help updated"
         return 0
     fi
 
     #Apply "Patch"
 
-    rm -f $2/Configure.help.tmp
+    rm -f $2/Config.help.tmp
     # Use awk to force newline if last line of $1 has only spaces
     # Necessary to properly remove inserted text if patch is reversed
-    if (awk "NR==1,NR==$LINE-2" $2/Configure.help && awk "NR==2,NR==0" $1 && echo && \
-        awk "NR==$LINE-1,NR==0" $2/Configure.help) > $2/Configure.help.tmp
+    if (awk "NR==1,NR==$LINE-2" $2/Config.help && awk "NR==2,NR==0" $1 && echo && \
+        awk "NR==$LINE-1,NR==0" $2/Config.help) > $2/Config.help.tmp
     then
-	mv $2/Configure.help.tmp $2/Configure.help
+	mv $2/Config.help.tmp $2/Config.help
     else
-	echo Could not slot in Configure.help entry >&2
-	rm -f $2/Configure.help.tmp
+	echo Could not slot in Config.help entry >&2
+	rm -f $2/Config.help.tmp
 	return 1
     fi
-    echo "   Placed new Configure.help entry"
+    echo "   Placed new Config.help entry"
     return 0
 }
 
@@ -336,7 +336,7 @@
     echo Testing patch $1...
 
     if apply_config_in_changes $1 $KTMPDIR/net/$2/netfilter &&
-	apply_config_help_changes $1 $KTMPDIR/Documentation &&
+	apply_config_help_changes $1 $KTMPDIR/net/$2/netfilter &&
 	apply_makefile_changes $1 $KTMPDIR/net/$2/netfilter &&
 	apply_conntrack_h_changes $1 $KTMPDIR/include/linux/netfilter_$2
     then :
@@ -461,7 +461,7 @@
         fi
     fi
     apply_config_in_changes $1 $KERNEL_DIR/net/$2/netfilter/
-    apply_config_help_changes $1 $KERNEL_DIR/Documentation/
+    apply_config_help_changes $1 $KERNEL_DIR/net/$2/netfilter/
     apply_makefile_changes $1 $KERNEL_DIR/net/$2/netfilter/
     apply_conntrack_h_changes $1 $KERNEL_DIR/include/linux/netfilter_$2
 }
#1 lore raw

http://www.freeprotocols.org

http://www1.ietf.org/mail-archive/ietf/Current/msg17839.html
From: "Bill Cunningham" <[email protected]>
Linus,
"...I curious as to whether or not you're a member of the IETF..."
===================================

Linux has code in the kernel to block easy access to all values in the TOS field. It can be easily changed, but one has to wonder why it is there.

As for...
http://www.freeprotocols.org
in the words of Larry Wall (Perl)...
"Sometimes it is important to own something, in order to have the rights to freely give it away."

http://interviews.slashdot.org/article.pl?sid=02/10/09/
"I suppose I wish I had decided on a larger address space than 32 bits! "

Jim Fleming
2002:[IPv4]:000X:03DB:...IPv8 is closer than you think...IPv16 is even closer...
http://www.ietf.com
http://www.iana.org/assignments/ipv4-address-space
http://www.ntia.doc.gov/ntiahome/domainname/130dftmail/unir.txt
http://ipv8.dyndns.tv
http://ipv8.dyns.cx
http://ipv8.no-ip.com
http://ipv8.no-ip.biz
http://ipv8.no-ip.info
http://ipv8.myip.us
http://ipv8.dyn.ee
http://ipv8.community.net.au

#2 lore raw
In reply to Martin Josefsson

Good evening, Martin, Harald, all,

Quoted 6 lines · Martin Josefsson

Here's a small patch that will make patch-o-matic work with kernel 2.5 There's been some configurationchanges (Documentation/Configure.help doesn't exist anymore)

This patch will make 'runme' incompatible with kernel 2.4 so use it only with 2.5 kernels.

Many thanks, Martin, for the work.
I've attached a patch, based on Martin's approach, that detects
whether Config.help or Configure.help is in use and automatically uses what it finds.
The second parameter to apply_config_help_change(s) has been
changed to the file to use rather than the directory in which Config*.help lives.
The patched runme successfully finds help files in 2.4.19 and
2.5.42-ac1. Please let me know if there are problems with it.
Cheers,
- Bill

---------------------------------------------------------------------------
"I would give up my right arm before I'd give up my netfilter
firewall."
-- Chris Brenton
--------------------------------------------------------------------------
William Stearns ([email protected]). Mason, Buildkernel, named2hosts,
and ipfwadm2ipchains are at: http://www.stearns.org
--------------------------------------------------------------------------

runme +42 -26
diff -uNr patch-o-matic-20021012.orig.runme24/runme patch-o-matic-20021012/runme
@@ -52,7 +52,7 @@
 	dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -x -w32 -A n | tr -d ' '
 }
 
-# Too many rejects from trying to patch Configure.help and Config.in.
+# Too many rejects from trying to patch Configure.help/Config.help and Config.in.
 # So we use special format: First line specifies entry we want to
 # follow, and rest of file is pasted in under that.
 
@@ -119,14 +119,19 @@
     return 0
 }
 
-# Args: configure.help file, Documentation dir.
+# Args: configure.help file, Documentation file to which to add it.
 apply_config_help_change()
 {
+    if [ "$2" = '/dev/null' ]; then
+        #return 0	#Use this one if you don't care that the config*.help file is not getting updated
+        return 1	#Fail
+    fi
+    BASEFILE=`basename $2`	#Configure.help or Config.help
     PRIOR="`head -1 $1`"
-    LINE=`fgrep -x -n "$PRIOR" $2/Configure.help | cut -d: -f1 | head -1`
+    LINE=`fgrep -x -n "$PRIOR" $2 | cut -d: -f1 | head -1`
     if [ -z "$LINE" ] || [ "$LINE" -eq 0 ]
     then
-	echo Could not find place to slot in Configure.help entry >&2
+	echo Could not find place to slot in $BASEFILE entry >&2
 	return 1
     fi
 
@@ -135,13 +140,13 @@
         # Reverse "patch"
 
         NUMLINES1=`sed -n \$= $1`
-        NUMLINES2=`sed -n \$= $2/Configure.help`
+        NUMLINES2=`sed -n \$= $2`
         BEGIN=2
 
-        LINES=`fgrep -nx "\`sed -n 2p $1\`" $2/Configure.help | cut -d: -f1`
+        LINES=`fgrep -nx "\`sed -n 2p $1\`" $2 | cut -d: -f1`
         if [ -z "$LINES" ]
         then
-	    echo Configure.help text not found >&2
+	    echo $BASEFILE text not found >&2
             return 1
         fi
 
@@ -152,7 +157,7 @@
             TESTLINE=$BEGIN
             # Be paranoid and check for match on all lines
             while `let "$TESTLINE <= $NUMLINES1"`; do
-                NOMATCH=`awk "NR==$x + $TESTLINE - $BEGIN" $2/Configure.help|\
+                NOMATCH=`awk "NR==$x + $TESTLINE - $BEGIN" $2|\
                         fgrep -xcv "\`sed -n -e ${TESTLINE}p $1\`"`;
 
                 if [ $NOMATCH -ne 0 ]; then continue 2; fi
@@ -165,42 +170,42 @@
         done; # for
 
         if [ ! "$MATCHES" ]; then
-            echo Configure.help text not found >&2
+            echo $BASEFILE text not found >&2
             return 1
         fi;
 
         for x in $MATCHES; do
-#            if (head -`expr $x - 1` $2/Configure.help && \
-#                tail -n +`expr $x + $NUMLINES1` $2/Configure.help) > $2/Configure.help.tmp
-	    if (awk "NR==1,NR==$x - 1" $2/Configure.help && \
-                awk "NR==$x + $NUMLINES1,NR=0" $2/Configure.help) > $2/Configure.help.tmp
+#            if (head -`expr $x - 1` $2 && \
+#                tail -n +`expr $x + $NUMLINES1` $2) > $2.tmp
+	    if (awk "NR==1,NR==$x - 1" $2 && \
+                awk "NR==$x + $NUMLINES1,NR=0" $2) > $2.tmp
             then
-                mv $2/Configure.help.tmp $2/Configure.help
+                mv $2.tmp $2
             else
-                echo Could not update Configure.help >&2
-                rm -f $2/Configure.help.tmp
+                echo Could not update $BASEFILE >&2
+                rm -f $2.tmp
                 return 1
             fi
         done
-        echo "   Configure.help updated"
+        echo "   $BASEFILE updated"
         return 0
     fi
 
     #Apply "Patch"
 
-    rm -f $2/Configure.help.tmp
+    rm -f $2.tmp
     # Use awk to force newline if last line of $1 has only spaces
     # Necessary to properly remove inserted text if patch is reversed
-    if (awk "NR==1,NR==$LINE-2" $2/Configure.help && awk "NR==2,NR==0" $1 && echo && \
-        awk "NR==$LINE-1,NR==0" $2/Configure.help) > $2/Configure.help.tmp
+    if (awk "NR==1,NR==$LINE-2" $2 && awk "NR==2,NR==0" $1 && echo && \
+        awk "NR==$LINE-1,NR==0" $2) > $2.tmp
     then
-	mv $2/Configure.help.tmp $2/Configure.help
+	mv $2.tmp $2
     else
-	echo Could not slot in Configure.help entry >&2
-	rm -f $2/Configure.help.tmp
+	echo Could not slot in $BASEFILE entry >&2
+	rm -f $2.tmp
 	return 1
     fi
-    echo "   Placed new Configure.help entry"
+    echo "   Placed new $BASEFILE entry"
     return 0
 }
 
@@ -335,8 +340,19 @@
 
     echo Testing patch $1...
 
+    if [ -f "$KTMPDIR/net/$2/netfilter/Config.help" ]; then
+    	DOCUMENTATIONFILE="$KTMPDIR/net/$2/netfilter/Config.help"
+    elif [ -f "$KTMPDIR/Documentation/Configure.help" ]; then
+        DOCUMENTATIONFILE="$KTMPDIR/Documentation/Configure.help"
+    else
+        echo Warning - no help text file could be found in either >&2
+        echo $KTMPDIR/net/$2/netfilter/Config.help >&2
+        echo or $KTMPDIR/Documentation/Configure.help >&2
+	DOCUMENTATIONFILE=/dev/null
+    fi
+
     if apply_config_in_changes $1 $KTMPDIR/net/$2/netfilter &&
-	apply_config_help_changes $1 $KTMPDIR/Documentation &&
+	apply_config_help_changes $1 $DOCUMENTATIONFILE &&
 	apply_makefile_changes $1 $KTMPDIR/net/$2/netfilter &&
 	apply_conntrack_h_changes $1 $KTMPDIR/include/linux/netfilter_$2
     then :
@@ -461,7 +477,7 @@
         fi
     fi
     apply_config_in_changes $1 $KERNEL_DIR/net/$2/netfilter/
-    apply_config_help_changes $1 $KERNEL_DIR/Documentation/
+    apply_config_help_changes $1 $DOCUMENTATIONFILE
     apply_makefile_changes $1 $KERNEL_DIR/net/$2/netfilter/
     apply_conntrack_h_changes $1 $KERNEL_DIR/include/linux/netfilter_$2
 }
#3 lore raw
Quoted 11 lines · William Stearns

Good evening, Martin, Harald, all,

Quoted 6 lines · Martin Josefsson

Here's a small patch that will make patch-o-matic work with kernel 2.5 There's been some configurationchanges (Documentation/Configure.help doesn't exist anymore)

This patch will make 'runme' incompatible with kernel 2.4 so use it only with 2.5 kernels.

Quoted 9 lines

Many thanks, Martin, for the work.
I've attached a patch, based on Martin's approach, that detects
whether Config.help or Configure.help is in use and automatically uses what it finds.
The second parameter to apply_config_help_change(s) has been
changed to the file to use rather than the directory in which Config*.help lives.
The patched runme successfully finds help files in 2.4.19 and
2.5.42-ac1. Please let me know if there are problems with it.

I think this looks ok but I havn't tested it yet. As long as p-o-m is compatible with both 2.4 and 2.5 this would be a nice thing to include. (and the same runme could be used for both 2.4 and 2.5 p-o-m when they are split)

Signature · 4 lines
/Martin

Never argue with an idiot. They drag you down to their level, then beat
you with experience.
#4 lore raw
In reply to William Stearns

Good day, all,

Quoted 9 lines · William Stearns
Quoted 6 lines · Martin Josefsson

Here's a small patch that will make patch-o-matic work with kernel 2.5 There's been some configurationchanges (Documentation/Configure.help doesn't exist anymore)

This patch will make 'runme' incompatible with kernel 2.4 so use it only with 2.5 kernels.

Quoted 9 lines

Many thanks, Martin, for the work.
I've attached a patch, based on Martin's approach, that detects
whether Config.help or Configure.help is in use and automatically uses what it finds.
The second parameter to apply_config_help_change(s) has been
changed to the file to use rather than the directory in which Config*.help lives.
The patched runme successfully finds help files in 2.4.19 and
2.5.42-ac1. Please let me know if there are problems with it.

Harald, do you have any concerns about the patch? (Not resent in
this mail, though I'd be happy to).
Cheers,
- Bill

---------------------------------------------------------------------------
"1-800-psych: hello, welcome to the psychiatric hotline. If you
are obsessive-compulsive, please press 1 repeatedly." (Courtesy of Martin F Krafft <[email protected]>)
--------------------------------------------------------------------------
William Stearns ([email protected]). Mason, Buildkernel, named2hosts,
and ipfwadm2ipchains are at: http://www.stearns.org
--------------------------------------------------------------------------

#5 lore raw
Quoted 2 lines · William Stearns

Harald, do you have any concerns about the patch? (Not resent in
this mail, though I'd be happy to).

I don't know if Harald told you but he applied your patch and I finally got around to building a new kernel here. I found a small problem with your patch and I corrected the runme in cvs.

my changes to runme:
http://cvs.netfilter.org/cgi-bin/cvsweb/netfilter/patch-o-matic/runme?r1=1.29&r2=1.30&f=u

Harald, I know I wasn't supposed to touch runme in cvs but I couldn't help myself when I found the problem :)
The same problem exists in patch-o-matic_2.5/runme which I don't have permission to alter, same patch works there as they were identical.

cd patch-o-matic_2.5 ; wget -qO - "$url" | patch -p2

I havn't looked at the new configurationsystem in 2.5, will that make our stuff in patch-o-matic incompatible?

Signature · 4 lines
/Martin

Never argue with an idiot. They drag you down to their level, then beat
you with experience.