heads/modules/u-root
Jean-Marie Verdun 8e69f8cdbf Automatically remove u-root.cpio before compilation. u-root doesn't do that
and if the file is soon created, it will dropped the creation of a new initramfs
2018-03-12 10:28:35 +01:00

37 lines
759 B
Plaintext

#
# u-root go runtime
#
# This is not a normal Heads module, since it builds all of its
# own dependencies.
#
u-root_url := github.com/u-root/u-root
u-root_output := $(build)/$(BOARD)/u-root.cpio
ifeq ($(shell test -e build/$(BOARD)/u-root.cpio && echo -n yes),yes)
$(shell rm $(build)/$(BOARD)/u-root.cpio)
endif
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-$(CONFIG_UROOT) += $(u-root_output)
# If we are building for u-root, disable the default CONFIG_HEADS
ifeq "$(CONFIG_UROOT)" "y"
CONFIG_HEADS=n
endif