payloads/U-Boot: Tidy up the U-Boot build

This doesn't work at present, merely printing an error when U-Boot is
selected as a payload. This is because it adds a file into the U-Boot
tree which makes U-Boot's build system think that the tree is unclean.

Update the rules to put the tag file outside the source tree. Use an
out-of-tree build for U-Boot to avoid changing the source tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I24d6545b54f97afeefaca3ffed79eec2e7afacb4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59600
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Simon Glass 2021-11-13 19:40:59 -07:00 committed by Felix Held
parent 4298e13868
commit 03f0fa1822
3 changed files with 13 additions and 10 deletions

View File

@ -197,7 +197,7 @@ payloads/external/GRUB2/grub2/build/default_payload.elf: grub2
# U-Boot
payloads/external/U-Boot/u-boot/u-boot-dtb.bin u-boot: $(DOTCONFIG)
payloads/external/U-Boot/build/u-boot/u-boot-dtb.bin u-boot: $(DOTCONFIG)
$(MAKE) -C payloads/external/U-Boot \
CONFIG_UBOOT_MASTER=$(CONFIG_UBOOT_MASTER) \
CONFIG_UBOOT_STABLE=$(CONFIG_UBOOT_STABLE)

View File

@ -32,7 +32,7 @@ config PAYLOAD_CONFIGFILE
from the U-Boot config directory
config PAYLOAD_FILE
default "payloads/external/U-Boot/u-boot/u-boot-dtb.bin"
default "payloads/external/U-Boot/build/u-boot/u-boot-dtb.bin"
config PAYLOAD_OPTIONS
default "-l 0x1110000 -e 0x1110015"

View File

@ -9,7 +9,10 @@ TAG-$(CONFIG_UBOOT_STABLE)=$(STABLE_COMMIT_ID)
project_name=U-Boot
project_dir=u-boot
project_git_repo=http://git.denx.de/u-boot.git
project_config_file=$(project_dir)/.config
project_build_dir=build
project_config_file=$(project_build_dir)/.config
make_args=-C $(project_dir) O=../build
unexport KCONFIG_AUTOHEADER
unexport KCONFIG_AUTOCONFIG
@ -31,11 +34,11 @@ ifeq ($(CONFIG_UBOOT_MASTER),y)
git fetch
#master doesn't get a file, so it's continuously updated
rm -f $(project_dir)/$(STABLE_COMMIT_ID)
rm -f $(STABLE_COMMIT_ID)
else
cd $(project_dir); git show $(TAG-y) >/dev/null 2>&1 ; if [ $$? -ne 0 ]; \
then echo " Fetching new commits from the $(project_name) git repo"; git fetch; fi
touch $(project_dir)/$(STABLE_COMMIT_ID)
touch $(STABLE_COMMIT_ID)
endif
checkout: fetch
@ -43,26 +46,26 @@ checkout: fetch
cd $(project_dir); git checkout master; git branch -D coreboot 2>/dev/null; git checkout -b coreboot $(TAG-y)
config: checkout
mkdir -p $(project_build_dir)
rm -f $(project_config_file)
ifneq ($(CONFIG_PAYLOAD_CONFIGFILE),)
ifneq ("$(wildcard $(CONFIG_PAYLOAD_CONFIGFILE))","")
cat $(CONFIG_PAYLOAD_CONFIGFILE)" > tag-$(project_config_file)
$(MAKE) $(make_args) olddefconfig
else
echo "Error: File $(CONFIG_PAYLOAD_CONFIGFILE) does not exist"
false
endif
else
cat $(project_dir)/configs/coreboot_defconfig >> $(project_config_file)
$(MAKE) $(make_args) coreboot_defconfig
endif
$(MAKE) -C $(project_dir) olddefconfig
build: config
echo " MAKE $(project_name) $(TAG-y)"
$(MAKE) -C $(project_dir)
$(MAKE) $(make_args)
clean:
test -d $(project_dir) && $(MAKE) -C $(project_dir) clean || exit 0
test -d $(project_dir) && $(MAKE) $(make_args) clean || exit 0
distclean:
rm -rf $(project_dir)