While I’m somewhat versed in configuring Buildroot to create images for Kirkwood SoC’s and a few more, I’m greener when it comes to using the Openwrt setup.
I want to define EXTRA_IMAGE_NAME that will resolve to: dg-custom-built_2026-03-16-1612 for instance. I was able to do this easily in Buildroot, with :
BR2_TARGET_GENERIC_ISSUE="Kirkwood SoC Rescue/EntwareHost - built $(date \"+%m-%d-%Y %H:%M:%S %Z\")"
… but here it seems unwilling to resolve anything correctly… such as…
# Define the timestamp variable
PKG_DATE:= $(shell date +%m-%d-%Y_%H-%M-%S)
# Define the custom image name using the timestamp
EXTRA_IMAGE_NAME:= dg-custom-built_$(PKG_DATE).bin
# Example usage in a build command
build:
@echo "Building image: $(EXTRA_IMAGE_NAME)"
make image PROFILE="your_profile" BIN_DIR="./bin" EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)"
or something to that effect.
EDIT
Just to be clear and for future reference, the above solution is for a makefile, not for a one liner. Hence the no quotes, which may cause issues if used in a makefile like your timestamp.
There are two directives that it seems to (stubbornly) refuse to honor: (1) underscore character in the extra_image_filename and (2) capitals... I tried to get a capital DG and and underscore between the date_time, but caps were smallified and underscored "dashed". Also, CDT becomes cdt, even though I invoked the ^Z.
These options allow to override the version information embedded in the /etc/openwrt_version, /etc/openwrt_release, /etc/banner, /etc/opkg.conf, and /etc/os-release files. Usually there is no need to set these, but they're useful for release builds or custom OpenWrt redistributions that should carry custom version tags.