* This patch renames remainders the arch i386 to x86.
* fix arch/io.h to use consistent types * add compression code and start integration into Kconfig * update to newer version of Kconfig, and rename some occurences of "Linux" to "LinuxBIOS" * set up Make framework to create linuxbios.rom Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Ronald G Minnich <rminnich@lanl.gov> git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@55 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
1fa5d301a6
commit
f2000cd4ad
43 changed files with 1747 additions and 401 deletions
|
|
@ -45,7 +45,7 @@ define filechk
|
|||
endef
|
||||
|
||||
######
|
||||
# gcc support functions
|
||||
# cc support functions to be used (only) in arch/$(ARCH)/Makefile
|
||||
# See documentation in Documentation/kbuild/makefiles.txt
|
||||
|
||||
# as-option
|
||||
|
|
@ -87,13 +87,9 @@ cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \
|
|||
# $(Q)$(MAKE) $(build)=dir
|
||||
build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
|
||||
|
||||
# Prefix -I with $(srctree) if it is not an absolute path
|
||||
addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1)
|
||||
# Find all -I options and call addtree
|
||||
flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
|
||||
|
||||
# If quiet is set, only print short version of command
|
||||
cmd = @$(echo-cmd) $(cmd_$(1))
|
||||
cmd = @$(if $($(quiet)cmd_$(1)),\
|
||||
echo ' $(call escsq,$($(quiet)cmd_$(1)))' &&) $(cmd_$(1))
|
||||
|
||||
# Add $(obj)/ for paths that is not absolute
|
||||
objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o)))
|
||||
|
|
@ -116,33 +112,30 @@ endif
|
|||
echo-cmd = $(if $($(quiet)cmd_$(1)), \
|
||||
echo ' $(call escsq,$($(quiet)cmd_$(1)))';)
|
||||
|
||||
make-cmd = $(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1)))))
|
||||
|
||||
# function to only execute the passed command if necessary
|
||||
# >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file
|
||||
# note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars
|
||||
#
|
||||
if_changed = $(if $(strip $(filter-out $(PHONY),$?) \
|
||||
$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
|
||||
#
|
||||
if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
|
||||
@set -e; \
|
||||
$(echo-cmd) $(cmd_$(1)); \
|
||||
echo 'cmd_$@ := $(make-cmd)' > $(@D)/.$(@F).cmd)
|
||||
$(echo-cmd) \
|
||||
$(cmd_$(1)); \
|
||||
echo 'cmd_$@ := $(subst $$,$$$$,$(call escsq,$(cmd_$(1))))' > $(@D)/.$(@F).cmd)
|
||||
|
||||
# execute the command and also postprocess generated .d dependencies
|
||||
# file
|
||||
if_changed_dep = $(if $(strip $(filter-out $(PHONY),$?) \
|
||||
$(filter-out FORCE $(wildcard $^),$^) \
|
||||
$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
|
||||
if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
|
||||
$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
|
||||
@set -e; \
|
||||
$(echo-cmd) $(cmd_$(1)); \
|
||||
scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(@D)/.$(@F).tmp; \
|
||||
$(echo-cmd) \
|
||||
$(cmd_$(1)); \
|
||||
scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(call escsq,$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \
|
||||
rm -f $(depfile); \
|
||||
mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)
|
||||
|
||||
# Usage: $(call if_changed_rule,foo)
|
||||
# will check if $(cmd_foo) changed, or any of the prequisites changed,
|
||||
# and if so will execute $(rule_foo)
|
||||
if_changed_rule = $(if $(strip $(filter-out $(PHONY),$?) \
|
||||
$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\
|
||||
if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\
|
||||
@set -e; \
|
||||
$(rule_$(1)))
|
||||
|
|
|
|||
7
scripts/Makefile
Normal file
7
scripts/Makefile
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
###
|
||||
# scripts contains sources for various helper programs used throughout
|
||||
# the kernel for the build process.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Let clean descend into subdirs
|
||||
subdir- += basic kconfig package
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
src := $(obj)
|
||||
|
||||
PHONY := __build
|
||||
.PHONY: __build
|
||||
__build:
|
||||
|
||||
# Read .config if it exist, otherwise ignore
|
||||
|
|
@ -30,7 +30,7 @@ ifneq ($(hostprogs-y)$(hostprogs-m),)
|
|||
include scripts/Makefile.host
|
||||
endif
|
||||
|
||||
ifneq ($(LBBUILD_SRC),)
|
||||
ifneq ($(KBUILD_SRC),)
|
||||
# Create output directory if not already present
|
||||
_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
|
||||
|
||||
|
|
@ -39,6 +39,7 @@ _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
|
|||
_dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
|
||||
endif
|
||||
|
||||
|
||||
ifndef obj
|
||||
$(warning kbuild: Makefile.build is included improperly)
|
||||
endif
|
||||
|
|
@ -53,15 +54,16 @@ ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(lib-target)),)
|
|||
builtin-target := $(obj)/built-in.o
|
||||
endif
|
||||
|
||||
# We keep a list of all modules in $(MODVERDIR)
|
||||
|
||||
__build: $(builtin-target) $(lib-target) $(extra-y) \
|
||||
$(subdir-ym) $(always)
|
||||
@:
|
||||
|
||||
__build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
|
||||
$(if $(KBUILD_MODULES),$(obj-m)) \
|
||||
$(subdir-ym) $(always)
|
||||
@:
|
||||
|
||||
# Linus' kernel sanity checking tool
|
||||
ifneq ($(LBBUILD_CHECKSRC),0)
|
||||
ifeq ($(LBBUILD_CHECKSRC),2)
|
||||
ifneq ($(KBUILD_CHECKSRC),0)
|
||||
ifeq ($(KBUILD_CHECKSRC),2)
|
||||
quiet_cmd_force_checksrc = CHECK $<
|
||||
cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;
|
||||
else
|
||||
|
|
@ -75,8 +77,35 @@ endif
|
|||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Default is built-in, unless we know otherwise
|
||||
modkern_cflags := $(CFLAGS_KERNEL)
|
||||
quiet_modtag := $(empty) $(empty)
|
||||
|
||||
cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $<
|
||||
$(real-objs-m) : modkern_cflags := $(CFLAGS_MODULE)
|
||||
$(real-objs-m:.o=.i) : modkern_cflags := $(CFLAGS_MODULE)
|
||||
$(real-objs-m:.o=.s) : modkern_cflags := $(CFLAGS_MODULE)
|
||||
$(real-objs-m:.o=.lst): modkern_cflags := $(CFLAGS_MODULE)
|
||||
|
||||
$(real-objs-m) : quiet_modtag := [M]
|
||||
$(real-objs-m:.o=.i) : quiet_modtag := [M]
|
||||
$(real-objs-m:.o=.s) : quiet_modtag := [M]
|
||||
$(real-objs-m:.o=.lst): quiet_modtag := [M]
|
||||
|
||||
$(obj-m) : quiet_modtag := [M]
|
||||
|
||||
# Default for not multi-part modules
|
||||
modname = $(*F)
|
||||
|
||||
$(multi-objs-m) : modname = $(modname-multi)
|
||||
$(multi-objs-m:.o=.i) : modname = $(modname-multi)
|
||||
$(multi-objs-m:.o=.s) : modname = $(modname-multi)
|
||||
$(multi-objs-m:.o=.lst) : modname = $(modname-multi)
|
||||
$(multi-objs-y) : modname = $(modname-multi)
|
||||
$(multi-objs-y:.o=.i) : modname = $(modname-multi)
|
||||
$(multi-objs-y:.o=.s) : modname = $(modname-multi)
|
||||
$(multi-objs-y:.o=.lst) : modname = $(modname-multi)
|
||||
|
||||
quiet_cmd_cc_s_c = CC $(quiet_modtag) $@
|
||||
cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
|
||||
|
||||
%.s: %.c FORCE
|
||||
$(call if_changed_dep,cc_s_c)
|
||||
|
|
@ -87,18 +116,60 @@ cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
|
|||
%.i: %.c FORCE
|
||||
$(call if_changed_dep,cc_i_c)
|
||||
|
||||
quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
|
||||
cmd_cc_symtypes_c = \
|
||||
$(CPP) -D__GENKSYMS__ $(c_flags) $< \
|
||||
| $(GENKSYMS) -T $@ >/dev/null; \
|
||||
test -s $@ || rm -f $@
|
||||
|
||||
%.symtypes : %.c FORCE
|
||||
$(call if_changed_dep,cc_symtypes_c)
|
||||
|
||||
# C (.c) files
|
||||
# The C file is compiled and updated dependency information is generated.
|
||||
# (See cmd_cc_o_c + relevant part of rule_cc_o_c)
|
||||
|
||||
quiet_cmd_cc_o_c = CC $(quiet_modtag) $@
|
||||
|
||||
ifndef CONFIG_MODVERSIONS
|
||||
cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
|
||||
|
||||
else
|
||||
# When module versioning is enabled the following steps are executed:
|
||||
# o compile a .tmp_<file>.o from <file>.c
|
||||
# o if .tmp_<file>.o doesn't contain a __ksymtab version, i.e. does
|
||||
# not export symbols, we just rename .tmp_<file>.o to <file>.o and
|
||||
# are done.
|
||||
# o otherwise, we calculate symbol versions using the good old
|
||||
# genksyms on the preprocessed source and postprocess them in a way
|
||||
# that they are usable as a linker script
|
||||
# o generate <file>.o from .tmp_<file>.o using the linker to
|
||||
# replace the unresolved symbols __crc_exported_symbol with
|
||||
# the actual value of the checksum generated by genksyms
|
||||
|
||||
cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
|
||||
cmd_modversions = \
|
||||
if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
|
||||
$(CPP) -D__GENKSYMS__ $(c_flags) $< \
|
||||
| $(GENKSYMS) $(if $(KBUILD_SYMTYPES), \
|
||||
-T $(@D)/$(@F:.o=.symtypes)) \
|
||||
> $(@D)/.tmp_$(@F:.o=.ver); \
|
||||
\
|
||||
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
|
||||
-T $(@D)/.tmp_$(@F:.o=.ver); \
|
||||
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
|
||||
else \
|
||||
mv -f $(@D)/.tmp_$(@F) $@; \
|
||||
fi;
|
||||
endif
|
||||
|
||||
define rule_cc_o_c
|
||||
$(call echo-cmd,checksrc) $(cmd_checksrc) \
|
||||
$(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
|
||||
scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > $(@D)/.$(@F).tmp; \
|
||||
$(if $($(quiet)cmd_checksrc),echo ' $($(quiet)cmd_checksrc)';) \
|
||||
$(cmd_checksrc) \
|
||||
$(if $($(quiet)cmd_cc_o_c),echo ' $(call escsq,$($(quiet)cmd_cc_o_c))';) \
|
||||
$(cmd_cc_o_c); \
|
||||
$(cmd_modversions) \
|
||||
scripts/basic/fixdep $(depfile) $@ '$(call escsq,$(cmd_cc_o_c))' > $(@D)/.$(@F).tmp; \
|
||||
rm -f $(depfile); \
|
||||
mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
|
||||
endef
|
||||
|
|
@ -127,6 +198,11 @@ quiet_cmd_cc_lst_c = MKLST $@
|
|||
# Compile assembler sources (.S)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
modkern_aflags := $(AFLAGS_KERNEL)
|
||||
|
||||
$(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE)
|
||||
$(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
|
||||
|
||||
quiet_cmd_as_s_S = CPP $(quiet_modtag) $@
|
||||
cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
|
||||
|
||||
|
|
@ -220,14 +296,14 @@ targets += $(multi-used-y) $(multi-used-m)
|
|||
# Descending
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
PHONY += $(subdir-ym)
|
||||
.PHONY: $(subdir-ym)
|
||||
$(subdir-ym):
|
||||
$(Q)$(MAKE) $(build)=$@
|
||||
|
||||
# Add FORCE to the prequisites of a target to force it to be always rebuilt.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
PHONY += FORCE
|
||||
.PHONY: FORCE
|
||||
|
||||
FORCE:
|
||||
|
||||
|
|
@ -242,9 +318,3 @@ cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
|
|||
ifneq ($(cmd_files),)
|
||||
include $(cmd_files)
|
||||
endif
|
||||
|
||||
|
||||
# Declare the contents of the .PHONY variable as phony. We keep that
|
||||
# information in a variable se we can use it in if_changed and friends.
|
||||
|
||||
.PHONY: $(PHONY)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
src := $(obj)
|
||||
|
||||
PHONY := __clean
|
||||
.PHONY: __clean
|
||||
__clean:
|
||||
|
||||
# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
|
||||
|
|
@ -87,16 +87,10 @@ endif
|
|||
# Descending
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
PHONY += $(subdir-ymn)
|
||||
.PHONY: $(subdir-ymn)
|
||||
$(subdir-ymn):
|
||||
$(Q)$(MAKE) $(clean)=$@
|
||||
|
||||
# If quiet is set, only print short version of command
|
||||
|
||||
cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
|
||||
|
||||
|
||||
# Declare the contents of the .PHONY variable as phony. We keep that
|
||||
# information in a variable se we can use it in if_changed and friends.
|
||||
|
||||
.PHONY: $(PHONY)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
# Backward compatibility - to be removed...
|
||||
extra-y += $(EXTRA_TARGETS)
|
||||
# Figure out what we need to build from the various variables
|
||||
# ===========================================================================
|
||||
|
||||
|
|
@ -98,6 +99,11 @@ __a_flags = $(_a_flags)
|
|||
__cpp_flags = $(_cpp_flags)
|
||||
else
|
||||
|
||||
# Prefix -I with $(srctree) if it is not an absolute path
|
||||
addtree = $(1) $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)))
|
||||
# Find all -I options and call addtree
|
||||
flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
|
||||
|
||||
# -I$(obj) locates generated .h files
|
||||
# $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files
|
||||
# and locates generated .h files
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
* tells make when to remake a file.
|
||||
*
|
||||
* To use this list as-is however has the drawback that virtually
|
||||
* every file in the kernel includes <linux/config.h> which then again
|
||||
* every file in the kernel includes <linuxbios/config.h> which then again
|
||||
* includes <linuxbios/autoconf.h>
|
||||
*
|
||||
* If the user re-runs make *config, linuxbios/autoconf.h will be
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
* cmd_<target> = <cmdline>
|
||||
*
|
||||
* and then basically copies the .<target>.d file to stdout, in the
|
||||
* process filtering out the dependency on linuxbios/autoconf.h and adding
|
||||
* process filtering out the dependency on linux/autoconf.h and adding
|
||||
* dependencies on include/config/my/option.h for every
|
||||
* CONFIG_MY_OPTION encountered in any of the prequisites.
|
||||
*
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
* Note 2: if somebody writes HELLO_CONFIG_BOOM in a file, it will depend onto
|
||||
* CONFIG_BOOM. This could seem a bug (not too hard to fix), but please do not
|
||||
* fix it! Some UserModeLinux files (look at arch/um/) call CONFIG_BOOM as
|
||||
* UML_CONFIG_BOOM, to avoid conflicts with /usr/include/linuxbios/autoconf.h,
|
||||
* UML_CONFIG_BOOM, to avoid conflicts with /usr/include/linux/autoconf.h,
|
||||
* through arch/um/include/uml-config.h; this fixdep "bug" makes sure that
|
||||
* those files will have correct dependencies.
|
||||
*/
|
||||
|
|
@ -132,10 +132,20 @@ void usage(void)
|
|||
|
||||
/*
|
||||
* Print out the commandline prefixed with cmd_<target filename> :=
|
||||
*/
|
||||
* If commandline contains '#' escape with '\' so make to not see
|
||||
* the '#' as a start-of-comment symbol
|
||||
**/
|
||||
void print_cmdline(void)
|
||||
{
|
||||
printf("cmd_%s := %s\n\n", target, cmdline);
|
||||
char *p = cmdline;
|
||||
|
||||
printf("cmd_%s := ", target);
|
||||
for (; *p; p++) {
|
||||
if (*p == '#')
|
||||
printf("\\");
|
||||
printf("%c", *p);
|
||||
}
|
||||
printf("\n\n");
|
||||
}
|
||||
|
||||
char * str_config = NULL;
|
||||
|
|
@ -321,7 +331,6 @@ void parse_dep_file(void *map, size_t len)
|
|||
}
|
||||
memcpy(s, m, p-m); s[p-m] = 0;
|
||||
if (strrcmp(s, "include/linuxbios/autoconf.h") &&
|
||||
strrcmp(s, "arch/um/include/uml-config.h") &&
|
||||
strrcmp(s, ".ver")) {
|
||||
printf(" %s \\\n", s);
|
||||
do_config_file(s);
|
||||
|
|
|
|||
17
scripts/kconfig/.gitignore
vendored
17
scripts/kconfig/.gitignore
vendored
|
|
@ -1,17 +0,0 @@
|
|||
#
|
||||
# Generated files
|
||||
#
|
||||
config*
|
||||
lex.*.c
|
||||
*.tab.c
|
||||
*.tab.h
|
||||
zconf.hash.c
|
||||
|
||||
#
|
||||
# configuration programs
|
||||
#
|
||||
conf
|
||||
mconf
|
||||
qconf
|
||||
gconf
|
||||
kxgettext
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
# Kernel configuration targets
|
||||
# These targets are used from top-level makefile
|
||||
|
||||
PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
|
||||
.PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
|
||||
|
||||
xconfig: $(obj)/qconf
|
||||
$< Kconfig
|
||||
|
|
@ -28,10 +28,9 @@ update-po-config: $(obj)/kxgettext
|
|||
--add-comments --keyword=_ --keyword=N_ \
|
||||
--files-from=scripts/kconfig/POTFILES.in \
|
||||
--output scripts/kconfig/config.pot
|
||||
$(Q)ln -fs Kconfig_i386 arch/um/Kconfig_arch
|
||||
$(Q)for i in `ls arch/`; \
|
||||
do \
|
||||
scripts/kconfig/kxgettext arch/$$i/Kconfig \
|
||||
scripts/kconfig/kxgettext Kconfig \
|
||||
| msguniq -o scripts/kconfig/linux_$${i}.pot; \
|
||||
done
|
||||
$(Q)msgcat scripts/kconfig/config.pot \
|
||||
|
|
@ -39,10 +38,9 @@ update-po-config: $(obj)/kxgettext
|
|||
--output scripts/kconfig/linux_raw.pot
|
||||
$(Q)msguniq --sort-by-file scripts/kconfig/linux_raw.pot \
|
||||
--output scripts/kconfig/linux.pot
|
||||
$(Q)rm -f arch/um/Kconfig_arch
|
||||
$(Q)rm -f scripts/kconfig/linux_*.pot scripts/kconfig/config.pot
|
||||
|
||||
PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig
|
||||
.PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
|
||||
|
||||
randconfig: $(obj)/conf
|
||||
$< -r Kconfig
|
||||
|
|
@ -56,16 +54,32 @@ allnoconfig: $(obj)/conf
|
|||
allmodconfig: $(obj)/conf
|
||||
$< -m Kconfig
|
||||
|
||||
UNAME_RELEASE := $(shell uname -r)
|
||||
CLONECONFIG := $(firstword $(wildcard /proc/config.gz \
|
||||
/lib/modules/$(UNAME_RELEASE)/.config \
|
||||
/etc/kernel-config \
|
||||
/boot/config-$(UNAME_RELEASE)))
|
||||
cloneconfig: $(obj)/conf
|
||||
$(Q)case "$(CLONECONFIG)" in \
|
||||
'') echo -e "The configuration of the running" \
|
||||
"kernel could not be determined\n"; \
|
||||
false ;; \
|
||||
*.gz) gzip -cd $(CLONECONFIG) > .config.running ;; \
|
||||
*) cat $(CLONECONFIG) > .config.running ;; \
|
||||
esac && \
|
||||
echo -e "Cloning configuration file $(CLONECONFIG)\n"
|
||||
$(Q)$< -D .config.running Kconfig
|
||||
|
||||
defconfig: $(obj)/conf
|
||||
ifeq ($(KBUILD_DEFCONFIG),)
|
||||
$< -d Kconfig
|
||||
else
|
||||
@echo *** Default configuration is based on '$(KBUILD_DEFCONFIG)'
|
||||
$(Q)$< -D arch/$(ARCH)/configs/$(KBUILD_DEFCONFIG) Kconfig
|
||||
$(Q)$< -D configs/$(KBUILD_DEFCONFIG) Kconfig
|
||||
endif
|
||||
|
||||
%_defconfig: $(obj)/conf
|
||||
$(Q)$< -D arch/$(ARCH)/configs/$@ Kconfig
|
||||
$(Q)$< -D configs/$@ Kconfig
|
||||
|
||||
# Help text used by make help
|
||||
help:
|
||||
|
|
@ -78,7 +92,7 @@ help:
|
|||
@echo ' defconfig - New config with default answer to all options'
|
||||
@echo ' allmodconfig - New config selecting modules when possible'
|
||||
@echo ' allyesconfig - New config where all options are accepted with yes'
|
||||
@echo ' allnoconfig - New config where all options are answered with no'
|
||||
@echo ' allnoconfig - New minimal config'
|
||||
|
||||
# ===========================================================================
|
||||
# Shared Makefile for the various kconfig executables:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
|
@ -64,6 +63,20 @@ static void check_stdin(void)
|
|||
}
|
||||
}
|
||||
|
||||
static char *fgets_check_stream(char *s, int size, FILE *stream)
|
||||
{
|
||||
char *ret = fgets(s, size, stream);
|
||||
|
||||
if (ret == NULL && feof(stream)) {
|
||||
printf(_("aborted!\n\n"));
|
||||
printf(_("Console input is closed. "));
|
||||
printf(_("Run 'make oldconfig' to update configuration.\n\n"));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void conf_askvalue(struct symbol *sym, const char *def)
|
||||
{
|
||||
enum symbol_type type = sym_get_type(sym);
|
||||
|
|
@ -101,7 +114,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
|
|||
check_stdin();
|
||||
case ask_all:
|
||||
fflush(stdout);
|
||||
fgets(line, 128, stdin);
|
||||
fgets_check_stream(line, 128, stdin);
|
||||
return;
|
||||
case set_default:
|
||||
printf("%s\n", def);
|
||||
|
|
@ -315,7 +328,8 @@ static int conf_choice(struct menu *menu)
|
|||
printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
|
||||
def_sym = sym_get_choice_value(sym);
|
||||
cnt = def = 0;
|
||||
line[0] = 0;
|
||||
line[0] = '0';
|
||||
line[1] = 0;
|
||||
for (child = menu->list; child; child = child->next) {
|
||||
if (!menu_is_visible(child))
|
||||
continue;
|
||||
|
|
@ -356,7 +370,7 @@ static int conf_choice(struct menu *menu)
|
|||
check_stdin();
|
||||
case ask_all:
|
||||
fflush(stdout);
|
||||
fgets(line, 128, stdin);
|
||||
fgets_check_stream(line, 128, stdin);
|
||||
strip(line);
|
||||
if (line[0] == '?') {
|
||||
printf("\n%s\n", menu->sym->help ?
|
||||
|
|
@ -532,7 +546,7 @@ int main(int ac, char **av)
|
|||
break;
|
||||
case 'h':
|
||||
case '?':
|
||||
fprintf(stderr, "See README for usage info\n");
|
||||
printf("%s [-o|-s] config\n", av[0]);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const char conf_defname[] = "arch/$ARCH/defconfig";
|
|||
|
||||
const char *conf_confnames[] = {
|
||||
".config",
|
||||
conf_defname,
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
|
@ -321,7 +322,7 @@ int conf_read(const char *name)
|
|||
sym->flags |= e->right.sym->flags & SYMBOL_NEW;
|
||||
}
|
||||
|
||||
sym_change_count = conf_warnings || conf_unsaved;
|
||||
sym_change_count = conf_warnings && conf_unsaved;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -370,7 +371,6 @@ int conf_write(const char *name)
|
|||
out_h = fopen(".tmpconfig.h", "w");
|
||||
if (!out_h)
|
||||
return 1;
|
||||
file_write_dep(NULL);
|
||||
}
|
||||
sym = sym_lookup("KERNELVERSION", 0);
|
||||
sym_calc_value(sym);
|
||||
|
|
@ -509,6 +509,7 @@ int conf_write(const char *name)
|
|||
if (out_h) {
|
||||
fclose(out_h);
|
||||
rename(".tmpconfig.h", "include/linuxbios/autoconf.h");
|
||||
file_write_dep(NULL);
|
||||
}
|
||||
if (!name || basename != conf_def_filename) {
|
||||
if (!name)
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ void init_main_window(const gchar * glade_file)
|
|||
/*"style", PANGO_STYLE_OBLIQUE, */
|
||||
NULL);
|
||||
|
||||
sprintf(title, _("Linux Kernel v%s Configuration"),
|
||||
sprintf(title, _("LinuxBIOS v%s Configuration"),
|
||||
getenv("KERNELVERSION"));
|
||||
gtk_window_set_title(GTK_WINDOW(main_wnd), title);
|
||||
|
||||
|
|
@ -742,7 +742,7 @@ void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
|
|||
GtkWidget *dialog;
|
||||
const gchar *intro_text = _(
|
||||
"Welcome to gkc, the GTK+ graphical kernel configuration tool\n"
|
||||
"for Linux.\n"
|
||||
"for LinuxBIOS.\n"
|
||||
"For each option, a blank box indicates the feature is disabled, a\n"
|
||||
"check indicates it is enabled, and a dot indicates that it is to\n"
|
||||
"be compiled as a module. Clicking on the box will cycle through the three states.\n"
|
||||
|
|
|
|||
4
scripts/kconfig/lxdialog/.gitignore
vendored
4
scripts/kconfig/lxdialog/.gitignore
vendored
|
|
@ -1,4 +0,0 @@
|
|||
#
|
||||
# Generated files
|
||||
#
|
||||
lxdialog
|
||||
|
|
@ -7,10 +7,10 @@ check-lxdialog := $(srctree)/$(src)/check-lxdialog.sh
|
|||
# we really need to do so. (Do not call gcc as part of make mrproper)
|
||||
HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
|
||||
HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
|
||||
|
||||
HOST_EXTRACFLAGS += -DLOCALE
|
||||
|
||||
HOST_EXTRACFLAGS += -DLOCALE
|
||||
|
||||
PHONY += dochecklxdialog
|
||||
.PHONY: dochecklxdialog
|
||||
$(obj)/dochecklxdialog:
|
||||
$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES)
|
||||
|
||||
|
|
|
|||
|
|
@ -196,8 +196,8 @@ int dialog_checklist(const char *title, const char *prompt, int height,
|
|||
|
||||
print_buttons(dialog, height, width, 0);
|
||||
|
||||
wnoutrefresh(dialog);
|
||||
wnoutrefresh(list);
|
||||
wnoutrefresh(dialog);
|
||||
doupdate();
|
||||
|
||||
while (key != ESC) {
|
||||
|
|
@ -225,11 +225,12 @@ int dialog_checklist(const char *title, const char *prompt, int height,
|
|||
}
|
||||
scroll--;
|
||||
print_item(list, items[scroll * 3 + 1], status[scroll], 0, TRUE);
|
||||
wnoutrefresh(list);
|
||||
|
||||
print_arrows(dialog, choice, item_no,
|
||||
scroll, box_y, box_x + check_x + 5, list_height);
|
||||
|
||||
wnoutrefresh(dialog);
|
||||
wrefresh(list);
|
||||
wrefresh(dialog);
|
||||
|
||||
continue; /* wait for another key press */
|
||||
} else
|
||||
|
|
@ -251,12 +252,12 @@ int dialog_checklist(const char *title, const char *prompt, int height,
|
|||
scroll++;
|
||||
print_item(list, items[(scroll + max_choice - 1) * 3 + 1],
|
||||
status[scroll + max_choice - 1], max_choice - 1, TRUE);
|
||||
wnoutrefresh(list);
|
||||
|
||||
print_arrows(dialog, choice, item_no,
|
||||
scroll, box_y, box_x + check_x + 5, list_height);
|
||||
|
||||
wnoutrefresh(dialog);
|
||||
wrefresh(list);
|
||||
wrefresh(dialog);
|
||||
|
||||
continue; /* wait for another key press */
|
||||
} else
|
||||
|
|
@ -270,8 +271,8 @@ int dialog_checklist(const char *title, const char *prompt, int height,
|
|||
choice = i;
|
||||
print_item(list, items[(scroll + choice) * 3 + 1],
|
||||
status[scroll + choice], choice, TRUE);
|
||||
wnoutrefresh(dialog);
|
||||
wrefresh(list);
|
||||
wnoutrefresh(list);
|
||||
wrefresh(dialog);
|
||||
}
|
||||
continue; /* wait for another key press */
|
||||
}
|
||||
|
|
@ -305,8 +306,8 @@ int dialog_checklist(const char *title, const char *prompt, int height,
|
|||
print_item(list, items[(scroll + i) * 3 + 1],
|
||||
status[scroll + i], i, i == choice);
|
||||
}
|
||||
wnoutrefresh(dialog);
|
||||
wrefresh(list);
|
||||
wnoutrefresh(list);
|
||||
wrefresh(dialog);
|
||||
|
||||
for (i = 0; i < item_no; i++)
|
||||
if (status[i])
|
||||
|
|
|
|||
|
|
@ -58,7 +58,8 @@
|
|||
|
||||
#include "dialog.h"
|
||||
|
||||
static int menu_width, item_x;
|
||||
#define ITEM_IDENT 1 /* Indent of menu entries. Fixed for all menus */
|
||||
static int menu_width;
|
||||
|
||||
/*
|
||||
* Print menu item
|
||||
|
|
@ -69,7 +70,7 @@ static void do_print_item(WINDOW * win, const char *item, int choice,
|
|||
int j;
|
||||
char *menu_item = malloc(menu_width + 1);
|
||||
|
||||
strncpy(menu_item, item, menu_width - item_x);
|
||||
strncpy(menu_item, item, menu_width - ITEM_IDENT);
|
||||
menu_item[menu_width] = 0;
|
||||
j = first_alpha(menu_item, "YyNnMmHh");
|
||||
|
||||
|
|
@ -86,13 +87,13 @@ static void do_print_item(WINDOW * win, const char *item, int choice,
|
|||
wclrtoeol(win);
|
||||
#endif
|
||||
wattrset(win, selected ? item_selected_attr : item_attr);
|
||||
mvwaddstr(win, choice, item_x, menu_item);
|
||||
mvwaddstr(win, choice, ITEM_IDENT, menu_item);
|
||||
if (hotkey) {
|
||||
wattrset(win, selected ? tag_key_selected_attr : tag_key_attr);
|
||||
mvwaddch(win, choice, item_x + j, menu_item[j]);
|
||||
mvwaddch(win, choice, ITEM_IDENT + j, menu_item[j]);
|
||||
}
|
||||
if (selected) {
|
||||
wmove(win, choice, item_x + 1);
|
||||
wmove(win, choice, ITEM_IDENT + 1);
|
||||
}
|
||||
free(menu_item);
|
||||
wrefresh(win);
|
||||
|
|
@ -226,8 +227,6 @@ int dialog_menu(const char *title, const char *prompt, int height, int width,
|
|||
draw_box(dialog, box_y, box_x, menu_height + 2, menu_width + 2,
|
||||
menubox_border_attr, menubox_attr);
|
||||
|
||||
item_x = (menu_width - 70) / 2;
|
||||
|
||||
/* Set choice to default item */
|
||||
for (i = 0; i < item_no; i++)
|
||||
if (strcmp(current, items[i * 2]) == 0)
|
||||
|
|
@ -264,10 +263,10 @@ int dialog_menu(const char *title, const char *prompt, int height, int width,
|
|||
wnoutrefresh(menu);
|
||||
|
||||
print_arrows(dialog, item_no, scroll,
|
||||
box_y, box_x + item_x + 1, menu_height);
|
||||
box_y, box_x + ITEM_IDENT + 1, menu_height);
|
||||
|
||||
print_buttons(dialog, height, width, 0);
|
||||
wmove(menu, choice, item_x + 1);
|
||||
wmove(menu, choice, ITEM_IDENT + 1);
|
||||
wrefresh(menu);
|
||||
|
||||
while (key != ESC) {
|
||||
|
|
@ -350,7 +349,7 @@ int dialog_menu(const char *title, const char *prompt, int height, int width,
|
|||
print_item(scroll + choice, choice, TRUE);
|
||||
|
||||
print_arrows(dialog, item_no, scroll,
|
||||
box_y, box_x + item_x + 1, menu_height);
|
||||
box_y, box_x + ITEM_IDENT + 1, menu_height);
|
||||
|
||||
wnoutrefresh(dialog);
|
||||
wrefresh(menu);
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ static char menu_backtitle[128];
|
|||
static const char mconf_readme[] = N_(
|
||||
"Overview\n"
|
||||
"--------\n"
|
||||
"Some kernel features may be built directly into the kernel.\n"
|
||||
"Some firmware features may be built directly into the firmware.\n"
|
||||
"Some may be made into loadable runtime modules. Some features\n"
|
||||
"may be completely removed altogether. There are also certain\n"
|
||||
"kernel parameters which are not really features, but must be\n"
|
||||
"firmware parameters which are not really features, but must be\n"
|
||||
"entered in as decimal or hexadecimal numbers or possibly text.\n"
|
||||
"\n"
|
||||
"Menu items beginning with [*], <M> or [ ] represent features\n"
|
||||
|
|
@ -115,7 +115,7 @@ static const char mconf_readme[] = N_(
|
|||
"-----------------------------\n"
|
||||
"Menuconfig supports the use of alternate configuration files for\n"
|
||||
"those who, for various reasons, find it necessary to switch\n"
|
||||
"between different kernel configurations.\n"
|
||||
"between different firmware configurations.\n"
|
||||
"\n"
|
||||
"At the end of the main menu you will find two options. One is\n"
|
||||
"for saving the current configuration to a file of your choosing.\n"
|
||||
|
|
@ -148,7 +148,7 @@ static const char mconf_readme[] = N_(
|
|||
"\n"
|
||||
"Optional personality available\n"
|
||||
"------------------------------\n"
|
||||
"If you prefer to have all of the kernel options listed in a single\n"
|
||||
"If you prefer to have all of the firmware options listed in a single\n"
|
||||
"menu, rather than the default multimenu hierarchy, run the menuconfig\n"
|
||||
"with MENUCONFIG_MODE environment variable set to single_menu. Example:\n"
|
||||
"\n"
|
||||
|
|
@ -186,18 +186,18 @@ setmod_text[] = N_(
|
|||
"This feature depends on another which has been configured as a module.\n"
|
||||
"As a result, this feature will be built as a module."),
|
||||
nohelp_text[] = N_(
|
||||
"There is no help available for this kernel option.\n"),
|
||||
"There is no help available for this firmware option.\n"),
|
||||
load_config_text[] = N_(
|
||||
"Enter the name of the configuration file you wish to load. "
|
||||
"Accept the name shown to restore the configuration you "
|
||||
"last retrieved. Leave blank to abort."),
|
||||
load_config_help[] = N_(
|
||||
"\n"
|
||||
"For various reasons, one may wish to keep several different kernel\n"
|
||||
"For various reasons, one may wish to keep several different firmware\n"
|
||||
"configurations available on a single machine.\n"
|
||||
"\n"
|
||||
"If you have saved a previous configuration in a file other than the\n"
|
||||
"kernel's default, entering the name of the file here will allow you\n"
|
||||
"firmware's default, entering the name of the file here will allow you\n"
|
||||
"to modify that configuration.\n"
|
||||
"\n"
|
||||
"If you are uncertain, then you have probably never used alternate\n"
|
||||
|
|
@ -207,7 +207,7 @@ save_config_text[] = N_(
|
|||
"as an alternate. Leave blank to abort."),
|
||||
save_config_help[] = N_(
|
||||
"\n"
|
||||
"For various reasons, one may wish to keep different kernel\n"
|
||||
"For various reasons, one may wish to keep different firmware\n"
|
||||
"configurations available on a single machine.\n"
|
||||
"\n"
|
||||
"Entering a file name here will allow you to later retrieve, modify\n"
|
||||
|
|
@ -1053,7 +1053,7 @@ int main(int ac, char **av)
|
|||
|
||||
sym = sym_lookup("KERNELVERSION", 0);
|
||||
sym_calc_value(sym);
|
||||
sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"),
|
||||
sprintf(menu_backtitle, _("LinuxBIOS v%s Configuration"),
|
||||
sym_get_string_value(sym));
|
||||
|
||||
mode = getenv("MENUCONFIG_MODE");
|
||||
|
|
@ -1070,7 +1070,7 @@ int main(int ac, char **av)
|
|||
do {
|
||||
cprint_init();
|
||||
cprint("--yesno");
|
||||
cprint(_("Do you wish to save your new kernel configuration?"));
|
||||
cprint(_("Do you wish to save your new firmware configuration?"));
|
||||
cprint("5");
|
||||
cprint("60");
|
||||
stat = exec_conf();
|
||||
|
|
@ -1079,18 +1079,18 @@ int main(int ac, char **av)
|
|||
if (stat == 0) {
|
||||
if (conf_write(NULL)) {
|
||||
fprintf(stderr, _("\n\n"
|
||||
"Error during writing of the kernel configuration.\n"
|
||||
"Your kernel configuration changes were NOT saved."
|
||||
"Error during writing of the firmware configuration.\n"
|
||||
"Your firmware configuration changes were NOT saved."
|
||||
"\n\n"));
|
||||
return 1;
|
||||
}
|
||||
printf(_("\n\n"
|
||||
"*** End of Linux kernel configuration.\n"
|
||||
"*** Execute 'make' to build the kernel or try 'make help'."
|
||||
"*** End of LinuxBIOS configuration.\n"
|
||||
"*** Execute 'make' to build the firmware or try 'make help'."
|
||||
"\n\n"));
|
||||
} else {
|
||||
fprintf(stderr, _("\n\n"
|
||||
"Your kernel configuration changes were NOT saved."
|
||||
"Your firmware configuration changes were NOT saved."
|
||||
"\n\n"));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ int file_write_dep(const char *name)
|
|||
else
|
||||
fprintf(out, "\t%s\n", file->name);
|
||||
}
|
||||
fprintf(out, "\n.config include/linuxbios/autoconf.h: $(deps_config)\n\n$(deps_config):\n");
|
||||
fprintf(out, "\n.config $(objtree)/include/linuxbios/autoconf.h: $(deps_config)\n\n$(deps_config):\n");
|
||||
fclose(out);
|
||||
rename("..config.tmp", name);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1949,7 +1949,7 @@ void conf_parse(const char *name)
|
|||
sym_init();
|
||||
menu_init();
|
||||
modules_sym = sym_lookup("MODULES", 0);
|
||||
rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
|
||||
rootmenu.prompt = menu_add_prompt(P_MENU, "LinuxBIOS Configuration", NULL);
|
||||
|
||||
#if YYDEBUG
|
||||
if (getenv("ZCONF_DEBUG"))
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ void conf_parse(const char *name)
|
|||
sym_init();
|
||||
menu_init();
|
||||
modules_sym = sym_lookup("MODULES", 0);
|
||||
rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
|
||||
rootmenu.prompt = menu_add_prompt(P_MENU, "LinuxBIOS Configuration", NULL);
|
||||
|
||||
#if YYDEBUG
|
||||
if (getenv("ZCONF_DEBUG"))
|
||||
|
|
|
|||
32
scripts/mkmakefile
Normal file
32
scripts/mkmakefile
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
# Generates a small Makefile used in the root of the output
|
||||
# directory, to allow make to be started from there.
|
||||
# The Makefile also allow for more convinient build of external modules
|
||||
|
||||
# Usage
|
||||
# $1 - Kernel src directory
|
||||
# $2 - Output directory
|
||||
# $3 - version
|
||||
# $4 - patchlevel
|
||||
|
||||
|
||||
cat << EOF
|
||||
# Automatically generated by $(basename $0): don't edit
|
||||
|
||||
VERSION = $3
|
||||
PATCHLEVEL = $4
|
||||
|
||||
KERNELSRC := $1
|
||||
KERNELOUTPUT := $2
|
||||
export ARCH := $ARCH
|
||||
|
||||
MAKEFLAGS += --no-print-directory
|
||||
|
||||
all:
|
||||
\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
|
||||
|
||||
%::
|
||||
\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
|
||||
|
||||
EOF
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue