modpost: add option to allow external modules to avoid taint

Make integrated compat-wireless take advantage of the above
Turn-on backports again, since TAINT_OOT_MODULE issue is resolved
Update compat-wireless snapshot from 2011-12-18
This commit is contained in:
John W. Linville 2011-12-19 16:32:30 -05:00
parent 92505b0d0f
commit 217da4eb7b
7 changed files with 131 additions and 117 deletions

View File

@ -1,90 +0,0 @@
From linux-wireless-owner@vger.kernel.org Sat Dec 3 09:49:42 2011
From: Hauke Mehrtens <hauke@hauke-m.de>
To: mcgrof@gmail.com, mcgrof@qca.qualcomm.com
Cc: linux-wireless@vger.kernel.org, Hauke Mehrtens <hauke@hauke-m.de>
Subject: [PATCH 2/2] compat: add module_usb_driver and module_platform_driver
Date: Sat, 3 Dec 2011 15:49:26 +0100
Message-Id: <1322923766-14379-2-git-send-email-hauke@hauke-m.de>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
include/linux/compat-3.2.h | 9 +++++++++
include/linux/compat-3.3.h | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/include/linux/compat-3.2.h b/include/linux/compat-3.2.h
index db0f648..fb9ef68 100644
--- a/include/linux/compat-3.2.h
+++ b/include/linux/compat-3.2.h
@@ -55,6 +55,15 @@ static inline char *hex_byte_pack(char *buf, u8 byte)
return buf;
}
+/* module_platform_driver() - Helper macro for drivers that don't do
+ * anything special in module init/exit. This eliminates a lot of
+ * boilerplate. Each module may only use this macro once, and
+ * calling it replaces module_init() and module_exit()
+ */
+#define module_platform_driver(__platform_driver) \
+ module_driver(__platform_driver, platform_driver_register, \
+ platform_driver_unregister)
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) */
#endif /* LINUX_3_2_COMPAT_H */
diff --git a/include/linux/compat-3.3.h b/include/linux/compat-3.3.h
index 9383a6e..821333c 100644
--- a/include/linux/compat-3.3.h
+++ b/include/linux/compat-3.3.h
@@ -33,6 +33,41 @@ static inline void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
typedef u32 netdev_features_t;
+/* source include/linux/device.h */
+/**
+ * module_driver() - Helper macro for drivers that don't do anything
+ * special in module init/exit. This eliminates a lot of boilerplate.
+ * Each module may only use this macro once, and calling it replaces
+ * module_init() and module_exit().
+ *
+ * Use this macro to construct bus specific macros for registering
+ * drivers, and do not use it on its own.
+ */
+#define module_driver(__driver, __register, __unregister) \
+static int __init __driver##_init(void) \
+{ \
+ return __register(&(__driver)); \
+} \
+module_init(__driver##_init); \
+static void __exit __driver##_exit(void) \
+{ \
+ __unregister(&(__driver)); \
+} \
+module_exit(__driver##_exit);
+
+/* source include/linux/usb.h */
+/**
+ * module_usb_driver() - Helper macro for registering a USB driver
+ * @__usb_driver: usb_driver struct
+ *
+ * Helper macro for USB drivers which do not do anything special in module
+ * init/exit. This eliminates a lot of boilerplate. Each module may only
+ * use this macro once, and calling it replaces module_init() and module_exit()
+ */
+#define module_usb_driver(__usb_driver) \
+ module_driver(__usb_driver, usb_register, \
+ usb_deregister)
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */
#endif /* LINUX_3_3_COMPAT_H */
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

View File

@ -1,6 +1,6 @@
diff -up compat-wireless-3.2-rc1-1/config.mk.orig compat-wireless-3.2-rc1-1/config.mk
--- compat-wireless-3.2-rc1-1/config.mk.orig 2011-11-22 13:09:50.422879313 -0500
+++ compat-wireless-3.2-rc1-1/config.mk 2011-11-22 13:10:28.870398679 -0500
diff -up compat-wireless-2011-12-18/config.mk.orig compat-wireless-2011-12-18/config.mk
--- compat-wireless-2011-12-18/config.mk.orig 2011-12-18 16:10:34.000000000 -0500
+++ compat-wireless-2011-12-18/config.mk 2011-12-19 15:54:24.962156028 -0500
@@ -14,6 +14,9 @@ else
include $(KLIB_BUILD)/.config
endif
@ -10,18 +10,16 @@ diff -up compat-wireless-3.2-rc1-1/config.mk.orig compat-wireless-3.2-rc1-1/conf
+
ifneq ($(wildcard $(KLIB_BUILD)/Makefile),)
COMPAT_LATEST_VERSION = 1
diff -up compat-wireless-3.2-rc1-1/drivers/misc/eeprom/Makefile.orig compat-wireless-3.2-rc1-1/drivers/misc/eeprom/Makefile
--- compat-wireless-3.2-rc1-1/drivers/misc/eeprom/Makefile.orig 2011-11-22 13:09:50.423879301 -0500
+++ compat-wireless-3.2-rc1-1/drivers/misc/eeprom/Makefile 2011-11-22 13:10:28.871398662 -0500
@@ -1,3 +1,3 @@
COMPAT_LATEST_VERSION = 3
diff -up compat-wireless-2011-12-18/drivers/misc/eeprom/Makefile.orig compat-wireless-2011-12-18/drivers/misc/eeprom/Makefile
--- compat-wireless-2011-12-18/drivers/misc/eeprom/Makefile.orig 2011-12-18 16:10:36.000000000 -0500
+++ compat-wireless-2011-12-18/drivers/misc/eeprom/Makefile 2011-12-19 15:54:24.963156015 -0500
@@ -1 +1 @@
-obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
+#obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
obj-$(CONFIG_EEPROM_93XX46) += eeprom_93xx46.o
obj-$(CONFIG_EEPROM_DIGSY_MTC_CFG) += digsy_mtc_eeprom.o
diff -up compat-wireless-3.2-rc1-1/drivers/net/ethernet/atheros/Makefile.orig compat-wireless-3.2-rc1-1/drivers/net/ethernet/atheros/Makefile
--- compat-wireless-3.2-rc1-1/drivers/net/ethernet/atheros/Makefile.orig 2011-11-22 13:09:50.423879301 -0500
+++ compat-wireless-3.2-rc1-1/drivers/net/ethernet/atheros/Makefile 2011-11-22 13:10:28.871398662 -0500
diff -up compat-wireless-2011-12-18/drivers/net/ethernet/atheros/Makefile.orig compat-wireless-2011-12-18/drivers/net/ethernet/atheros/Makefile
--- compat-wireless-2011-12-18/drivers/net/ethernet/atheros/Makefile.orig 2011-12-18 16:10:35.000000000 -0500
+++ compat-wireless-2011-12-18/drivers/net/ethernet/atheros/Makefile 2011-12-19 15:54:24.963156015 -0500
@@ -2,7 +2,7 @@
# Makefile for the Atheros network device drivers.
#
@ -34,9 +32,9 @@ diff -up compat-wireless-3.2-rc1-1/drivers/net/ethernet/atheros/Makefile.orig co
+#obj-$(CONFIG_ATL2) += atlx/
+#obj-$(CONFIG_ATL1E) += atl1e/
+#obj-$(CONFIG_ATL1C) += atl1c/
diff -up compat-wireless-3.2-rc1-1/drivers/net/usb/Makefile.orig compat-wireless-3.2-rc1-1/drivers/net/usb/Makefile
--- compat-wireless-3.2-rc1-1/drivers/net/usb/Makefile.orig 2011-11-22 13:09:50.424879289 -0500
+++ compat-wireless-3.2-rc1-1/drivers/net/usb/Makefile 2011-11-22 13:10:28.872398646 -0500
diff -up compat-wireless-2011-12-18/drivers/net/usb/Makefile.orig compat-wireless-2011-12-18/drivers/net/usb/Makefile
--- compat-wireless-2011-12-18/drivers/net/usb/Makefile.orig 2011-12-18 16:10:36.000000000 -0500
+++ compat-wireless-2011-12-18/drivers/net/usb/Makefile 2011-12-19 15:54:24.964156002 -0500
@@ -2,7 +2,7 @@
# Makefile for USB Network drivers
#
@ -48,9 +46,9 @@ diff -up compat-wireless-3.2-rc1-1/drivers/net/usb/Makefile.orig compat-wireless
+#obj-$(CONFIG_USB_NET_COMPAT_RNDIS_HOST) += rndis_host.o
+#obj-$(CONFIG_USB_COMPAT_USBNET) += usbnet.o
diff -up compat-wireless-3.2-rc1-1/Makefile.orig compat-wireless-3.2-rc1-1/Makefile
--- compat-wireless-3.2-rc1-1/Makefile.orig 2011-11-22 13:10:37.165294951 -0500
+++ compat-wireless-3.2-rc1-1/Makefile 2011-11-22 13:10:47.335167758 -0500
diff -up compat-wireless-2011-12-18/Makefile.orig compat-wireless-2011-12-18/Makefile
--- compat-wireless-2011-12-18/Makefile.orig 2011-12-18 16:10:34.000000000 -0500
+++ compat-wireless-2011-12-18/Makefile 2011-12-19 15:54:24.965155989 -0500
@@ -41,8 +41,8 @@ endif
endif

View File

@ -0,0 +1,12 @@
diff -up compat-wireless-2011-12-01/Makefile.orig compat-wireless-2011-12-01/Makefile
--- compat-wireless-2011-12-01/Makefile.orig 2011-12-14 09:10:01.377297637 -0500
+++ compat-wireless-2011-12-01/Makefile 2011-12-14 09:47:36.834100534 -0500
@@ -68,7 +68,7 @@ all: modules
modules: $(CREL_CHECK)
@./scripts/check_config.sh
- $(MAKE) -C $(KLIB_BUILD) M=$(PWD) modules
+ $(MAKE) -C $(KLIB_BUILD) M=$(PWD) INTEGRATED_BUILD=1 modules
@touch $@
bt: $(CREL_CHECK)

View File

@ -11,6 +11,11 @@
# CONFIG_SSB is not set
# CONFIG_B44 is not set
#
# Prevent b43 and brcmsmac from competing
#
# CONFIG_B43_BCMA is not set
#
# These have to be turned-on again since compat-wireless does not
# provide them...

View File

@ -147,7 +147,7 @@ Summary: The Linux kernel
%define with_release %{?_with_release: 1} %{?!_with_release: 0}
# Include driver backports (e.g. compat-wireless) in the kernel build.
%define with_backports %{?_with_backports: 1} %{?!_with_backports: 0}
%define with_backports %{?_without_backports: 0} %{?!_without_backports: 1}
# Set debugbuildsenabled to 1 for production (build separate debug kernels)
# and 0 for rawhide (all kernels are debug kernels).
@ -202,7 +202,7 @@ Summary: The Linux kernel
%define kversion 3.%{base_sublevel}
# The compat-wireless version
%define cwversion 2011-12-01
%define cwversion 2011-12-18
#######################################################################
# If cwversion is less than kversion, make sure with_backports is
@ -665,6 +665,7 @@ Patch471: floppy-Remove-_hlt-related-functions.patch
Patch510: linux-2.6-silence-noise.patch
Patch520: quite-apm.patch
Patch530: linux-2.6-silence-fbcon-logo.patch
Patch540: modpost-add-option-to-allow-external-modules-to-avoi.patch
Patch700: linux-2.6-e1000-ich9-montevina.patch
@ -737,7 +738,7 @@ Patch21045: nfs-client-freezer.patch
# compat-wireless patches
Patch50000: compat-wireless-config-fixups.patch
Patch50001: compat-add-module_usb_driver-and-module_platform_driver.patch
Patch50001: compat-wireless-integrated-build.patch
%endif
@ -1345,6 +1346,11 @@ ApplyPatch linux-2.6-silence-noise.patch
# Make fbcon not show the penguins with 'quiet'
ApplyPatch linux-2.6-silence-fbcon-logo.patch
%if %{with_backports}
# modpost: add option to allow external modules to avoid taint
ApplyPatch modpost-add-option-to-allow-external-modules-to-avoi.patch
%endif
# Changes to upstream defaults.
@ -1485,10 +1491,7 @@ rm -rf compat-wireless-%{cwversion}
cd compat-wireless-%{cwversion}
ApplyPatch compat-wireless-config-fixups.patch
ApplyPatch compat-add-module_usb_driver-and-module_platform_driver.patch
# Remove overlap between bcma/b43 and brcmsmac and reenable bcm4331
ApplyPatch bcma-brcmsmac-compat.patch
ApplyPatch compat-wireless-integrated-build.patch
cd ..
@ -2230,6 +2233,12 @@ fi
# ||----w |
# || ||
%changelog
* Wed Dec 19 2011 John W. Linville <linville@redhat.com>
- modpost: add option to allow external modules to avoid taint
- Make integrated compat-wireless take advantage of the above
- Turn-on backports again, since TAINT_OOT_MODULE issue is resolved
- Update compat-wireless snapshot from 2011-12-18
* Mon Dec 19 2011 Dave Jones <davej@redhat.com>
- Switch x86-code-dump-fix-truncation.patch to use the pending upstream fix.

View File

@ -0,0 +1,80 @@
From 69f63a67165da5e9f08c1132521598701d914573 Mon Sep 17 00:00:00 2001
From: John W. Linville <linville@tuxdriver.com>
Date: Wed, 14 Dec 2011 11:09:04 -0500
Subject: [PATCH] modpost: add option to allow external modules to avoid taint
In some cases, it might be desirable to package a module from an
external source tree alongside the base kernel. In those cases, it
might also be desirable to not have those modules tainting the kernel.
This patch provides a mechanism for an external module build to declare
itself as an "integrated build". Such a module is then treated the same
as an intree module.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
Any thoughts on this? I'm thinking of adding this to Fedora kernels,
where I have been working to integrate the compat-wireless package as
part of the base kernel RPM.
scripts/Makefile.modpost | 1 +
scripts/mod/modpost.c | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 08dce14..160c6fb 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -81,6 +81,7 @@ modpost = scripts/mod/modpost \
$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
$(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \
$(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \
+ $(if $(INTEGRATED_BUILD),-B) \
$(if $(cross_build),-c)
quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 2bd594e..5d077f9 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -43,6 +43,9 @@ static int warn_unresolved = 0;
static int sec_mismatch_count = 0;
static int sec_mismatch_verbose = 1;
+/* Is this a module being built as part of an integrated package? */
+static int integrated_build = 0;
+
enum export {
export_plain, export_unused, export_gpl,
export_unused_gpl, export_gpl_future, export_unknown
@@ -1851,7 +1854,7 @@ static void add_header(struct buffer *b, struct module *mod)
static void add_intree_flag(struct buffer *b, int is_intree)
{
- if (is_intree)
+ if (is_intree || integrated_build)
buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n");
}
@@ -2101,7 +2104,7 @@ int main(int argc, char **argv)
struct ext_sym_list *extsym_iter;
struct ext_sym_list *extsym_start = NULL;
- while ((opt = getopt(argc, argv, "i:I:e:cmsSo:awM:K:")) != -1) {
+ while ((opt = getopt(argc, argv, "i:I:e:cmsSo:awM:K:B")) != -1) {
switch (opt) {
case 'i':
kernel_read = optarg;
@@ -2139,6 +2142,9 @@ int main(int argc, char **argv)
case 'w':
warn_unresolved = 1;
break;
+ case 'B':
+ integrated_build = 1;
+ break;
default:
exit(1);
}
--
1.7.4.4

View File

@ -1,4 +1,4 @@
8d43453f8159b2332ad410b19d86a931 linux-3.1.tar.bz2
020a0ea456f0f061bf8d7c52c3670421 patch-3.2-rc6.xz
5360f273d6b9e930675bf48f9aad33f7 compat-wireless-2011-12-01.tar.bz2
aa87e7d3593118a2680c8eda45c88e0d patch-3.2-rc6-git1.xz
b5f0924b0547918ca1e1685811554315 compat-wireless-2011-12-18.tar.bz2