diff --git a/kernel/Makefile b/kernel/Makefile index 108f5bee0111..ccbe2239751a 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -122,9 +122,21 @@ $(obj)/configs.o: $(obj)/config_data.h # config_data.h contains the same information as ikconfig.h but gzipped. # Info from config_data can be extracted from /proc/config* +ifdef CONFIG_AMLOGIC_MODIFY +# Amlogic: there are too many sentences marked by '#' in .config flies +# So we need to remove them when generate config.gz, this can help to save +# about 20KB memory in ro data +$(obj)/cfg_less.txt: $(KCONFIG_CONFIG) FORCE + $(shell sed '/#/d' $(KCONFIG_CONFIG) > $(src)/cfg_less.txt) + +targets += config_data.gz +$(obj)/config_data.gz: $(obj)/cfg_less.txt FORCE + $(call if_changed,gzip) +else targets += config_data.gz $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE $(call if_changed,gzip) +endif filechk_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/basic/bin2c; echo "MAGIC_END;") targets += config_data.h