mirror of
https://github.com/linuxboot/heads.git
synced 2025-04-01 16:41:03 +00:00
This adds a `CONFIG_UROOT=y` option to allow the busybox runtime to be replaced with the go u-root runtime. You must have go 1.9 or newer for it to work. It has been tested on the OCP winterfell and qemu nodes, and it can be specified on the build command line as well. Nothing from `heads/initrd` or any of the tools will be linked into the cpio file. Only the kernel modules and the go shell will be included.
34 lines
604 B
Plaintext
34 lines
604 B
Plaintext
#
|
|
# u-root go runtime
|
|
#
|
|
# This is not a normal Heads module, since it builds all of its
|
|
# own dependencies.
|
|
#
|
|
|
|
ifeq "$(CONFIG_UROOT)" "y"
|
|
|
|
u-root_url := github.com/u-root/u-root
|
|
u-root_output := $(build)/$(BOARD)/initrd.cpio
|
|
|
|
export GOPATH=$(build)/go
|
|
|
|
$(GOPATH):
|
|
$(call do,GO GET,$(u-root_url),\
|
|
go get $(u-root_url) \
|
|
)
|
|
|
|
$(u-root_output): $(GOPATH)
|
|
$(call do,U-ROOT,$@,\
|
|
$(GOPATH)/bin/u-root \
|
|
-build=bb \
|
|
-format=cpio \
|
|
-o $@ \
|
|
)
|
|
|
|
# Override the initrd inputs and add in the kernel modules
|
|
INITRD_OVERRIDE += $(u-root_output)
|
|
INITRD_OVERRIDE += $(build)/$(BOARD)/modules.cpio
|
|
|
|
|
|
endif
|