Skip to content

Commit

Permalink
package/uboot-tools: migrate BR2_TARGET_UBOOT_BOOT_SCRIPT from U-Boot…
Browse files Browse the repository at this point in the history
… pkg

For consistancy and dependencies between uboot and uboot-tools,
this patch migrates the script creation over in a similar way as
the env image creation.

Cc: Arnout Vandecappelle <[email protected]>
Signed-off-by: Matthew Weber <[email protected]>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
  • Loading branch information
rc-matthew-l-weber authored and arnout committed Oct 6, 2020
1 parent 78559d6 commit db2b684
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 29 deletions.
18 changes: 18 additions & 0 deletions Config.in.legacy
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,24 @@ endif

comment "Legacy options removed in 2020.11"

config BR2_TARGET_UBOOT_BOOT_SCRIPT
bool "u-boot script generation was moved"
select BR2_LEGACY
select BR2_PACKAGE_HOST_UBOOT_TOOLS
select BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT
help
Migrated U-Boot script generation to uboot-tools

# Note: BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE is still referenced from
# package/uboot-tools/Config.in
config BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE
string "The uboot script source string has been renamed"
depends on BR2_TARGET_UBOOT_BOOT_SCRIPT
help
Migrated U-Boot script generation to uboot-tools.
New option is named
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE

config BR2_TARGET_UBOOT_ENVIMAGE
bool "u-boot env generation was moved"
select BR2_LEGACY
Expand Down
16 changes: 0 additions & 16 deletions boot/uboot/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -533,22 +533,6 @@ config BR2_TARGET_UBOOT_ALTERA_SOCFPGA_IMAGE_CRC
In either case the resulting file will be given a .crc
extension.

config BR2_TARGET_UBOOT_BOOT_SCRIPT
bool "Generate a U-Boot boot script"
help
Generate a U-Boot boot script, given a file listing U-Boot
commands to be executed at boot time. The generated boot
script will be called 'boot.scr'.

if BR2_TARGET_UBOOT_BOOT_SCRIPT

config BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE
string "U-Boot boot script source"
help
Source file to generate the U-Boot boot script.

endif

if BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG

config BR2_TARGET_UBOOT_CUSTOM_DTS_PATH
Expand Down
13 changes: 0 additions & 13 deletions boot/uboot/uboot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,6 @@ define UBOOT_INSTALL_IMAGES_CMDS
cp -dpf $(@D)/$(f) $(BINARIES_DIR)/
)
)
$(if $(BR2_TARGET_UBOOT_BOOT_SCRIPT),
$(MKIMAGE) -C none -A $(MKIMAGE_ARCH) -T script \
-d $(call qstrip,$(BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE)) \
$(BINARIES_DIR)/boot.scr)
endef

ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y)
Expand Down Expand Up @@ -427,15 +423,6 @@ define UBOOT_KCONFIG_FIXUP_CMDS
$(UBOOT_ZYNQMP_KCONFIG_PSU_INIT)
endef

ifeq ($(BR2_TARGET_UBOOT_BOOT_SCRIPT),y)
ifeq ($(BR_BUILDING),y)
ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE)),)
$(error Please define a source file for U-Boot boot script (BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE setting))
endif
endif
UBOOT_DEPENDENCIES += host-uboot-tools
endif

ifeq ($(BR2_TARGET_UBOOT)$(BR_BUILDING),yy)

#
Expand Down
17 changes: 17 additions & 0 deletions package/uboot-tools/Config.in.host
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,21 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_REDUNDANT

endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE

config BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT
bool "Generate a U-Boot boot script"
help
Generate a U-Boot boot script, given a file listing U-Boot
commands to be executed at boot time. The generated boot
script will be called 'boot.scr'.

if BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT

config BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE
string "U-Boot boot script source"
default BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE if BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE != "" # legacy
help
Source file to generate the U-Boot boot script.

endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT

endif # BR2_PACKAGE_HOST_UBOOT_TOOLS
12 changes: 12 additions & 0 deletions package/uboot-tools/uboot-tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,23 @@ endif #BR_BUILDING

endif #BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE

ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT),y)
ifeq ($(BR_BUILDING),y)
ifeq ($(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE)),)
$(error Please define a source file for U-Boot boot script (BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE setting))
endif
endif #BR_BUILDING
endif #BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT

define HOST_UBOOT_TOOLS_INSTALL_CMDS
$(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(HOST_DIR)/bin/mkimage
$(INSTALL) -m 0755 -D $(@D)/tools/mkenvimage $(HOST_DIR)/bin/mkenvimage
$(INSTALL) -m 0755 -D $(@D)/tools/dumpimage $(HOST_DIR)/bin/dumpimage
$(HOST_UBOOT_TOOLS_GENERATE_ENV_IMAGE)
$(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT),
$(MKIMAGE) -C none -A $(MKIMAGE_ARCH) -T script \
-d $(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE)) \
$(BINARIES_DIR)/boot.scr)
endef

$(eval $(generic-package))
Expand Down

0 comments on commit db2b684

Please sign in to comment.