Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software.--- Begin Message --- On 31/10/2019 10:00, 大雄 wrote: Hi, I think what you said is right. But, logic is not the same with openwrt 15.05 *From:* Felix Fietkau <mailto:n...@nbd.name> *Date:* 2019-10-31 17:50 *To:* 大雄 <mailto:lx...@ikuai8.com>; Hauke Mehrtens <mailto:ha...@hauke-m.de>; openwrt-devel <mailto:openwrt-devel@lists.openwrt.org> *Subject:* Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid On 2019-10-31 10:43, 大雄 wrote: > Hi, > > But sometimes, .ko not in menuconfig option. > It's in the kernel_menuconfig option. > So is no through ipk processing. In that case the solution is to add a package for it. - Felix openwrt 15.05 is very very very out of date! What happens in openwrt 15.05 is not relevant! We are getting ready to release OpenWrt 19.07 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel --- End Message --- ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
Hi, I think what you said is right. But, logic is not the same with openwrt 15.05 From: Felix Fietkau Date: 2019-10-31 17:50 To: 大雄; Hauke Mehrtens; openwrt-devel Subject: Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid On 2019-10-31 10:43, 大雄 wrote: > Hi, > > But sometimes, .ko not in menuconfig option. > It's in the kernel_menuconfig option. > So is no through ipk processing. In that case the solution is to add a package for it. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
On 2019-10-31 10:43, 大雄 wrote: > Hi, > > But sometimes, .ko not in menuconfig option. > It's in the kernel_menuconfig option. > So is no through ipk processing. In that case the solution is to add a package for it. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
Hi, But sometimes, .ko not in menuconfig option. It's in the kernel_menuconfig option. So is no through ipk processing. There is no such problem in OpenWRT 15.05 From: Felix Fietkau Date: 2019-10-31 17:24 To: 大雄; Hauke Mehrtens; openwrt-devel Subject: Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid On 2019-10-31 09:19, 大雄 wrote: > Hi, > > I compile the kernel options, without any special open the DEBUG > options. > But the compiled KO module size is very big. debug symbols are enabled by default. The .ko in the kernel tree is quite big, but the one that ends up in the .ipk or on the root filesystem should be small. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
On 2019-10-31 09:19, 大雄 wrote: > Hi, > > I compile the kernel options, without any special open the DEBUG > options. > But the compiled KO module size is very big. debug symbols are enabled by default. The .ko in the kernel tree is quite big, but the one that ends up in the .ipk or on the root filesystem should be small. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
Hi, I compile the kernel options, without any special open the DEBUG options. But the compiled KO module size is very big. From: Felix Fietkau Date: 2019-10-31 15:31 To: 大雄; Hauke Mehrtens; openwrt-devel Subject: Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid Hi, I don't think this patch is correct. The purpose of the existing 204-module_strip.patch is completely different from the stripping behavior that you introduce, and you haven't described what issues you have with the existing code. Also, running strip inside the kernel build system is a bad idea, because the build system already strips all kernel modules when packaging. The .ko files inside the kernel tree should still contain debug symbols, because that is needed for debugging. - Felix On 2019-10-31 02:46, 大雄 wrote: > Build file drivers/net/ethernet/intel/e1000e/e1000e.ko size about 920KB > for old PATCH. > After the new patch is about 177KB > > *From:* Hauke Mehrtens <mailto:ha...@hauke-m.de> > *Date:* 2019-10-30 23:47 > *To:* daxiong <mailto:lx...@ikuai8.com>; openwrt-devel > <mailto:openwrt-devel@lists.openwrt.org> > *Subject:* Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip > invalid > On 10/30/19 11:14 AM, daxiong wrote: > > Current modpost cannot reduce the module size. > > > > Use $(STRIP) command to replace the modpost patch, > > I think to be compatibility will be better. > > > > Signed-off-by: daxiong > > Please base this against master, then we can backport it to 19.07. > > Could you please elaborate a little bit more how module-strip provides > better results than the previous patch? It would be nice if you could > also provide some numbers to compare the previous size and the > current size. > > Would it make sense to do both together, what was done in this patch > before and after your change? > > Hauke > > > --- > > .../linux/generic/hack-4.14/204-module_strip.patch | 216 > +++-- > > 1 file changed, 24 insertions(+), 192 deletions(-) > > > > diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch > b/target/linux/generic/hack-4.14/204-module_strip.patch > > index d847adf..c22a507 100644 > > --- a/target/linux/generic/hack-4.14/204-module_strip.patch > > +++ b/target/linux/generic/hack-4.14/204-module_strip.patch > > @@ -1,104 +1,8 @@ > > -From a779a482fb9b9f8fcdf8b2519c789b4b9bb5dd05 Mon Sep 17 00:00:00 > 2001 > > -From: Felix Fietkau > > -Date: Fri, 7 Jul 2017 16:56:48 +0200 > > -Subject: build: add a hack for removing non-essential module info > > - > > -Signed-off-by: Felix Fietkau > > > > - include/linux/module.h | 13 - > > - include/linux/moduleparam.h | 15 --- > > - init/Kconfig| 7 +++ > > - kernel/module.c | 5 - > > - scripts/mod/modpost.c | 12 > > - 5 files changed, 43 insertions(+), 9 deletions(-) > > - > > a/include/linux/module.h > > -+++ b/include/linux/module.h > > -@@ -158,6 +158,7 @@ extern void cleanup_module(void); > > - > > - /* Generic info of form tag = "info" */ > > - #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) > > -+#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, > tag, info) > > - > > - /* For userspace: you can also call me... */ > > - #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) > > -@@ -201,12 +202,12 @@ extern void cleanup_module(void); > > - * Author(s), use "Name " or just "Name", for multiple > > - * authors use multiple MODULE_AUTHOR() statements/lines. > > - */ > > --#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) > > -+#define MODULE_AUTHOR(_author) MODULE_INFO_STRIP(author, _author) > > - > > - /* What your module does. */ > > --#define MODULE_DESCRIPTION(_description) > MODULE_INFO(description, _description) > > -+#define MODULE_DESCRIPTION(_description) > MODULE_INFO_STRIP(description, _description) > > - > > --#ifdef MODULE > > -+#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) > > - /* Creates an alias so file2alias.c can find device table. */ > > - #define MODULE_DEVICE_TABLE(type, name) \ > > - extern typeof(name) __mod_##type##__##name##_device_tab
Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
Hi, I don't think this patch is correct. The purpose of the existing 204-module_strip.patch is completely different from the stripping behavior that you introduce, and you haven't described what issues you have with the existing code. Also, running strip inside the kernel build system is a bad idea, because the build system already strips all kernel modules when packaging. The .ko files inside the kernel tree should still contain debug symbols, because that is needed for debugging. - Felix On 2019-10-31 02:46, 大雄 wrote: > Build file drivers/net/ethernet/intel/e1000e/e1000e.ko size about 920KB > for old PATCH. > After the new patch is about 177KB > > *From:* Hauke Mehrtens <mailto:ha...@hauke-m.de> > *Date:* 2019-10-30 23:47 > *To:* daxiong <mailto:lx...@ikuai8.com>; openwrt-devel > <mailto:openwrt-devel@lists.openwrt.org> > *Subject:* Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip > invalid > On 10/30/19 11:14 AM, daxiong wrote: > > Current modpost cannot reduce the module size. > > > > Use $(STRIP) command to replace the modpost patch, > > I think to be compatibility will be better. > > > > Signed-off-by: daxiong > > Please base this against master, then we can backport it to 19.07. > > Could you please elaborate a little bit more how module-strip provides > better results than the previous patch? It would be nice if you could > also provide some numbers to compare the previous size and the > current size. > > Would it make sense to do both together, what was done in this patch > before and after your change? > > Hauke > > > --- > > .../linux/generic/hack-4.14/204-module_strip.patch | 216 > +++-- > > 1 file changed, 24 insertions(+), 192 deletions(-) > > > > diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch > b/target/linux/generic/hack-4.14/204-module_strip.patch > > index d847adf..c22a507 100644 > > --- a/target/linux/generic/hack-4.14/204-module_strip.patch > > +++ b/target/linux/generic/hack-4.14/204-module_strip.patch > > @@ -1,104 +1,8 @@ > > -From a779a482fb9b9f8fcdf8b2519c789b4b9bb5dd05 Mon Sep 17 00:00:00 > 2001 > > -From: Felix Fietkau > > -Date: Fri, 7 Jul 2017 16:56:48 +0200 > > -Subject: build: add a hack for removing non-essential module info > > - > > -Signed-off-by: Felix Fietkau > > > > - include/linux/module.h | 13 - > > - include/linux/moduleparam.h | 15 --- > > - init/Kconfig | 7 +++ > > - kernel/module.c | 5 - > > - scripts/mod/modpost.c | 12 > > - 5 files changed, 43 insertions(+), 9 deletions(-) > > - > > a/include/linux/module.h > > -+++ b/include/linux/module.h > > -@@ -158,6 +158,7 @@ extern void cleanup_module(void); > > - > > - /* Generic info of form tag = "info" */ > > - #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) > > -+#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, > tag, info) > > - > > - /* For userspace: you can also call me... */ > > - #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) > > -@@ -201,12 +202,12 @@ extern void cleanup_module(void); > > - * Author(s), use "Name " or just "Name", for multiple > > - * authors use multiple MODULE_AUTHOR() statements/lines. > > - */ > > --#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) > > -+#define MODULE_AUTHOR(_author) MODULE_INFO_STRIP(author, _author) > > - > > - /* What your module does. */ > > --#define MODULE_DESCRIPTION(_description) > MODULE_INFO(description, _description) > > -+#define MODULE_DESCRIPTION(_description) > MODULE_INFO_STRIP(description, _description) > > - > > --#ifdef MODULE > > -+#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) > > - /* Creates an alias so file2alias.c can find device table. */ > > - #define MODULE_DEVICE_TABLE(type, name) \ > > - extern typeof(name) __mod_##type##__##name##_device_table \ > > -@@ -233,7 +234,9 @@ extern typeof(name) __mod_##type##__##na > > - */ > > - > > - #if defined(MODULE) || !defined(CONFIG_SYSFS) > > --#define MODULE_VERSION(_version) MODULE_INFO(version, _version) > > -+#define MODULE
Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
Build file drivers/net/ethernet/intel/e1000e/e1000e.ko size about 920KB for old PATCH. After the new patch is about 177KB From: Hauke Mehrtens Date: 2019-10-30 23:47 To: daxiong; openwrt-devel Subject: Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid On 10/30/19 11:14 AM, daxiong wrote: > Current modpost cannot reduce the module size. > > Use $(STRIP) command to replace the modpost patch, > I think to be compatibility will be better. > > Signed-off-by: daxiong Please base this against master, then we can backport it to 19.07. Could you please elaborate a little bit more how module-strip provides better results than the previous patch? It would be nice if you could also provide some numbers to compare the previous size and the current size. Would it make sense to do both together, what was done in this patch before and after your change? Hauke > --- > .../linux/generic/hack-4.14/204-module_strip.patch | 216 > +++-- > 1 file changed, 24 insertions(+), 192 deletions(-) > > diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch > b/target/linux/generic/hack-4.14/204-module_strip.patch > index d847adf..c22a507 100644 > --- a/target/linux/generic/hack-4.14/204-module_strip.patch > +++ b/target/linux/generic/hack-4.14/204-module_strip.patch > @@ -1,104 +1,8 @@ > -From a779a482fb9b9f8fcdf8b2519c789b4b9bb5dd05 Mon Sep 17 00:00:00 2001 > -From: Felix Fietkau > -Date: Fri, 7 Jul 2017 16:56:48 +0200 > -Subject: build: add a hack for removing non-essential module info > - > -Signed-off-by: Felix Fietkau > > - include/linux/module.h | 13 - > - include/linux/moduleparam.h | 15 --- > - init/Kconfig| 7 +++ > - kernel/module.c | 5 - > - scripts/mod/modpost.c | 12 > - 5 files changed, 43 insertions(+), 9 deletions(-) > - > a/include/linux/module.h > -+++ b/include/linux/module.h > -@@ -158,6 +158,7 @@ extern void cleanup_module(void); > - > - /* Generic info of form tag = "info" */ > - #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) > -+#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, tag, info) > - > - /* For userspace: you can also call me... */ > - #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) > -@@ -201,12 +202,12 @@ extern void cleanup_module(void); > - * Author(s), use "Name " or just "Name", for multiple > - * authors use multiple MODULE_AUTHOR() statements/lines. > - */ > --#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) > -+#define MODULE_AUTHOR(_author) MODULE_INFO_STRIP(author, _author) > - > - /* What your module does. */ > --#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, > _description) > -+#define MODULE_DESCRIPTION(_description) MODULE_INFO_STRIP(description, > _description) > - > --#ifdef MODULE > -+#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) > - /* Creates an alias so file2alias.c can find device table. */ > - #define MODULE_DEVICE_TABLE(type, name) \ > - extern typeof(name) __mod_##type##__##name##_device_table \ > -@@ -233,7 +234,9 @@ extern typeof(name) __mod_##type##__##na > - */ > - > - #if defined(MODULE) || !defined(CONFIG_SYSFS) > --#define MODULE_VERSION(_version) MODULE_INFO(version, _version) > -+#define MODULE_VERSION(_version) MODULE_INFO_STRIP(version, _version) > -+#elif defined(CONFIG_MODULE_STRIPPED) > -+#define MODULE_VERSION(_version) __MODULE_INFO_DISABLED(version) > - #else > - #define MODULE_VERSION(_version) \ > - static struct module_version_attribute ___modver_attr = { \ > -@@ -255,7 +258,7 @@ extern typeof(name) __mod_##type##__##na > - /* Optional firmware file (or files) needed by the module > - * format is simply firmware file name. Multiple firmware > - * files require multiple MODULE_FIRMWARE() specifiers */ > --#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) > -+#define MODULE_FIRMWARE(_firmware) MODULE_INFO_STRIP(firmware, _firmware) > - > - struct notifier_block; > - > a/include/linux/moduleparam.h > -+++ b/include/linux/moduleparam.h > -@@ -17,6 +17,16 @@ > - /* Chosen so that structs with an unsigned long line up. */ > - #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) > - > -+/* This struct is here for syntactic coherency, it is not used */ > -+#define __MODULE_INFO_DISABLED(name) \ > -+ struct __UNIQUE_ID(name) {} > -+ > -+#ifdef CONFIG_MODULE_STRIPPED > -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO_DISABLED(name) > -+#else > -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO(tag, name, info) > -+#endif > -+ > - #ifdef MOD
Re: [OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
On 10/30/19 11:14 AM, daxiong wrote: > Current modpost cannot reduce the module size. > > Use $(STRIP) command to replace the modpost patch, > I think to be compatibility will be better. > > Signed-off-by: daxiong Please base this against master, then we can backport it to 19.07. Could you please elaborate a little bit more how module-strip provides better results than the previous patch? It would be nice if you could also provide some numbers to compare the previous size and the current size. Would it make sense to do both together, what was done in this patch before and after your change? Hauke > --- > .../linux/generic/hack-4.14/204-module_strip.patch | 216 > +++-- > 1 file changed, 24 insertions(+), 192 deletions(-) > > diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch > b/target/linux/generic/hack-4.14/204-module_strip.patch > index d847adf..c22a507 100644 > --- a/target/linux/generic/hack-4.14/204-module_strip.patch > +++ b/target/linux/generic/hack-4.14/204-module_strip.patch > @@ -1,104 +1,8 @@ > -From a779a482fb9b9f8fcdf8b2519c789b4b9bb5dd05 Mon Sep 17 00:00:00 2001 > -From: Felix Fietkau > -Date: Fri, 7 Jul 2017 16:56:48 +0200 > -Subject: build: add a hack for removing non-essential module info > - > -Signed-off-by: Felix Fietkau > > - include/linux/module.h | 13 - > - include/linux/moduleparam.h | 15 --- > - init/Kconfig| 7 +++ > - kernel/module.c | 5 - > - scripts/mod/modpost.c | 12 > - 5 files changed, 43 insertions(+), 9 deletions(-) > - > a/include/linux/module.h > -+++ b/include/linux/module.h > -@@ -158,6 +158,7 @@ extern void cleanup_module(void); > - > - /* Generic info of form tag = "info" */ > - #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) > -+#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, tag, info) > - > - /* For userspace: you can also call me... */ > - #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) > -@@ -201,12 +202,12 @@ extern void cleanup_module(void); > - * Author(s), use "Name " or just "Name", for multiple > - * authors use multiple MODULE_AUTHOR() statements/lines. > - */ > --#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) > -+#define MODULE_AUTHOR(_author) MODULE_INFO_STRIP(author, _author) > - > - /* What your module does. */ > --#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, > _description) > -+#define MODULE_DESCRIPTION(_description) MODULE_INFO_STRIP(description, > _description) > - > --#ifdef MODULE > -+#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) > - /* Creates an alias so file2alias.c can find device table. */ > - #define MODULE_DEVICE_TABLE(type, name) > \ > - extern typeof(name) __mod_##type##__##name##_device_table \ > -@@ -233,7 +234,9 @@ extern typeof(name) __mod_##type##__##na > - */ > - > - #if defined(MODULE) || !defined(CONFIG_SYSFS) > --#define MODULE_VERSION(_version) MODULE_INFO(version, _version) > -+#define MODULE_VERSION(_version) MODULE_INFO_STRIP(version, _version) > -+#elif defined(CONFIG_MODULE_STRIPPED) > -+#define MODULE_VERSION(_version) __MODULE_INFO_DISABLED(version) > - #else > - #define MODULE_VERSION(_version)\ > - static struct module_version_attribute ___modver_attr = { \ > -@@ -255,7 +258,7 @@ extern typeof(name) __mod_##type##__##na > - /* Optional firmware file (or files) needed by the module > - * format is simply firmware file name. Multiple firmware > - * files require multiple MODULE_FIRMWARE() specifiers */ > --#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) > -+#define MODULE_FIRMWARE(_firmware) MODULE_INFO_STRIP(firmware, _firmware) > - > - struct notifier_block; > - > a/include/linux/moduleparam.h > -+++ b/include/linux/moduleparam.h > -@@ -17,6 +17,16 @@ > - /* Chosen so that structs with an unsigned long line up. */ > - #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) > - > -+/* This struct is here for syntactic coherency, it is not used */ > -+#define __MODULE_INFO_DISABLED(name) > \ > -+ struct __UNIQUE_ID(name) {} > -+ > -+#ifdef CONFIG_MODULE_STRIPPED > -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO_DISABLED(name) > -+#else > -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO(tag, name, info) > -+#endif > -+ > - #ifdef MODULE > - #define __MODULE_INFO(tag, name, info) > \ > - static const char __UNIQUE_ID(name)[] > \ > -@@ -24,8 +34,7 @@ static const char __UNIQUE_ID(name)[] > - = __stringify(tag) "=" info > - #else /* !MODULE */ > - /* This struct is here for syntactic coherency, it is not used */ > --#define __MODULE_INFO(tag, name, info) > \ > -- struct __UNIQUE_ID(n
[OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
Current modpost cannot reduce the module size. Use $(STRIP) command to replace the modpost patch, I think to be compatibility will be better. Signed-off-by: daxiong --- .../linux/generic/hack-4.14/204-module_strip.patch | 216 +++-- 1 file changed, 24 insertions(+), 192 deletions(-) diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch b/target/linux/generic/hack-4.14/204-module_strip.patch index d847adf..c22a507 100644 --- a/target/linux/generic/hack-4.14/204-module_strip.patch +++ b/target/linux/generic/hack-4.14/204-module_strip.patch @@ -1,104 +1,8 @@ -From a779a482fb9b9f8fcdf8b2519c789b4b9bb5dd05 Mon Sep 17 00:00:00 2001 -From: Felix Fietkau -Date: Fri, 7 Jul 2017 16:56:48 +0200 -Subject: build: add a hack for removing non-essential module info - -Signed-off-by: Felix Fietkau - include/linux/module.h | 13 - - include/linux/moduleparam.h | 15 --- - init/Kconfig| 7 +++ - kernel/module.c | 5 - - scripts/mod/modpost.c | 12 - 5 files changed, 43 insertions(+), 9 deletions(-) - a/include/linux/module.h -+++ b/include/linux/module.h -@@ -158,6 +158,7 @@ extern void cleanup_module(void); - - /* Generic info of form tag = "info" */ - #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) -+#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, tag, info) - - /* For userspace: you can also call me... */ - #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) -@@ -201,12 +202,12 @@ extern void cleanup_module(void); - * Author(s), use "Name " or just "Name", for multiple - * authors use multiple MODULE_AUTHOR() statements/lines. - */ --#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) -+#define MODULE_AUTHOR(_author) MODULE_INFO_STRIP(author, _author) - - /* What your module does. */ --#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) -+#define MODULE_DESCRIPTION(_description) MODULE_INFO_STRIP(description, _description) - --#ifdef MODULE -+#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) - /* Creates an alias so file2alias.c can find device table. */ - #define MODULE_DEVICE_TABLE(type, name) \ - extern typeof(name) __mod_##type##__##name##_device_table \ -@@ -233,7 +234,9 @@ extern typeof(name) __mod_##type##__##na - */ - - #if defined(MODULE) || !defined(CONFIG_SYSFS) --#define MODULE_VERSION(_version) MODULE_INFO(version, _version) -+#define MODULE_VERSION(_version) MODULE_INFO_STRIP(version, _version) -+#elif defined(CONFIG_MODULE_STRIPPED) -+#define MODULE_VERSION(_version) __MODULE_INFO_DISABLED(version) - #else - #define MODULE_VERSION(_version) \ - static struct module_version_attribute ___modver_attr = { \ -@@ -255,7 +258,7 @@ extern typeof(name) __mod_##type##__##na - /* Optional firmware file (or files) needed by the module - * format is simply firmware file name. Multiple firmware - * files require multiple MODULE_FIRMWARE() specifiers */ --#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) -+#define MODULE_FIRMWARE(_firmware) MODULE_INFO_STRIP(firmware, _firmware) - - struct notifier_block; - a/include/linux/moduleparam.h -+++ b/include/linux/moduleparam.h -@@ -17,6 +17,16 @@ - /* Chosen so that structs with an unsigned long line up. */ - #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) - -+/* This struct is here for syntactic coherency, it is not used */ -+#define __MODULE_INFO_DISABLED(name)\ -+ struct __UNIQUE_ID(name) {} -+ -+#ifdef CONFIG_MODULE_STRIPPED -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO_DISABLED(name) -+#else -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO(tag, name, info) -+#endif -+ - #ifdef MODULE - #define __MODULE_INFO(tag, name, info) \ - static const char __UNIQUE_ID(name)[] \ -@@ -24,8 +34,7 @@ static const char __UNIQUE_ID(name)[] - = __stringify(tag) "=" info - #else /* !MODULE */ - /* This struct is here for syntactic coherency, it is not used */ --#define __MODULE_INFO(tag, name, info) \ -- struct __UNIQUE_ID(name) {} -+#define __MODULE_INFO(tag, name, info) __MODULE_INFO_DISABLED(name) - #endif - #define __MODULE_PARM_TYPE(name, _type) \ - __MODULE_INFO(parmtype, name##type, #name ":" _type) -@@ -33,7 +42,7 @@ static const char __UNIQUE_ID(name)[] - /* One for each parameter, describing how to use it. Some files do -multiple of these per line, so can't just use MODULE_INFO. */ - #define MODULE_PARM_DESC(_parm, desc) \ -- __MODULE_INFO(parm, _parm, #_parm ":" desc) -+ __MODULE_INFO_STRIP(parm, _parm, #_parm ":" desc) - - struct kernel_param; - +diff --git a/init/Kconfig b/init/Kconfig +index
[OpenWrt-Devel] [PATCH-19.07] build: fix module strip invalid
Current modpost cannot reduce the module size. Use $(STRIP) command to replace the modpost patch, I think to be compatibility will be better. Signed-off-by: daxiong --- .../linux/generic/hack-4.14/204-module_strip.patch | 220 +++-- 1 file changed, 28 insertions(+), 192 deletions(-) diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch b/target/linux/generic/hack-4.14/204-module_strip.patch index d847adf..20ac949 100644 --- a/target/linux/generic/hack-4.14/204-module_strip.patch +++ b/target/linux/generic/hack-4.14/204-module_strip.patch @@ -1,104 +1,8 @@ -From a779a482fb9b9f8fcdf8b2519c789b4b9bb5dd05 Mon Sep 17 00:00:00 2001 -From: Felix Fietkau -Date: Fri, 7 Jul 2017 16:56:48 +0200 -Subject: build: add a hack for removing non-essential module info - -Signed-off-by: Felix Fietkau - include/linux/module.h | 13 - - include/linux/moduleparam.h | 15 --- - init/Kconfig| 7 +++ - kernel/module.c | 5 - - scripts/mod/modpost.c | 12 - 5 files changed, 43 insertions(+), 9 deletions(-) - a/include/linux/module.h -+++ b/include/linux/module.h -@@ -158,6 +158,7 @@ extern void cleanup_module(void); - - /* Generic info of form tag = "info" */ - #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) -+#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, tag, info) - - /* For userspace: you can also call me... */ - #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) -@@ -201,12 +202,12 @@ extern void cleanup_module(void); - * Author(s), use "Name " or just "Name", for multiple - * authors use multiple MODULE_AUTHOR() statements/lines. - */ --#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) -+#define MODULE_AUTHOR(_author) MODULE_INFO_STRIP(author, _author) - - /* What your module does. */ --#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) -+#define MODULE_DESCRIPTION(_description) MODULE_INFO_STRIP(description, _description) - --#ifdef MODULE -+#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) - /* Creates an alias so file2alias.c can find device table. */ - #define MODULE_DEVICE_TABLE(type, name) \ - extern typeof(name) __mod_##type##__##name##_device_table \ -@@ -233,7 +234,9 @@ extern typeof(name) __mod_##type##__##na - */ - - #if defined(MODULE) || !defined(CONFIG_SYSFS) --#define MODULE_VERSION(_version) MODULE_INFO(version, _version) -+#define MODULE_VERSION(_version) MODULE_INFO_STRIP(version, _version) -+#elif defined(CONFIG_MODULE_STRIPPED) -+#define MODULE_VERSION(_version) __MODULE_INFO_DISABLED(version) - #else - #define MODULE_VERSION(_version) \ - static struct module_version_attribute ___modver_attr = { \ -@@ -255,7 +258,7 @@ extern typeof(name) __mod_##type##__##na - /* Optional firmware file (or files) needed by the module - * format is simply firmware file name. Multiple firmware - * files require multiple MODULE_FIRMWARE() specifiers */ --#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) -+#define MODULE_FIRMWARE(_firmware) MODULE_INFO_STRIP(firmware, _firmware) - - struct notifier_block; - a/include/linux/moduleparam.h -+++ b/include/linux/moduleparam.h -@@ -17,6 +17,16 @@ - /* Chosen so that structs with an unsigned long line up. */ - #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) - -+/* This struct is here for syntactic coherency, it is not used */ -+#define __MODULE_INFO_DISABLED(name)\ -+ struct __UNIQUE_ID(name) {} -+ -+#ifdef CONFIG_MODULE_STRIPPED -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO_DISABLED(name) -+#else -+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO(tag, name, info) -+#endif -+ - #ifdef MODULE - #define __MODULE_INFO(tag, name, info) \ - static const char __UNIQUE_ID(name)[] \ -@@ -24,8 +34,7 @@ static const char __UNIQUE_ID(name)[] - = __stringify(tag) "=" info - #else /* !MODULE */ - /* This struct is here for syntactic coherency, it is not used */ --#define __MODULE_INFO(tag, name, info) \ -- struct __UNIQUE_ID(name) {} -+#define __MODULE_INFO(tag, name, info) __MODULE_INFO_DISABLED(name) - #endif - #define __MODULE_PARM_TYPE(name, _type) \ - __MODULE_INFO(parmtype, name##type, #name ":" _type) -@@ -33,7 +42,7 @@ static const char __UNIQUE_ID(name)[] - /* One for each parameter, describing how to use it. Some files do -multiple of these per line, so can't just use MODULE_INFO. */ - #define MODULE_PARM_DESC(_parm, desc) \ -- __MODULE_INFO(parm, _parm, #_parm ":" desc) -+ __MODULE_INFO_STRIP(parm, _parm, #_parm ":" desc) - - struct kernel_param; - +diff --git a/init/Kconfig b/init/Kconfig +index