Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7c02602 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt
Browse files

kconfig: test if a .config already exists



If one were to run localmodconfig or localyesconfig without having
a .config already in the file, then the end of the process would give
a warning when it tries to move the old .config to .config.old.

This patch adds a test to check if .config exists and avoid the moves
if it does not.

[ Impact: remove warning after make localmodconfig ]

Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent a9024838
Loading
Loading
Loading
Loading
+20 −10
Original line number Original line Diff line number Diff line
@@ -31,21 +31,31 @@ silentoldconfig: $(obj)/conf


localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
	$(Q)perl $< $(Kconfig) > .tmp.config
	$(Q)perl $< $(Kconfig) > .tmp.config
	$(Q)cmp -s .tmp.config .config ||		\
	$(Q)if [ -f .config ]; then 				\
			cmp -s .tmp.config .config ||		\
			(mv -f .config .config.old.1;		\
			(mv -f .config .config.old.1;		\
			 mv -f .tmp.config .config;		\
			 mv -f .tmp.config .config;		\
			 $(obj)/conf -s $(Kconfig);		\
			 $(obj)/conf -s $(Kconfig);		\
		 mv -f .config.old.1 .config.old)
			 mv -f .config.old.1 .config.old)	\
	else							\
			mv -f .tmp.config .config;		\
			$(obj)/conf -s $(Kconfig);		\
	fi
	$(Q)rm -f .tmp.config
	$(Q)rm -f .tmp.config


localyesconfig: $(obj)/streamline_config.pl
localyesconfig: $(obj)/streamline_config.pl
	$(Q)perl $< $(Kconfig) > .tmp.config
	$(Q)perl $< $(Kconfig) > .tmp.config
	$(Q)sed -i s/=m/=y/ .tmp.config
	$(Q)sed -i s/=m/=y/ .tmp.config
	$(Q)cmp -s .tmp.config .config ||		\
	$(Q)if [ -f .config ]; then 				\
			cmp -s .tmp.config .config ||		\
			(mv -f .config .config.old.1;		\
			(mv -f .config .config.old.1;		\
			 mv -f .tmp.config .config;		\
			 mv -f .tmp.config .config;		\
			 $(obj)/conf -s $(Kconfig);		\
			 $(obj)/conf -s $(Kconfig);		\
		 mv -f .config.old.1 .config.old)
			 mv -f .config.old.1 .config.old)	\
	else							\
			mv -f .tmp.config .config;		\
			$(obj)/conf -s $(Kconfig);		\
	fi
	$(Q)rm -f .tmp.config
	$(Q)rm -f .tmp.config


# Create new linux.pot file
# Create new linux.pot file