diff --git a/.gitignore b/.gitignore index 2bae5197a34..344e50b3d6b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ _output/ _artifacts/ lima.REJECTED.yaml +.config diff --git a/Kconfig b/Kconfig new file mode 100644 index 00000000000..3e68bc4f2db --- /dev/null +++ b/Kconfig @@ -0,0 +1,32 @@ + +mainmenu "Lima" + +config GUESTAGENT_OS_LINUX + bool "guestagent OS: Linux" + help + Build lima-guestagent for "Linux" OS + default y + +config GUESTAGENT_ARCH_X8664 + bool "guestagent Arch: x86_64" + help + Build lima-guestagent for "x86_64" Arch + default y + +config GUESTAGENT_ARCH_AARCH64 + bool "guestagent Arch: aarch64" + help + Build lima-guestagent for "aarch64" Arch + default y + +config GUESTAGENT_ARCH_ARMV7L + bool "guestagent Arch: armv7l" + help + Build lima-guestagent for "armv7l" Arch + default y + +config GUESTAGENT_ARCH_RISCV64 + bool "guestagent Arch: riscv64" + help + Build lima-guestagent for "riscv64" Arch + default y diff --git a/Makefile b/Makefile index 60c099161f8..857b77a3809 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,11 @@ TAR ?= tar ZIP ?= zip PLANTUML ?= plantuml # may also be "java -jar plantuml.jar" if installed elsewhere +# The KCONFIG programs are only needed for re-generating the ".config" file. +# You can install the python "kconfiglib", if you don't have kconfig/kbuild. +KCONFIG_CONF ?= $(shell command -v kconfig-conf || command -v kbuild-conf || echo oldconfig) +KCONFIG_MCONF ?= $(shell command -v kconfig-mconf || command -v kbuild-mconf || echo menuconfig) + GOOS ?= $(shell $(GO) env GOOS) ifeq ($(GOOS),windows) bat = .bat @@ -45,6 +50,11 @@ GO_BUILD := $(GO) build -ldflags="-s -w -X $(PACKAGE)/pkg/version.Version=$(VERS .PHONY: all all: binaries manpages +.PHONY: help +help: + @echo ' binaries - Build all binaries' + @echo ' manpages - Build manual pages' + exe: _output/bin/limactl$(exe) .PHONY: minimal @@ -55,21 +65,54 @@ minimal: clean \ mkdir -p _output/share/lima/templates cp -aL examples/default.yaml _output/share/lima/templates/ +config: Kconfig + $(KCONFIG_CONF) $< + +menuconfig: Kconfig + MENUCONFIG_STYLE=aquatic \ + $(KCONFIG_MCONF) $< + +# Copy the default config, if not overridden locally +# This is done to avoid a dependency on KCONFIG tools +.config: config.mk + cp $^ $@ + +-include .config + +HELPERS = \ + _output/bin/nerdctl.lima \ + _output/bin/apptainer.lima \ + _output/bin/docker.lima \ + _output/bin/podman.lima \ + _output/bin/kubectl.lima + +ifeq ($(CONFIG_GUESTAGENT_OS_LINUX),y) +ifeq ($(CONFIG_GUESTAGENT_ARCH_X8664),y) +GUESTAGENT += \ + _output/share/lima/lima-guestagent.Linux-x86_64 +endif +ifeq ($(CONFIG_GUESTAGENT_ARCH_AARCH64),y) +GUESTAGENT += \ + _output/share/lima/lima-guestagent.Linux-aarch64 +endif +ifeq ($(CONFIG_GUESTAGENT_ARCH_ARMV7L),y) +GUESTAGENT += \ + _output/share/lima/lima-guestagent.Linux-armv7l +endif +ifeq ($(CONFIG_GUESTAGENT_ARCH_RISCV64),y) +GUESTAGENT += \ + _output/share/lima/lima-guestagent.Linux-riscv64 +endif +endif + .PHONY: binaries binaries: clean \ _output/bin/lima \ _output/bin/lima$(bat) \ _output/bin/limactl$(exe) \ codesign \ - _output/bin/nerdctl.lima \ - _output/bin/apptainer.lima \ - _output/bin/docker.lima \ - _output/bin/podman.lima \ - _output/bin/kubectl.lima \ - _output/share/lima/lima-guestagent.Linux-x86_64 \ - _output/share/lima/lima-guestagent.Linux-aarch64 \ - _output/share/lima/lima-guestagent.Linux-armv7l \ - _output/share/lima/lima-guestagent.Linux-riscv64 + $(HELPERS) \ + $(GUESTAGENT) cp -aL examples _output/share/lima/templates ifneq ($(GOOS),windows) ln -sf templates _output/share/lima/examples diff --git a/config.mk b/config.mk new file mode 100644 index 00000000000..89f5488fe55 --- /dev/null +++ b/config.mk @@ -0,0 +1,5 @@ +CONFIG_GUESTAGENT_OS_LINUX=y +CONFIG_GUESTAGENT_ARCH_X8664=y +CONFIG_GUESTAGENT_ARCH_AARCH64=y +CONFIG_GUESTAGENT_ARCH_ARMV7L=y +CONFIG_GUESTAGENT_ARCH_RISCV64=y diff --git a/website/content/en/docs/Installation/_index.md b/website/content/en/docs/Installation/_index.md index 5991f1b8794..9449cff5f42 100644 --- a/website/content/en/docs/Installation/_index.md +++ b/website/content/en/docs/Installation/_index.md @@ -56,5 +56,18 @@ cd lima make make install ``` + +To change the build configuration, run `make config` or `make menuconfig`. + +This requires kconfig tools installed, it is also possible to edit `.config`. +The default configuration can be found in the file `config.mk` (make syntax). + +## Kconfig tools + +The tools are available as either "kconfig-frontends" or "kbuild-standalone". +There is one `conf` for the text, and one `mconf` for the menu interface. + +A python implementation is available at . +It can be installed with `pip install --user kconfiglib`, including `guiconfig`. {{% /tab %}} {{< /tabpane >}}