Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[makefile] Allow buit-in compilation #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ARCH ?= $(shell uname -m | sed -e s/arm.*/arm/ -e s/aarch64.*/arm64/)
BUILD_DIR ?= $(PWD)
_BUILD_DIR ?= $(shell readlink -f $(BUILD_DIR))

CONFIG_OF_DTBOCFG ?= m

ifdef KERNEL_SRC
KERNEL_SRC_DIR := $(KERNEL_SRC)
else
Expand All @@ -20,7 +22,7 @@ ifeq ($(ARCH), arm64)
endif
endif

obj-m := dtbocfg.o
obj-$(CONFIG_OF_DTBOCFG) := dtbocfg.o

all:
@# If this is an out-of-tree build, we have to create an empty makefile in the build directory
Expand Down
29 changes: 28 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,34 @@ When building a kernel, Device-Tree-Overlay option should be enabled.
You can enable the option via `make menu_config` ---> `Device Drivers` ---> `Device Tree and Open Firmware support`
---> `Device Tree overlays`, or by manually addting `CONFIG_OF_OVERLAY=y` in `.config`.

## Builiding dtbocfg
## Builiding dtbocfg in-tree

Clone the git repository in the `drivers/of/` directory in your kernel tree, and add the following in
`drivers/of/Kconfig`:

````
config OF_DTBOCFG
bool
help
Enable configFS control of device tree at runtime
````

and in the `config OF_OVERLAY` block:

````
select OF_DTBOCFG
````

Then in `drivers/of/Makefile`:

````
obj-$(CONFIG_OF_DTBOCFG) += dtbocfg/
````

Then you should be able to build the kernel with the module built-in, with the module auto-selected from the
`OF_OVERLAY` property.

## Builiding dtbocfg as a module

Clone the git repository, and run `make` after modifying it according to your environment.

Expand Down