public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: HeXiLeD <hexiled@nixbits.net>
Subject: [B.A.T.M.A.N.] batman-adv load module patch
Date: Mon, 26 Mar 2012 17:43:11 -0400	[thread overview]
Message-ID: <4F70E2EF.4060009@nixbits.net> (raw)
In-Reply-To: <201203261241.32890.lindner_marek@yahoo.de>

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

I have been trying to apply the patch which tries to fix the openwrt scripts in regards having batman-adv to bring up all it's attached  interfaces but something seems not to be working.

Patch

------------------------------------------------------------------------

--- a/batman-adv/files/lib/batman-adv/config.sh	(revision 30804)
+++ b/batman-adv/files/lib/batman-adv/config.sh	(working copy)
@@ -1,6 +1,15 @@
 #!/bin/sh
 
-bat_config(){
+bat_load_module()
+{
+	[ -d "/sys/module/batman_adv/" ] && return
+	
+	. /etc/functions.sh
+	load_modules /etc/modules.d/*-lib-crc16 /etc/modules.d/*-batman-adv	
+}
+
+bat_config()
+{
 	local mesh="$1"
 	local aggregated_ogms bonding fragmentation gw_bandwidth gw_mode gw_sel_class log_level orig_interval hop_penalty vis_mode
 
@@ -30,7 +39,8 @@
 	
 }
 
-bat_add_interface(){
+bat_add_interface()
+{
 	local mesh="$1"
 	local interface="$2"
 	local interfaces
@@ -47,7 +57,8 @@
 	done
 }
 
-bat_del_interface(){
+bat_del_interface()
+{
 	local mesh="$1"
 	local interface="$2"
 	local interfaces
--- a/batman-adv/files/usr/sbin/batman-adv	(revision 30804)
+++ b/batman-adv/files/usr/sbin/batman-adv	(working copy)
@@ -26,6 +26,7 @@
 
 # can also be used with "batman-adv start bat0"
 start() {
+	bat_load_module
 	config_load batman-adv
 
 	if [ -n "$1" ]; then
--- a/batman-adv/files/etc/hotplug.d/net/99-batman-adv	(revision 30804)
+++ b/batman-adv/files/etc/hotplug.d/net/99-batman-adv	(working copy)
@@ -2,6 +2,7 @@
 
 . /lib/batman-adv/config.sh
 
+bat_load_module
 config_load batman-adv
 
 case "$ACTION" in


------------------------------------------------------------------------
The patch should be working with my current revision:

URL: svn://svn.openwrt.org/openwrt/branches/backfire
Repository Root: svn://svn.openwrt.org/openwrt
Repository UUID: 3c298f89-4303-0410-b956-a3cf2f4a3e73
Revision: 31071
Node Kind: directory
Schedule: normal
Last Changed Author: jow
Last Changed Rev: 30898
Last Changed Date: 2012-03-11 22:09:16 -0400 (Sun, 11 Mar 2012)

As it seemed to be for 30313
https://dev.openwrt.org/browser/branches/packages_10.03.2/net/batman-adv/files/lib/batman-adv/config.sh

However it fails

Path:
OPENWRT/backfire/feeds/packages/net/batman-adv/files/etc/hotplug.d/net/99-batman-adv
------------------------------------------------------------------------

$ patch -p2 < batman-adv_load-module-when-needed.patch 99-batman-adv 
patching file 99-batman-adv
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 30.
Hunk #3 FAILED at 47.
3 out of 3 hunks FAILED -- saving rejects to file 99-batman-adv.rej
patching file 99-batman-adv
Hunk #1 FAILED at 26.
1 out of 1 hunk FAILED -- saving rejects to file 99-batman-adv.rej
patching file 99-batman-adv


$ patch -p1< batman-adv_load-module-when-needed.patch 
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/batman-adv/files/lib/batman-adv/config.sh        (revision 30804)
|+++ b/batman-adv/files/lib/batman-adv/config.sh        (working copy)
--------------------------
File to patch: 99-batman-adv
patching file 99-batman-adv
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 30.
Hunk #3 FAILED at 47.
3 out of 3 hunks FAILED -- saving rejects to file 99-batman-adv.rej
can't find file to patch at input line 42
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/batman-adv/files/usr/sbin/batman-adv     (revision 30804)
|+++ b/batman-adv/files/usr/sbin/batman-adv     (working copy)


Changing the patch number and increasing it does not work.

------------------------------------------------------------------------

99-batman-adv.rej

$ cat 99-batman-adv.rej
--- batman-adv/files/lib/batman-adv/config.sh   (revision 30804)
+++ batman-adv/files/lib/batman-adv/config.sh   (working copy)
@@ -1,6 +1,15 @@
 #!/bin/sh
 
-bat_config(){
+bat_load_module()
+{
+       [ -d "/sys/module/batman_adv/" ] && return
+       
+       . /etc/functions.sh
+       load_modules /etc/modules.d/*-lib-crc16 /etc/modules.d/*-batman-adv     
+}
+
+bat_config()
+{
        local mesh="$1"
        local aggregated_ogms bonding fragmentation gw_bandwidth gw_mode gw_sel_class log_level orig_interval hop_penalty vis_mode
 
@@ -30,7 +39,8 @@
        
 }
 
-bat_add_interface(){
+bat_add_interface()
+{
        local mesh="$1"
        local interface="$2"
        local interfaces
@@ -47,7 +57,8 @@
        done
 }
 
-bat_del_interface(){
+bat_del_interface()
+{
        local mesh="$1"
        local interface="$2"
        local interfaces


------------------------------------------------------------------------

Solutions?


[-- Attachment #2: batman-adv_load-module-when-needed.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

--- a/batman-adv/files/lib/batman-adv/config.sh	(revision 30804)
+++ b/batman-adv/files/lib/batman-adv/config.sh	(working copy)
@@ -1,6 +1,15 @@
 #!/bin/sh
 
-bat_config(){
+bat_load_module()
+{
+	[ -d "/sys/module/batman_adv/" ] && return
+	
+	. /etc/functions.sh
+	load_modules /etc/modules.d/*-lib-crc16 /etc/modules.d/*-batman-adv	
+}
+
+bat_config()
+{
 	local mesh="$1"
 	local aggregated_ogms bonding fragmentation gw_bandwidth gw_mode gw_sel_class log_level orig_interval hop_penalty vis_mode
 
@@ -30,7 +39,8 @@
 	
 }
 
-bat_add_interface(){
+bat_add_interface()
+{
 	local mesh="$1"
 	local interface="$2"
 	local interfaces
@@ -47,7 +57,8 @@
 	done
 }
 
-bat_del_interface(){
+bat_del_interface()
+{
 	local mesh="$1"
 	local interface="$2"
 	local interfaces
--- a/batman-adv/files/usr/sbin/batman-adv	(revision 30804)
+++ b/batman-adv/files/usr/sbin/batman-adv	(working copy)
@@ -26,6 +26,7 @@
 
 # can also be used with "batman-adv start bat0"
 start() {
+	bat_load_module
 	config_load batman-adv
 
 	if [ -n "$1" ]; then
--- a/batman-adv/files/etc/hotplug.d/net/99-batman-adv	(revision 30804)
+++ b/batman-adv/files/etc/hotplug.d/net/99-batman-adv	(working copy)
@@ -2,6 +2,7 @@
 
 . /lib/batman-adv/config.sh
 
+bat_load_module
 config_load batman-adv
 
 case "$ACTION" in


       reply	other threads:[~2012-03-26 21:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201203261241.32890.lindner_marek@yahoo.de>
2012-03-26 21:43 ` HeXiLeD [this message]
2012-03-27  9:58   ` [B.A.T.M.A.N.] batman-adv load module patch Marek Lindner
2012-03-28 10:21     ` HeXiLeD
2012-03-28 11:36       ` Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F70E2EF.4060009@nixbits.net \
    --to=hexiled@nixbits.net \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox