Skip to contentSkip to conversation

Add config-compat.h override config-mycompat.h

PATCH New Brad Love 1 participant 1 message May 11, 2018 Media (V4L/DVB)

lore
Share & tools
lore

Brad Love

author
#0 lore raw

PATCH v2 1/1 Add config-compat.h override config-mycompat.h

config-mycompat.h is for use with kernels/distros whose maintainers have integrated various backports, which the media_build system does not detect for whatever reason. At that point there are options defined in config-compat.h, which enable backports in compat.h, but which already exist in the target kernel. This allows disabling of specific backports for a particular build, allowing compliation to succeed.

For example, if the following three statements exist in config-mycompat.h:

#undef NEED_WRITEL_RELAXED
#undef NEED_PM_RUNTIME_GET
#undef NEED_PFN_TO_PHYS

Those three media_build backports will be disabled in compat.h and compilation on a problematic kernel will succeed without issue. conifg-mycompat.h should be used strictly for disabling media_build backports causing compilation issues. The file will usually be left empty, unless needed.

WARNING:
v4l/config-mycompat.h is removed by distclean, the file should be saved externally and copied into v4l/ when required.

---
Since v1:
- Make the description and explanation of config-mycompat.h purpose and usage as explicit as possible for clarity sake.

 v4l/Makefile |  3 ++-
 v4l/compat.h | 23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
v4l/Makefile +2 -1
index 270a624..385fa83 100644
@@ -273,6 +273,7 @@ links::
 	@find ../linux/drivers/misc -name '*.[ch]' -type f -print0 | xargs -0n 255 ln -sf --target-directory=.
 
 config-compat.h:: $(obj)/.version .myconfig scripts/make_config_compat.pl
+	-touch $(obj)/config-mycompat.h
 	perl scripts/make_config_compat.pl $(SRCDIR) $(obj)/.myconfig $(obj)/config-compat.h
 
 kernel-links makelinks::
@@ -298,7 +299,7 @@ clean::
 distclean:: clean
 	-rm -f .version .*.o.flags .*.o.d *.mod.gcno Makefile.media \
 		Kconfig Kconfig.kern .config .config.cmd .myconfig \
-		.kconfig.dep
+		.kconfig.dep config-mycompat.h
 	-rm -rf .tmp_versions .tmp*.ver .tmp*.o .*.gcno .cache.mk
 	-rm -f scripts/lxdialog scripts/kconfig
 	@find .. -name '*.orig' -exec rm '{}' \;
v4l/compat.h +23 -0
index b93750f..34b7f3a 100644
@@ -8,6 +8,29 @@
 #include <linux/version.h>
 
 #include "config-compat.h"
+/*
+ * config-mycompat.h is for use with kernels/distros whose maintainers
+ * have integrated various backports, which the media_build system does
+ * not pick up on for whatever reason. At that point there are options
+ * defined in config-compat.h, which enable backports here, in compat.h,
+ * but which already exist in the target kernel. This allows disabling of
+ * specific backports for a particular build, allowing compliation to succeed.
+
+ * For example, if the following three statements exist in config-mycompat.h:
+
+ * #undef NEED_WRITEL_RELAXED
+ * #undef NEED_PM_RUNTIME_GET
+ * #undef NEED_PFN_TO_PHYS
+
+ * Those three media_build backports will be disabled in this file and
+ * compilation on a problematic kernel will succeed without issue.
+ * conifg-mycompat.h should be used strictly for disabling media_build
+ * backports causing compilation issues. It will typically be left empty.
+ *
+ * WARNING: v4l/config-mycompat.h is removed by distclean, the file
+ * should be saved externally and copied into v4l/ when required.
+ */
+#include "config-mycompat.h"
 
 #ifndef SZ_512
 #define SZ_512				0x00000200
Signature · 1 line
2.7.4