modpost: re-add -e to set external_module flag
authorMasahiro Yamada <masahiroy@kernel.org>
Mon, 1 Jun 2020 05:57:08 +0000 (14:57 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 6 Jun 2020 14:38:12 +0000 (23:38 +0900)
Previously, the -i option had two functions; load a symbol dump file,
and set the external_module flag.

I want to assign a dedicate option for each of them.

Going forward, the -i is used to load a symbol dump file, and the -e
to set the external_module flag.

With this, we will be able to use -i for loading in-kernel symbols.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/Makefile.modpost
scripts/mod/modpost.c

index 7e07ada..4d79afe 100644 (file)
@@ -79,6 +79,10 @@ src := $(obj)
 # Include the module's Makefile to find KBUILD_EXTRA_SYMBOLS
 include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \
              $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile)
+
+# modpost option for external modules
+MODPOST += -e
+
 endif
 
 # modpost options for modules (both in-kernel and external)
index b8e521f..4a2f27d 100644 (file)
@@ -2552,10 +2552,12 @@ int main(int argc, char **argv)
        struct dump_list *dump_read_start = NULL;
        struct dump_list **dump_read_iter = &dump_read_start;
 
-       while ((opt = getopt(argc, argv, "i:mnsT:o:awENd:")) != -1) {
+       while ((opt = getopt(argc, argv, "ei:mnsT:o:awENd:")) != -1) {
                switch (opt) {
-               case 'i':
+               case 'e':
                        external_module = 1;
+                       break;
+               case 'i':
                        *dump_read_iter =
                                NOFAIL(calloc(1, sizeof(**dump_read_iter)));
                        (*dump_read_iter)->file = optarg;