From 17bcc68f5d092540cd02b36a712679098e848c09 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Wed, 2 May 2018 16:13:23 -0400 Subject: [PATCH] fix symlink install of busybox so that it happens even on parallel builds (#394) --- Makefile | 14 -------------- modules/busybox | 20 ++++++++++++++++++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 37e22821..8fa72b53 100644 --- a/Makefile +++ b/Makefile @@ -394,20 +394,6 @@ $(foreach m, $(modules-y), \ $(call map,initrd_lib_add,$(call libs,$m)) \ ) -# hack to install busybox into the initrd if busybox is configured -ifeq "$(CONFIG_BUSYBOX)" "y" -initrd_bins += $(initrd_bin_dir)/busybox -endif - -$(initrd_bin_dir)/busybox: $(build)/$(busybox_dir)/busybox - $(do,SYMLINK,$@,$(MAKE) \ - -C $(build)/$(busybox_dir) \ - CC="$(heads_cc)" \ - CONFIG_PREFIX="$(pwd)/initrd" \ - $(MAKE_JOBS) \ - install \ - ) - # # hack to build cbmem from coreboot # this must be built *AFTER* musl, but since coreboot depends on other things diff --git a/modules/busybox b/modules/busybox index 58b06b97..470cfd39 100644 --- a/modules/busybox +++ b/modules/busybox @@ -13,8 +13,24 @@ busybox_config := config/busybox.config busybox_output := busybox busybox_target := \ $(CROSS_TOOLS) \ - CONFIG_PREFIX="$(initrd_tmp_dir)" \ $(MAKE_JOBS) \ - install + +# Install symlinks when the busybox program is installed + +ifeq "$(CONFIG_BUSYBOX)" "y" +initrd_bins += $(initrd_bin_dir)/busybox +endif + +$(initrd_tmp_dir)/bin/busybox: $(build)/$(busybox_dir)/.build + $(call do,SYMLINK,bin/busybox,\ + $(MAKE) \ + -C $(build)/$(busybox_dir) \ + CC="$(heads_cc)" \ + CONFIG_PREFIX="$(initrd_bin_dir)/.." \ + install \ + | tee -a $(build)/log/busybox.log \ + $(VERBOSE_REDIRECT) \ + ) + busybox_depends := $(musl_dep)