From cce0841d9664deb14035fe91615e5eda62a93f07 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Mon, 29 Sep 2008 20:19:45 +0000 Subject: Rework the way EXPERIMENTAL kernels are marked as such. /trunk/kconfig/kconfig.mk | 51 25 26 0 ++++++++++++++++++++++---------------------- /trunk/docs/overview.txt | 47 47 0 0 +++++++++++++++++++++++++++++++++++++++++ /trunk/config/kernel/bare-metal.in | 1 1 0 0 + 3 files changed, 73 insertions(+), 26 deletions(-) diff --git a/config/kernel/bare-metal.experimental.in b/config/kernel/bare-metal.experimental.in deleted file mode 100644 index a05b97e..0000000 --- a/config/kernel/bare-metal.experimental.in +++ /dev/null @@ -1,11 +0,0 @@ -# Bare metal config options - -config KERNEL_bare_metal - select BARE_METAL - help - 'Bare metal' refers to those programs that run without any kernel. - - You probably want to say 'y' here if you plan to use your compiler - to build bootloaders. It is not yet suitable to build Linux kernels, - though, because the APCI stuff relies on the target C library headers - being available?!?!... diff --git a/config/kernel/bare-metal.in b/config/kernel/bare-metal.in new file mode 100644 index 0000000..2e6b774 --- /dev/null +++ b/config/kernel/bare-metal.in @@ -0,0 +1,12 @@ +# Bare metal config options +# EXPERIMENTAL + +config KERNEL_bare_metal + select BARE_METAL + help + 'Bare metal' refers to those programs that run without any kernel. + + You probably want to say 'y' here if you plan to use your compiler + to build bootloaders. It is not yet suitable to build Linux kernels, + though, because the APCI stuff relies on the target C library headers + being available?!?!... diff --git a/docs/overview.txt b/docs/overview.txt index ae37d67..cd704aa 100644 --- a/docs/overview.txt +++ b/docs/overview.txt @@ -659,6 +659,53 @@ The "functions" file API: - default to: - all empty +Kernel specific | +----------------+ + +A kernel is defined by: + + - a human-readable name, in lower case letters, with numbers as appropriate. + The underscore is allowed; space and special characters are not (although + they are internally replaced with underscores. + Eg.: linux, bare-metal + - a file in "config/kernel/", named after the kernel name, and suffixed with + ".in". + Eg.: config/kernel/linux.in, config/kernel/bare-metal.in + +The kernel's ".in" file must contain: + > an optional lines containing exactly "# EXPERIMENTAL", starting on the + first column, and without any following space or other character. + If this line is present, then this kernel is considered EXPERIMENTAL, + and correct dependency on EXPERIMENTAL will be set. + > the config option "KERNEL_%kernel_name%" (where %kernel_name% is to be + replaced with the actual kernel name, with all special characters and + spaces replaced by underscores). + That config option must have *neither* a type, *nor* a prompt! Also, it can + *not* depends on EXPERIMENTAL. + Eg.: KERNEL_linux, KERNEL_bare_metal + + mandatory: + defines a (terse) help entry for this kernel. + Eg.: + config KERNEL_bare_metal + help + Build a compiler for use without any kernel. + + optional: + selects adequate associated config options. + Eg.: + config KERNEL_bare_metal + select BARE_METAL + help + Build a compiler for use without any kernel. + + > other kernel specific options, at your discretion. Note however that, to + avoid name-clashing, such options should be prefixed with + "KERNEL_%kernel_name%", where %kernel_name% is again tp be replaced with + the actual kernel name. + (Note: due to historical reasons, and lack of time to clean up the code, + I may have left some config options that do not completely conform to + this, as the kernel name was written all upper case. However, the prefix + is unique among kernels, and does not cause harm). + Adding a new version of a component | ------------------------------------+ diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index ac0f7a0..3db74a2 100644 --- a/kconfig/kconfig.mk +++ b/kconfig/kconfig.mk @@ -48,7 +48,8 @@ $(CT_TOP_DIR)/config.gen/arch.in: $(ARCH_CONFIG_FILES) echo "# Generated file, do not edit!!!"; \ echo ""; \ for arch in $(ARCHS); do \ - echo "config ARCH_$${arch}"; \ + _arch=$$(echo "$${arch}" |sed -r -s -e 's/[-.+]/_/g;'); \ + echo "config ARCH_$${_arch}"; \ echo " bool"; \ printf " prompt \"$${arch}"; \ if [ -f $(CT_LIB_DIR)/arch/$${arch}/experimental ]; then \ @@ -57,9 +58,9 @@ $(CT_TOP_DIR)/config.gen/arch.in: $(ARCH_CONFIG_FILES) else \ echo "\""; \ fi; \ - echo "if ARCH_$${arch}"; \ + echo "if ARCH_$${_arch}"; \ echo "config ARCH"; \ - echo " default \"$${arch}\" if ARCH_$${arch}"; \ + echo " default \"$${arch}\" if ARCH_$${_arch}"; \ echo "source config/arch/$${arch}/config.in"; \ echo "endif"; \ echo ""; \ @@ -68,29 +69,27 @@ $(CT_TOP_DIR)/config.gen/arch.in: $(ARCH_CONFIG_FILES) $(CT_TOP_DIR)/config.gen/kernel.in: $(KERN_CONFIG_FILES) @echo ' IN config.gen/kernel.in' - @(echo "# Kernel menu"; \ - echo "# Generated file, do not edit!!!"; \ - echo ""; \ - for kern in $(KERNELS); do \ - _exp="$${kern/*./}"; \ - _kern1="$${kern/.experimental/}"; \ - _kern2=$$(echo "$${_kern1}" |sed -r -e 's/[ -\/]/_/g;'); \ - echo "config KERNEL_$${_kern2}"; \ - echo " bool"; \ - printf " prompt \"$${_kern1}"; \ - if [ "$${_exp}" != "$${kern}" ]; then \ - echo " (EXPERIMENTAL)\""; \ - echo " depends on EXPERIMENTAL"; \ - else \ - echo "\""; \ - fi; \ - echo "if KERNEL_$${_kern2}"; \ - echo "config KERNEL"; \ - echo " default \"$${_kern1}\" if KERNEL_$${_kern2}"; \ - echo "source config/kernel/$${kern}.in"; \ - echo "endif"; \ - echo ""; \ - done; \ + @(echo "# Kernel menu"; \ + echo "# Generated file, do not edit!!!"; \ + echo ""; \ + for kern in $(KERNELS); do \ + _kern=$$(echo "$${kern}" |sed -r -s -e 's/[-.+]/_/g;'); \ + echo "config KERNEL_$${_kern}"; \ + echo " bool"; \ + printf " prompt \"$${kern}"; \ + if grep -E '^# +EXPERIMENTAL$$' config/kernel/$${kern}.in >/dev/null 2>&1; then \ + echo " (EXPERIMENTAL)\""; \ + echo " depends on EXPERIMENTAL"; \ + else \ + echo "\""; \ + fi; \ + echo "if KERNEL_$${_kern}"; \ + echo "config KERNEL"; \ + echo " default \"$${kern}\" if KERNEL_$${_kern}"; \ + echo "source config/kernel/$${kern}.in"; \ + echo "endif"; \ + echo ""; \ + done; \ ) >$@ $(CT_TOP_DIR)/config.gen/debug.in: $(DEBUG_CONFIG_FILES) -- cgit v0.10.2-6-g49f6