[patch 2/5] autoparam: makefile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Domen Puncer <[email protected]>


Build .kernel-parameters.o when vmlinux is (re)built.
Add target "kernelparams" which generates descriptions of parameters
in Documentation/kernel-parameters-gen.txt

Signed-off-by: Domen Puncer <[email protected]>

 Makefile |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletion(-)

Index: a/Makefile
===================================================================
--- a.orig/Makefile
+++ a/Makefile
@@ -650,6 +650,7 @@ define rule_vmlinux__
 		/bin/false;                             \
 	fi;
 	$(verify_kallsyms)
+	$(extract_kernel_parameters)
 endef
 
 
@@ -916,6 +917,15 @@ modules modules_install: FORCE
 
 endif # CONFIG_MODULES
 
+# Extract kernel parameters
+# ---------------------------------------------------------------------------
+
+define extract_kernel_parameters
+	$(Q)$(OBJCOPY) -j __param_strings $(objtree)/vmlinux -O binary \
+		$(objtree)/.kernel-parameters.o
+	$(Q)$(OBJCOPY) -R __param_strings $(objtree)/vmlinux $(objtree)/vmlinux
+endef
+
 # Generate asm-offsets.h 
 # ---------------------------------------------------------------------------
 
@@ -946,7 +956,8 @@ endef
 # Directories & files removed with 'make clean'
 CLEAN_DIRS  += $(MODVERDIR)
 CLEAN_FILES +=	vmlinux System.map \
-                .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map
+                .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map \
+		.kernel-parameters.o
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include2
@@ -1048,6 +1059,8 @@ help:
 	@echo  ''
 	@echo  'Documentation targets:'
 	@$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp
+	@echo  '  kernelparams    - Generates list of boot parameters in'
+	@echo  '                    Documentation/kernel-parameters-gen.txt'
 	@echo  ''
 	@echo  'Architecture specific targets ($(ARCH)):'
 	@$(if $(archhelp),$(archhelp),\
@@ -1142,6 +1155,15 @@ help:
 	@echo  ''
 endif # KBUILD_EXTMOD
 
+
+kernelparams:
+	$(Q)if [ ! -f $(objtree)/.kernel-parameters.o ]; then \
+		echo "You have to build a kernel (vmlinux) first."; \
+		exit 1; \
+	fi
+	$(O)$(PERL) -w $(srctree)/scripts/kernelparams.pl $(objtree)/.kernel-parameters.o \
+		> $(srctree)/Documentation/kernel-parameters-gen.txt
+
 # Generate tags for editors
 # ---------------------------------------------------------------------------
 

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux