From 797ea9820cf85832fdf15022e562d1945511d798 Mon Sep 17 00:00:00 2001
From: Jens Wiklander <jens.wiklander@linaro.org>
Date: Mon, 5 Feb 2018 13:08:49 +0100
Subject: [PATCH] hikey: build using buildroot

Acked-by: Joakim Bech <joakim.bech@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 hikey.mk | 89 ++++----------------------------------------------------
 1 file changed, 5 insertions(+), 84 deletions(-)

diff --git a/hikey.mk b/hikey.mk
index 03bba73..31a0a41 100644
--- a/hikey.mk
+++ b/hikey.mk
@@ -58,13 +58,11 @@ STRACE_PATH			?=$(ROOT)/strace
 all: prepare arm-tf boot-img lloader nvme
 
 .PHONY: clean
-clean: arm-tf-clean atf-fb-clean busybox-clean edk2-clean linux-clean \
-		optee-os-clean optee-client-clean xtest-clean \
-		optee-examples-clean strace-clean update_rootfs-clean \
-		boot-img-clean lloader-clean grub-clean
+clean: arm-tf-clean atf-fb-clean buildroot-clean edk2-clean linux-clean \
+		optee-os-clean boot-img-clean lloader-clean grub-clean
 
 .PHONY: cleaner
-cleaner: clean prepare-cleaner busybox-cleaner linux-cleaner strace-cleaner \
+cleaner: clean prepare-cleaner buildroot-cleaner linux-cleaner \
 		nvme-cleaner grub-cleaner
 
 include toolchain.mk
@@ -107,21 +105,6 @@ arm-tf: optee-os edk2
 arm-tf-clean:
 	$(ARM_TF_EXPORTS) $(MAKE) -C $(ARM_TF_PATH) $(ARM_TF_FLAGS) clean
 
-################################################################################
-# Busybox
-################################################################################
-BUSYBOX_COMMON_TARGET = hikey nocpio
-BUSYBOX_CLEAN_COMMON_TARGET = hikey clean
-
-.PHONY: busybox
-busybox: busybox-common
-
-.PHONY: busybox-clean
-busybox-clean: busybox-clean-common
-
-.PHONY: busybox-cleaner
-busybox-cleaner: busybox-clean-common busybox-cleaner-common
-
 ################################################################################
 # EDK2 / Tianocore
 ################################################################################
@@ -211,68 +194,6 @@ optee-os: optee-os-common
 .PHONY: optee-os-clean
 optee-os-clean: optee-os-clean-common
 
-.PHONY: optee-client
-optee-client: optee-client-common
-
-.PHONY: optee-client-clean
-optee-client-clean: optee-client-clean-common
-
-################################################################################
-# xtest / optee_test
-################################################################################
-.PHONY: xtest
-xtest: xtest-common
-
-# FIXME:
-# "make clean" in xtest: fails if optee_os has been cleaned previously
-.PHONY: xtest-clean
-xtest-clean: xtest-clean-common
-	rm -rf $(OPTEE_TEST_OUT_PATH)
-
-.PHONY: xtest-patch
-xtest-patch: xtest-patch-common
-
-################################################################################
-# Sample applications / optee_examples
-################################################################################
-.PHONY: optee-examples
-optee-examples: optee-examples-common
-
-.PHONY: optee-examples-clean
-optee-examples-clean: optee-examples-clean-common
-
-################################################################################
-# strace
-################################################################################
-.PHONY: strace
-strace:
-	cd $(STRACE_PATH); \
-	./bootstrap; \
-	set -e; \
-	./configure --host=$(MULTIARCH) --enable-mpers=no CC="$(CCACHE)$(AARCH$(COMPILE_NS_USER)_CROSS_COMPILE)gcc" LD=$(AARCH$(COMPILE_NS_USER)_CROSS_COMPILE)ld; \
-	CC="$(CCACHE)$(AARCH$(COMPILE_NS_USER)_CROSS_COMPILE)gcc" LD=$(AARCH$(COMPILE_NS_USER)_CROSS_COMPILE)ld $(MAKE) -C $(STRACE_PATH)
-
-.PHONY: strace-clean
-strace-clean:
-	if [ -e $(STRACE_PATH)/Makefile ]; then $(MAKE) -C $(STRACE_PATH) clean; fi
-
-.PHONY: strace-cleaner
-strace-cleaner: strace-clean
-	rm -f $(STRACE_PATH)/Makefile $(STRACE_PATH)/configure
-
-################################################################################
-# Root FS
-################################################################################
-.PHONY: filelist-tee
-filelist-tee: strace filelist-tee-common
-	env TOP=$(ROOT) $(expand-env-var) <$(PATCHES_PATH)/rootfs/initramfs-add-files.txt >> $(GEN_ROOTFS_FILELIST)
-
-.PHONY: update_rootfs
-update_rootfs: update_rootfs-common
-
-.PHONY: update_rootfs-clean
-update_rootfs-clean: update_rootfs-clean-common
-
 ################################################################################
 # grub
 ################################################################################
@@ -326,7 +247,7 @@ GRUBCFG = $(PATCHES_PATH)/grub/grub_uart0.cfg
 endif
 
 .PHONY: boot-img
-boot-img: linux update_rootfs edk2 grub
+boot-img: linux buildroot edk2 grub
 	rm -f $(BOOT_IMG)
 	mformat -i $(BOOT_IMG) -n 64 -h 255 -T 131072 -v "BOOT IMG" -C ::
 	mcopy -i $(BOOT_IMG) $(LINUX_PATH)/arch/arm64/boot/Image ::
@@ -335,7 +256,7 @@ boot-img: linux update_rootfs edk2 grub
 	mmd -i $(BOOT_IMG) ::/EFI/BOOT
 	mcopy -i $(BOOT_IMG) $(OUT_PATH)/grubaa64.efi ::/EFI/BOOT/
 	mcopy -i $(BOOT_IMG) $(GRUBCFG) ::/EFI/BOOT/grub.cfg
-	mcopy -i $(BOOT_IMG) $(GEN_ROOTFS_PATH)/filesystem.cpio.gz ::/initrd.img
+	mcopy -i $(BOOT_IMG) $(ROOT)/out-br/images/rootfs.cpio.gz ::/initrd.img
 	mcopy -i $(BOOT_IMG) $(EDK2_PATH)/Build/HiKey/$(EDK2_BUILD)_$(EDK2_TOOLCHAIN)/$(EDK2_ARCH)/AndroidFastbootApp.efi ::/EFI/BOOT/fastboot.efi
 
 .PHONY: boot-img-clean
-- 
GitLab