mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-27 05:06:39 +00:00
linux: de-duplicate DTB and Linux image installation
Currently, the LINUX_INSTALL_DTB and LINUX_INSTALL_DTB_TARGET macros are exactly the same, except for the target directory. Similarly, LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET and LINUX_INSTALL_IMAGES_CMDS are copying the kernel image, just to a different place (and with a different strategy). As a preparation for future additions, this commit de-duplicate this code: - LINUX_INSTALL_DTB becomes a make macro that takes one argument: the destination directory. - LINUX_INSTALL_IMAGE is a new make macro that also takes on argument: the destination directory. Both macros are used by LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET and LINUX_INSTALL_IMAGES_CMDS to respectively install to the target directory and the images directory. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
4e793b82a5
commit
55b80d3bb9
@ -262,14 +262,7 @@ define LINUX_INSTALL_DTB
|
|||||||
cp $(addprefix \
|
cp $(addprefix \
|
||||||
$(KERNEL_ARCH_PATH)/boot/$(if $(wildcard \
|
$(KERNEL_ARCH_PATH)/boot/$(if $(wildcard \
|
||||||
$(addprefix $(KERNEL_ARCH_PATH)/boot/dts/,$(KERNEL_DTBS))),dts/),$(KERNEL_DTBS)) \
|
$(addprefix $(KERNEL_ARCH_PATH)/boot/dts/,$(KERNEL_DTBS))),dts/),$(KERNEL_DTBS)) \
|
||||||
$(BINARIES_DIR)/
|
$(1)
|
||||||
endef
|
|
||||||
define LINUX_INSTALL_DTB_TARGET
|
|
||||||
# dtbs moved from arch/<ARCH>/boot to arch/<ARCH>/boot/dts since 3.8-rc1
|
|
||||||
cp $(addprefix \
|
|
||||||
$(KERNEL_ARCH_PATH)/boot/$(if $(wildcard \
|
|
||||||
$(addprefix $(KERNEL_ARCH_PATH)/boot/dts/,$(KERNEL_DTBS))),dts/),$(KERNEL_DTBS)) \
|
|
||||||
$(TARGET_DIR)/boot/
|
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -310,11 +303,14 @@ define LINUX_BUILD_CMDS
|
|||||||
$(LINUX_APPEND_DTB)
|
$(LINUX_APPEND_DTB)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define LINUX_INSTALL_IMAGE
|
||||||
|
$(INSTALL) -m 0644 -D $(LINUX_IMAGE_PATH) $(1)/$(LINUX_IMAGE_NAME)
|
||||||
|
endef
|
||||||
|
|
||||||
ifeq ($(BR2_LINUX_KERNEL_INSTALL_TARGET),y)
|
ifeq ($(BR2_LINUX_KERNEL_INSTALL_TARGET),y)
|
||||||
define LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET
|
define LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET
|
||||||
install -m 0644 -D $(LINUX_IMAGE_PATH) $(TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
|
$(call LINUX_INSTALL_IMAGE,$(TARGET_DIR)/boot)
|
||||||
$(LINUX_INSTALL_DTB_TARGET)
|
$(call LINUX_INSTALL_DTB,$(TARGET_DIR)/boot)
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -328,8 +324,8 @@ endef
|
|||||||
|
|
||||||
|
|
||||||
define LINUX_INSTALL_IMAGES_CMDS
|
define LINUX_INSTALL_IMAGES_CMDS
|
||||||
cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
|
$(call LINUX_INSTALL_IMAGE,$(BINARIES_DIR))
|
||||||
$(LINUX_INSTALL_DTB)
|
$(call LINUX_INSTALL_DTB,$(BINARIES_DIR))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define LINUX_INSTALL_TARGET_CMDS
|
define LINUX_INSTALL_TARGET_CMDS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user