From b68e2f6f3fe31875e60879a7bbac0e6620ccb839 Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Mon, 28 Nov 2022 07:43:29 +0000 Subject: [PATCH] kconfig: Add script to update openeuler_defconfig update_oedefconfig:run make openeuler_defconfig and copy .config to arch/$(SRCARCH)/configs/openeuler_defconfig save_oedefconfig:copy .config to arch/$(SRCARCH)/configs/openeuler_defconfig Signed-off-by: Liu Chao --- scripts/kconfig/Makefile | 8 ++++++++ scripts/kconfig/makeconfig.sh | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 scripts/kconfig/makeconfig.sh diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index e46df0a2d4f9..18610add523b 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -75,6 +75,14 @@ PHONY += savedefconfig defconfig savedefconfig: $(obj)/conf $(Q)$< $(silent) --$@=defconfig $(Kconfig) +update_oedefconfig: $(obj)/conf + $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/openeuler_defconfig $(Kconfig) + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/makeconfig.sh $(SRCARCH) + +save_oedefconfig: $(obj)/conf + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/makeconfig.sh $(SRCARCH) + + defconfig: $(obj)/conf ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),) @$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" diff --git a/scripts/kconfig/makeconfig.sh b/scripts/kconfig/makeconfig.sh new file mode 100644 index 000000000000..7246e668653e --- /dev/null +++ b/scripts/kconfig/makeconfig.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 + +if [ ! -f .config ]; then + echo ".config does not exist" + exit 1 +fi + +sed -e '/CONFIG_CC_VERSION_TEXT/d' \ + -e '/CONFIG_CC_IS_GCC/d' \ + -e '/CONFIG_GCC_VERSION/d' \ + -e '/CONFIG_LD_VERSION/d' \ + -e '/CONFIG_CLANG_VERSION/d' \ + -e '/CONFIG_LLD_VERSION/d' \ + -e '/CONFIG_CC_CAN/d' \ + -e '/CONFIG_CC_HAS/d' \ + -i .config + +cp .config arch/$1/configs/openeuler_defconfig -- GitLab