The following commit has been merged in the master branch:
commit 24d65d307541b7d9bcbb09e58b9209bb20b2c721
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Fri Dec 9 10:18:27 2011 +0100
batman-adv: Generate config compatible with kbuild macros
Linux 3.0-rc1-30-g2a11c8e introduced the macros IS_ENABLED, IS_BUILTIN and
IS_MODULE that can be used to identify which state a tristate option had. The
compat-autoconf.h needs to provide additional precompiler variables that these
marcros can use.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/gen-compat-autoconf.sh b/gen-compat-autoconf.sh
index 440accc..1a020c1 100755
--- a/gen-compat-autoconf.sh
+++ b/gen-compat-autoconf.sh
@@ -12,15 +12,22 @@ gen_config() {
VALUE="${2}"
echo "#undef ${KEY}"
+ echo "#undef __enabled_${KEY}"
+ echo "#undef __enabled_${KEY}_MODULE"
case "${VALUE}" in
y)
echo "#define ${KEY} 1"
+ echo "#define __enabled_${KEY} 1"
+ echo "#define __enabled_${KEY}_MODULE 0"
;;
m)
echo "#define ${KEY} 1"
+ echo "#define __enabled_${KEY} 0"
+ echo "#define __enabled_${KEY}_MODULE 1"
;;
n)
- # leave it undefined
+ echo "#define __enabled_${KEY} 0"
+ echo "#define __enabled_${KEY}_MODULE 0"
;;
*)
echo "#define ${KEY} \"${VALUE}\""
--
batman-adv
The following commit has been merged in the master branch:
commit 9d3e1ff0603b62f6da4c8ac0657272f2a2e4d731
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Wed Dec 7 18:02:50 2011 +0800
batman-adv: warn if added interface is part of a bridge
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/compat.h b/compat.h
index 6480614..194e70e 100644
--- a/compat.h
+++ b/compat.h
@@ -59,6 +59,7 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
#define __rcu
+#define IFF_BRIDGE_PORT 0 || (hard_iface->net_dev->br_port ? 1 : 0)
#endif /* < KERNEL_VERSION(2, 6, 36) */
diff --git a/hard-interface.c b/hard-interface.c
index d3e0e32..68b667c 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -281,6 +281,14 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
if (!atomic_inc_not_zero(&hard_iface->refcount))
goto out;
+ /* hard-interface is part of a bridge */
+ if (hard_iface->net_dev->priv_flags & IFF_BRIDGE_PORT)
+ pr_err("You are about to enable batman-adv on '%s' which "
+ "already is part of a bridge. Unless you know exactly "
+ "what you are doing this is probably wrong and won't "
+ "work the way you think it would.\n",
+ hard_iface->net_dev->name);
+
soft_iface = dev_get_by_name(&init_net, iface_name);
if (!soft_iface) {
--
batman-adv
The following commit has been merged in the master branch:
commit f742a6487a9dbd38ab3d0306c93a68f3d7940969
Author: Martin Hundebøll <martin(a)hundeboll.net>
Date: Thu Dec 8 12:48:26 2011 +0100
batman-adv: Rm empty line from is_my_mac() in main.c
Signed-off-by: Martin Hundebøll <martin(a)hundeboll.net>
diff --git a/main.c b/main.c
index fb87bdc..71b56cf 100644
--- a/main.c
+++ b/main.c
@@ -170,7 +170,6 @@ int is_my_mac(const uint8_t *addr)
}
rcu_read_unlock();
return 0;
-
}
module_init(batman_init);
--
batman-adv
The following commit has been merged in the master branch:
commit 486dc02b027ff118757c0cc530040a4e855f2e5a
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Wed Dec 7 13:27:16 2011 +0100
batman-adv: Don't try to read commit information from target kernel
It is possible that the kernel used to build the batman-adv module also
contains a .git directory. The makefile should not try to run git-describe
inside this kernel to prevent that wrong version information is stored in the
generated module.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/Makefile b/Makefile
index 99fd366..e2276be 100644
--- a/Makefile
+++ b/Makefile
@@ -32,8 +32,8 @@ endif
export KERNELPATH
RM ?= rm -f
-REVISION= $(shell if [ -d .git ]; then \
- echo $$(git describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \
+REVISION= $(shell if [ -d "$(PWD)/.git" ]; then \
+ echo $$(git --git-dir="$(PWD)/.git" describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \
fi)
CONFIG_BATMAN_ADV=m
--
batman-adv
The following commit has been merged in the master branch:
commit b3d474c54bca76797e88878f29f100a7d5c7e02b
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Dec 4 20:10:48 2011 +0100
batman-adv: Allow to enable features without editing Makefile
The user should not be encouraged to edit sources to prevent inconsistent
changes. Upcoming features will not only use preprocessor variables to enable
or disable itself, but also need to compile specific files at the same time.
Therefore, it is safer to provide make parameters which can enable everything
necessary for a specific option and look similar to the .config options of the
kernel.
It is not possible to disable features enabled by the target kernel because the
include/generated/autoconf.h of the kernel sources isn't regenerated by a
module build. Hence, it is better not to disable features in the makefile by
default because the preprocessor will not have the same information. This can
be changed later by a more complex configuration system that generates an own
compat_autoconf.h that is included by compat.h. This header would have to
define/undef all preprocessor variables used to configure batman-adv features.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/Makefile b/Makefile
index 4f338aa..e78e797 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,10 @@
# 02110-1301, USA
#
-
+# uncomment the CONFIG_* line to enable the related feature
+# features enabled in the target kernel configuration cannot be disabled
+# B.A.T.M.A.N. debugging:
+# CONFIG_BATMAN_ADV_DEBUG=y
PWD:=$(shell pwd)
KERNELPATH ?= /lib/modules/$(shell uname -r)/build
@@ -38,7 +41,7 @@ batman-adv-y += compat.o
ifneq ($(REVISION),)
ccflags-y += -DSOURCE_VERSION=\"$(REVISION)\"
endif
-# ccflags-y += -DCONFIG_BATMAN_ADV_DEBUG
+ccflags-$(CONFIG_BATMAN_ADV_DEBUG) += -DCONFIG_BATMAN_ADV_DEBUG
include $(PWD)/Makefile.kbuild
all:
diff --git a/README b/README
index 7404c0a..ddc9569 100644
--- a/README
+++ b/README
@@ -207,10 +207,10 @@ times necessary to see more detail debug messages. This must be
enabled when compiling the batman-adv module. When building bat-
man-adv as part of kernel, use "make menuconfig" and enable the
option "B.A.T.M.A.N. debugging". When compiling outside of the
-kernel tree it is necessary to edit the file Makefile.kbuild and
-uncomment the line
+kernel tree it is necessary to enable it using the make option
+CONFIG_BATMAN_ADV_DEBUG=y
-#ccflags-y += -DCONFIG_BATMAN_ADV_DEBUG
+# make CONFIG_BATMAN_ADV_DEBUG=y
Those additional debug messages can be accessed using a special
file in debugfs
--
batman-adv
The following commit has been merged in the master branch:
commit b49b17f6da9928d32b3162f5e2779cbd10edf8a4
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Dec 4 20:10:47 2011 +0100
batman-adv: Remove non-kernel parts from Makefile.kbuild
The standalone batman-adv module is sent to the linux kernel maintainers to be
merged by them. A batman-adv developer has to manually merge the changes since
the last submission and apply it on top of the current linux development tree.
The standalone sources have to provide an additional layer that increases the
compatibility to kernels and to give a better user experience. This layer will
not be sent to the kernel maintainers and has to manually removed each time.
To reduce this work, the Makefile.kbuild should be cleaned up to be only the
vanilla version of the Makefile in the kernel. The Makefile in the standalone
sources is used to provide most of the additional layer.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/Makefile b/Makefile
index 15f099e..4f338aa 100644
--- a/Makefile
+++ b/Makefile
@@ -33,10 +33,16 @@ REVISION= $(shell if [ -d .git ]; then \
echo $$(git describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \
fi)
+CONFIG_BATMAN_ADV=m
+batman-adv-y += compat.o
+ifneq ($(REVISION),)
+ccflags-y += -DSOURCE_VERSION=\"$(REVISION)\"
+endif
+# ccflags-y += -DCONFIG_BATMAN_ADV_DEBUG
include $(PWD)/Makefile.kbuild
all:
- $(MAKE) -C $(KERNELPATH) REVISION=$(REVISION) M=$(PWD) PWD=$(PWD) modules
+ $(MAKE) -C $(KERNELPATH) M=$(PWD) PWD=$(PWD) modules
clean:
$(MAKE) -C $(KERNELPATH) M=$(PWD) PWD=$(PWD) clean
diff --git a/Makefile.kbuild b/Makefile.kbuild
index 3c51455..ce68611 100644
--- a/Makefile.kbuild
+++ b/Makefile.kbuild
@@ -18,13 +18,7 @@
# 02110-1301, USA
#
-# ccflags-y += -DCONFIG_BATMAN_ADV_DEBUG
-
-ifneq ($(REVISION),)
-ccflags-y += -DSOURCE_VERSION=\"$(REVISION)\"
-endif
-
-obj-m += batman-adv.o
+obj-$(CONFIG_BATMAN_ADV) += batman-adv.o
batman-adv-y += bat_debugfs.o
batman-adv-y += bat_iv_ogm.o
batman-adv-y += bat_sysfs.o
@@ -43,4 +37,3 @@ batman-adv-y += soft-interface.o
batman-adv-y += translation-table.o
batman-adv-y += unicast.o
batman-adv-y += vis.o
-batman-adv-y += compat.o
--
batman-adv
The following commit has been merged in the master branch:
commit fac4043933f4bc09ad08c57c6f338623a383b2de
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Dec 4 20:10:46 2011 +0100
batman-adv: Remove OpenWRT specific makefile rules
Makefile and Makefile.kbuild are included by the linux kbuild environment to
build the kernel module. Rules by other build systems could lead to hard to
debug problems and therefore should be avoided.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/Makefile.kbuild b/Makefile.kbuild
index bd7e93c..3c51455 100644
--- a/Makefile.kbuild
+++ b/Makefile.kbuild
@@ -18,13 +18,6 @@
# 02110-1301, USA
#
-
-
-# openwrt integration
-ifeq ($(MAKING_MODULES),1)
--include $(TOPDIR)/Rules.make
-endif
-
# ccflags-y += -DCONFIG_BATMAN_ADV_DEBUG
ifneq ($(REVISION),)
--
batman-adv
The following commit has been merged in the master branch:
commit 63b3c662a1b5ec2a288091bbc0d01ce6197873bf
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Dec 4 20:10:45 2011 +0100
batman-adv: Don't automatically build in parallel
Distributions like Gentoo and Debian have policies which make it
necessary to use some kind of environmental variable to control the
parallel build.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
diff --git a/Makefile b/Makefile
index 3374687..15f099e 100644
--- a/Makefile
+++ b/Makefile
@@ -33,12 +33,10 @@ REVISION= $(shell if [ -d .git ]; then \
echo $$(git describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \
fi)
-NUM_CPUS = $(shell nproc 2> /dev/null || echo 1)
-
include $(PWD)/Makefile.kbuild
all:
- $(MAKE) -C $(KERNELPATH) REVISION=$(REVISION) M=$(PWD) PWD=$(PWD) -j $(NUM_CPUS) modules
+ $(MAKE) -C $(KERNELPATH) REVISION=$(REVISION) M=$(PWD) PWD=$(PWD) modules
clean:
$(MAKE) -C $(KERNELPATH) M=$(PWD) PWD=$(PWD) clean
--
batman-adv